OpenLexocad  28.0
Shape.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <Base/Base.h>
4 #include <Core/Variant.h>
5 #include <Geom/Bnd_Box.h>
6 #include <Topo/Types.h>
7 
8 
9 class CA_Detail;
10 class CA_Snap;
11 class ENTITY;
12 
13 namespace Core
14 {
15 class DbgInfo;
16 } // namespace Core
17 
18 namespace Acis
19 {
20 class AcisWireTool;
21 } // namespace Acis
22 
23 
24 namespace Topo
25 {
26 class ShapeTool;
27 class MeshTool;
28 class CompoundTool;
29 class SolidTool;
30 class ShellTool;
31 class FaceTool;
32 class WireTool;
33 class EdgeTool;
34 class VertexTool;
35 class ShapeVariantHandler;
36 
37 enum class ShapeType
38 {
39  MESH,
40  COMPOUND,
41  COMPSOLID,
42  NCOMPOUND,
43  SOLID,
44  SHELL,
45  FACE,
46  WIRE,
47  EDGE,
48  VERTEX,
49  SHAPE,
50  UNDEFINED
51 };
52 
53 
54 
55 class LX_TOPO_EXPORT ShapeFactory
56 {
57 public:
58  friend class Shape;
59  static std::map<std::string, ShapeFactory*> registry;
60  static pShape read(const std::string& format, const std::string& data, int version);
61  static pShape read(const std::string& format, std::istream& reader);
62  static pShape read(const std::string& format, const Base::String& fileName);
63 
64 private:
65  virtual pShape read(const std::string& data, int version) = 0;
66  virtual pShape read(std::istream& reader) = 0;
67  virtual pShape read(const Base::String& fileName) = 0;
68 };
69 
70 
71 
77 class LX_TOPO_EXPORT TopologicalItem
78 #ifndef SWIG
79  : public Base::BaseClass
80 #endif
81 {
83 
84 public:
85  TopologicalItem() = default;
86  virtual ~TopologicalItem() = default;
87 
88  enum class MesherType
89  {
90  Default_Mesher,
91  Acis_Mesher,
92  Compound_Mesher
93  };
94 
95  enum class ModelingKernel
96  {
97  OCC,
98  ACIS,
99  CARVE,
100  MIXED, // -> for compound
101  UNKNOWN
102  };
103 
104  virtual MesherType getMesherType() const = 0;
105  virtual ModelingKernel getModelingKernel() const = 0;
107  virtual pConstTopologicalItem getOwner() const = 0;
108  virtual Topo::ShapeTool* getShapeTool() const = 0;
110 
111  virtual ENTITY* getEntity() const { return 0; } // why do we return ACIS class in common interface?
112  // It should be in Acis class, or we can directly store ENTITY here and have the necessary interface -> not polluting Acis classes
113 
114 protected:
115  TopologicalItem(ENTITY* /*ent*/){};
116 
118 };
119 
120 
121 
127 class LX_TOPO_EXPORT Shape : public Topo::TopologicalItem
128 #ifndef SWIG
129  ,
130  public std::enable_shared_from_this<Topo::Shape>
131 #endif
132 {
134 
135 public:
136  Shape() = default;
138  virtual ~Shape() = default;
139 
140  friend class ShapeTool;
141  friend class FaceTool;
142 
144  {
147  Unchecked
148  };
149 
150  bool getGeometricInformation(Topo::GeometricInformation&) const override { return false; }
151 
152  virtual void transform(const Geom::Trsf& t);
153  virtual Geom::Trsf getTransform() const;
154  virtual Topo::ShapeType getShapeType() const = 0;
155 
157  operator Core::Variant() const;
158  pConstTopologicalItem getOwner() const override;
159 
161  bool hasShapeAttributes() const;
169  virtual Geom::Bnd_Box getBoundingBox() const = 0;
170 
171  virtual void setIndexMesh(pIndexedMesh m);
172  virtual pIndexedMesh getIndexedMesh() const;
173  virtual bool createIndexedMesh(pIndexedMesh m) const;
174 
177 
178  virtual std::shared_ptr<Core::DbgInfo> getDbgInfo() const;
179  virtual Topo::Shape* clone(bool deepcopy) const = 0;
180 
181  virtual bool wasCreatedWithProblems() const { return false; }
182  virtual void setWasCreatedWithProblems(bool) {}
183 
184  mutable std::set<Core::DocObject*> m_appGeometryBackLinks{};
185 
186 protected:
187  Shape(ENTITY* ent);
188 
189  virtual void copyFrom(pConstShape rhs, bool deepCopy = true) = 0;
190 
191  virtual bool isSingleFace() const;
192  virtual bool isSingleWire() const;
193  virtual bool isSingleEdge() const;
194  virtual bool isSingleVertex() const;
195  virtual bool isSolid() const;
196  virtual bool isClosedSolid() const;
197  virtual bool isWire() const;
198  virtual bool isCompound() const;
199  virtual bool isMesh() const { return false; }
200 
201  bool _copy(const Topo::Shape* rhs, bool deepCopy = true);
202 
203 private:
205  static Topo::ShapeVariantHandler* _vHnd;
206  Topo::ShapeAttributes* _myAtts = nullptr;
207  pIndexedMesh _indexedMesh{};
208  pIndexedDrawable _indexedDrawable{};
209 };
210 
211 
212 
218 class LX_TOPO_EXPORT MeshShape : public Topo::Shape
219 {
221 
222 public:
223  typedef std::vector<int> MeshModel;
224  typedef std::vector<MeshModel> SubMeshModels;
225 
226  MeshShape() = default;
227  MeshShape(pConstMesh rhs, bool deepCopy = true);
228  virtual ~MeshShape() = default;
229 
230  friend class MeshTool;
231 
232  virtual void copyFrom(pConstMesh rhs, bool deepCopy = true) = 0;
233  virtual pConstBrepData getMeshAsBrepData() const = 0;
234  virtual void getTextureCoordinates(std::vector<Geom::Pnt2d>& textureCoordinates, std::vector<int>& textureIndices) const = 0;
235  virtual bool calculateDetail(CA_Detail& detail, const CA_Snap& theSnap) = 0;
236  virtual void getEdges(std::vector<std::pair<Geom::Pnt, Geom::Pnt> >& lines) const = 0;
237  virtual bool getEdge(int idx, std::pair<Geom::Pnt, Geom::Pnt>& line) const = 0;
238  virtual void getPoints(std::vector<Geom::Pnt>& points) const = 0;
239  virtual void getModel(MeshModel& model) const = 0;
240  virtual std::vector<Geom::Pnt> getNormals() const = 0;
241  virtual void getOuterBoundaries(std::vector<Geom::Pnt>& points, std::vector<int>& edges) const = 0;
242  virtual void getFacePoints(int index, std::vector<Geom::Pnt>& points) const = 0;
243 
244 protected:
245  void copyFrom(pConstShape rhs, bool deepCopy = true) override;
246  virtual Topo::MeshTool* getMeshTool() const = 0;
247 };
248 
249 
250 
257 class LX_TOPO_EXPORT Compound : public Topo::Shape
258 {
260 
261 public:
262  Compound() = default;
263  Compound(pConstCompound rhs, bool deepCopy = true);
264  virtual ~Compound() = default;
265 
266  friend class CompoundTool;
267 
268  virtual void copyFrom(pConstCompound rhs, bool deepCopy = true) = 0;
269 
270 protected:
271  Compound(ENTITY* ent) : Shape(ent) {}
272  virtual Topo::CompoundTool* getCompoundTool() const = 0;
273 };
274 
275 
276 
283 class LX_TOPO_EXPORT Solid : public Topo::Shape
284 {
286 
287 public:
288  Solid() = default;
289  Solid(pConstSolid rhs, bool deepCopy = true);
290  virtual ~Solid() = default;
291 
292  friend class SolidTool;
293 
294  virtual void copyFrom(pConstSolid rhs, bool deepCopy = true) = 0;
295 
296 protected:
297  Solid(ENTITY* ent) : Shape(ent) {}
298  virtual Topo::SolidTool* getSolidTool() const = 0;
299 };
300 
307 class LX_TOPO_EXPORT Shell : public Topo::TopologicalItem
308 #ifndef SWIG
309  ,
310  public std::enable_shared_from_this<Topo::Shell>
311 #endif
312 {
314 
315 public:
316  Shell() = default;
317  Shell(pConstShell rhs, bool deepCopy = true);
318  virtual ~Shell() = default;
319 
320  friend class ShellTool;
321 
322  virtual void copyFrom(pConstShell rhs, bool deepCopy = true) = 0;
323  virtual void transform(const Geom::Trsf&) {}
324 
325 protected:
326  Shell(ENTITY* ent) : TopologicalItem(ent) {}
327  virtual Topo::ShellTool* getShellTool() const = 0;
328 };
329 
330 
337 class LX_TOPO_EXPORT Face : public Topo::TopologicalItem
338 #ifndef SWIG
339  ,
340  public std::enable_shared_from_this<Topo::Face>
341 #endif
342 {
344 
345 public:
346  Face() = default;
347  Face(pConstFace rhs, bool deepCopy = false);
348  virtual ~Face() = default;
349 
350  friend class FaceTool;
351 
353  virtual bool getFaceNormal(const Geom::Pnt& pnt, Geom::Dir& dir, Geom::Pnt& pointOnFace) const = 0;
354  virtual Core::DocObject* getGeometry() const { return nullptr; }
355  virtual void transform(const Geom::Trsf&) {}
356 
357 protected:
358  Face(ENTITY* ent) : TopologicalItem(ent) {}
359  virtual Topo::FaceTool* getFaceTool() const = 0;
360 };
361 
362 
369 class LX_TOPO_EXPORT Wire : public Topo::TopologicalItem
370 #ifndef SWIG
371  ,
372  public std::enable_shared_from_this<Topo::Wire>
373 #endif
374 {
376 
377 public:
378  Wire() = default;
379  // Wire(pConstWire rhs, bool deepCopy = false); // AB 11.5.2022 do we need it? It is not used
380  virtual ~Wire() = default;
381 
382  friend class WireTool;
383  friend class Acis::AcisWireTool;
384 
385  virtual void copyFrom(pConstWire rhs, bool deepCopy = true) = 0;
386  virtual int getEdgeCount() const = 0;
387  virtual pConstEdge getEdgeByIndex(int idx) const = 0;
388  virtual void transform(const Geom::Trsf&) {}
389  virtual bool isLoop() const { return false; }
390 
391 protected:
392  Wire(ENTITY* ent) : TopologicalItem(ent) {}
393  virtual Topo::WireTool* getWireTool() const = 0;
394 };
395 
396 
397 
403 class LX_TOPO_EXPORT Edge : public Topo::TopologicalItem
404 #ifndef SWIG
405  ,
406  public std::enable_shared_from_this<Topo::Edge>
407 #endif
408 {
410 
411 public:
412  Edge() = default;
413  Edge(pConstEdge rhs, bool deepCopy = true);
414  virtual ~Edge() = default;
415 
416  friend class EdgeTool;
417 
418  virtual void copyFrom(pConstEdge rhs, bool deepCopy = true) = 0;
420  // operator Core::Variant() const;
421  virtual void transform(const Geom::Trsf&) {}
422 
423 protected:
424  Edge(ENTITY* ent) : TopologicalItem(ent) {}
425  virtual Topo::EdgeTool* getEdgeTool() const = 0;
426 
427 private:
428  double _passagePntParam;
429  bool _hasPassagePntParam = false;
430 };
431 
438 class LX_TOPO_EXPORT Coedge : public Topo::TopologicalItem
439 #ifndef SWIG
440  ,
441  public std::enable_shared_from_this<Topo::Coedge>
442 #endif
443 {
445 
446 public:
447  Coedge() = default;
448  Coedge(pConstCoedge rhs, bool deepCopy = true);
449  virtual ~Coedge() = default;
450 
451  friend class EdgeTool;
452 
453  virtual void copyFrom(pConstCoedge rhs, bool deepCopy = true) = 0;
455  // operator Core::Variant() const;
456  virtual void transform(const Geom::Trsf&) {}
457  virtual pConstEdge getEdge() const = 0;
458 
459 protected:
460  Coedge(ENTITY* ent) : TopologicalItem(ent) {}
461  virtual Topo::EdgeTool* getEdgeTool() const = 0;
462 
463 private:
464  double _passagePntParam;
465  bool _hasPassagePntParam = false;
466 };
467 
474 class LX_TOPO_EXPORT Vertex : public Topo::TopologicalItem
475 #ifndef SWIG
476  ,
477  public std::enable_shared_from_this<Topo::Vertex>
478 #endif
479 {
481 
482 public:
483  Vertex() = default;
484  Vertex(pConstVertex rhs, bool deepCopy = true);
485  virtual ~Vertex() = default;
486 
487  friend class VertexTool;
488 
489  virtual void copyFrom(pConstVertex rhs, bool deepCopy = true) = 0;
490  virtual Geom::Pnt getPoint() const = 0;
491  virtual void transform(const Geom::Trsf&) {}
492 
493 protected:
494  Vertex(ENTITY* ent) : TopologicalItem(ent) {}
495  virtual Topo::VertexTool* getVertexTool() const = 0;
496 };
497 
498 
499 
500 class LX_TOPO_EXPORT LazyFacetedBrepShape : public Topo::Shape
501 {
503 
504 public:
505  LazyFacetedBrepShape() = default;
507  virtual ~LazyFacetedBrepShape() = default;
508 };
509 
510 
511 
512 class LX_TOPO_EXPORT FacetedShape
513 {
514 public:
515  FacetedShape() = default;
516  virtual ~FacetedShape() = default;
517 
518  std::vector<Geom::Pnt> face_vertices;
519  std::vector<long> face_coordinateIndices;
520  std::vector<Geom::Dir> face_per_vertex_normals;
521 
522  std::vector<Geom::Pnt> wire_vertices;
523  std::vector<long> wire_coordinateIndices;
524 };
525 
526 
527 
528 class LX_TOPO_EXPORT ShapeVariantHandler : public Core::VariantHandler
529 {
530 public:
532  bool isEqual(const Core::Variant& v1, const Core::Variant& v2, double /*tolerance*/ = 1E-06) const
533  {
534  bool ok1, ok2;
535  if (v1.getValue<pShape>(&ok1) == v2.getValue<pShape>(&ok2) && ok1 && ok2)
536  return true;
537  else
538  return false;
539  }
540  int getType() { return (int)Core::Variant::Shape; }
542 };
543 
544 class LX_TOPO_EXPORT ConstShapeVariantHandler : public Core::VariantHandler
545 {
546 public:
548  bool isEqual(const Core::Variant& v1, const Core::Variant& v2, double /*tolerance*/ = 1E-06) const
549  {
550  bool ok1, ok2;
551  if (v1.getValue<pConstShape>(&ok1) == v2.getValue<pConstShape>(&ok2) && ok1 && ok2)
552  return true;
553  else
554  return false;
555  }
556  int getType() { return (int)Core::Variant::ConstShape; }
558 };
559 
560 } // namespace Topo
561 
562 #define REGISTER_SHAPE_FACTORY(_factoryName_, _shapeFormat_) Topo::ShapeFactory::registry[_shapeFormat_] = (Topo::ShapeFactory*)new _factoryName_();
Topo::Face
Definition: Shape.h:342
pConstShell
std::shared_ptr< Topo::Shell const > pConstShell
Definition: Types.h:69
Topo::ShapeType
ShapeType
Definition: Shape.h:38
pConstVertex
std::shared_ptr< Topo::Vertex const > pConstVertex
Definition: Types.h:74
Topo::Wire::getWireTool
virtual Topo::WireTool * getWireTool() const =0
Topo::Vertex::Vertex
Vertex(pConstVertex rhs, bool deepCopy=true)
Topo::ConstShapeVariantHandler
Definition: Shape.h:545
Topo::Face::Face
Face(ENTITY *ent)
Definition: Shape.h:358
Topo::ShapeType::UNDEFINED
@ UNDEFINED
Topo::Face::Face
Face()=default
Geom::Bnd_Box
Definition: Bnd_Box.h:67
Topo::MeshShape::calculateDetail
virtual bool calculateDetail(CA_Detail &detail, const CA_Snap &theSnap)=0
Topo::Compound::Compound
Compound(ENTITY *ent)
Definition: Shape.h:271
Base::BaseClass
BaseClass class and root of the type system.
Definition: Base.h:78
Topo::Shape::isSingleFace
virtual bool isSingleFace() const
Topo::Vertex::getVertexTool
virtual Topo::VertexTool * getVertexTool() const =0
Topo::Shape::getIndexedDrawable
virtual pIndexedDrawable getIndexedDrawable() const
Topo::ShapeVariantHandler
Definition: Shape.h:529
Topo::Edge::Edge
Edge(pConstEdge rhs, bool deepCopy=true)
Topo::Wire::getEdgeByIndex
virtual pConstEdge getEdgeByIndex(int idx) const =0
Topo::ShapeType::VERTEX
@ VERTEX
Topo::Shape::isSingleVertex
virtual bool isSingleVertex() const
Topo::Solid::Solid
Solid(ENTITY *ent)
Definition: Shape.h:297
Topo::Shape::getDbgInfo
virtual std::shared_ptr< Core::DbgInfo > getDbgInfo() const
Topo::Edge::getEdgeTool
virtual Topo::EdgeTool * getEdgeTool() const =0
Topo::Vertex::transform
virtual void transform(const Geom::Trsf &)
Definition: Shape.h:491
Topo::MeshShape
Definition: Shape.h:219
Topo::Shape
Definition: Shape.h:132
Topo::MeshShape::getPoints
virtual void getPoints(std::vector< Geom::Pnt > &points) const =0
Topo::Shell::getShellTool
virtual Topo::ShellTool * getShellTool() const =0
Topo::Wire::copyFrom
virtual void copyFrom(pConstWire rhs, bool deepCopy=true)=0
Topo::Vertex::Vertex
Vertex(ENTITY *ent)
Definition: Shape.h:494
Topo::ShapeFactory
Definition: Shape.h:56
Topo::MeshShape::getTextureCoordinates
virtual void getTextureCoordinates(std::vector< Geom::Pnt2d > &textureCoordinates, std::vector< int > &textureIndices) const =0
Topo::LazyFacetedBrepShape
Definition: Shape.h:501
Topo::Coedge::transform
virtual void transform(const Geom::Trsf &)
Variant operator.
Definition: Shape.h:456
Topo::VertexTool
Tools for creating, manipulating and querying Vertices.
Definition: VertexTool.h:20
Topo::Shape::getIndexedMesh
virtual pIndexedMesh getIndexedMesh() const
Topo::Shape::getShapeType
virtual Topo::ShapeType getShapeType() const =0
Topo::ShapeVariantHandler::isEqual
bool isEqual(const Core::Variant &v1, const Core::Variant &v2, double=1E-06) const
Compares, if two Variants, both of the same type, are equal.
Definition: Shape.h:532
Topo::Solid
Definition: Shape.h:284
Topo::Shape::isMesh
virtual bool isMesh() const
Definition: Shape.h:199
Topo::CompoundTool
Tools for creating, manipulating and querying Compounds.
Definition: CompoundTool.h:11
Topo::ShapeVariantHandler::create
Core::Variant create()
Creates a Variant.
pConstSolid
std::shared_ptr< Topo::Solid const > pConstSolid
Definition: Types.h:68
Topo::Wire::~Wire
virtual ~Wire()=default
Topo::EdgeTool
Tools for creating, manipulating and querying Edges.
Definition: EdgeTool.h:38
Topo::ConstShapeVariantHandler::getAsString
Base::String getAsString(const Core::Variant &v) const
Returns a string representation of the value of the Variant.
Topo::MeshShape::SubMeshModels
std::vector< MeshModel > SubMeshModels
Definition: Shape.h:224
Topo::Shape::CheckShapeIsValidAndThrowException
@ CheckShapeIsValidAndThrowException
Definition: Shape.h:145
Topo::Solid::Solid
Solid()=default
Topo::WireTool
Tools for creating, manipulating and querying Wires.
Definition: WireTool.h:23
Topo::LazyFacetedBrepShape::~LazyFacetedBrepShape
virtual ~LazyFacetedBrepShape()=default
Topo::Shape::releaseShapesAttributes
void releaseShapesAttributes()
Deletes the ShapeAttributes associated with this shape.
Topo::ShapeFactory::read
static pShape read(const std::string &format, const std::string &data, int version)
Topo::Shell::transform
virtual void transform(const Geom::Trsf &)
Definition: Shape.h:323
Topo::Coedge::Coedge
Coedge(pConstCoedge rhs, bool deepCopy=true)
Topo::TopologicalItem::ModelingKernel
ModelingKernel
Definition: Shape.h:96
Topo::ShapeType::SOLID
@ SOLID
pConstWire
std::shared_ptr< Topo::Wire const > pConstWire
Definition: Types.h:71
Topo::Shape::addShapeAttributes
void addShapeAttributes(Topo::ShapeAttributes *atts)
Adds ShapeAttributes to this shape. If shape already had some attributes they are released.
Topo::ShapeType::COMPOUND
@ COMPOUND
Topo::TopologicalItem::getGeometricInformation
virtual bool getGeometricInformation(Topo::GeometricInformation &) const
Topo::Shell::copyFrom
virtual void copyFrom(pConstShell rhs, bool deepCopy=true)=0
Topo::Shape::setIndexedDrawable
virtual void setIndexedDrawable(pIndexedDrawable)
Topo::Shape::Shape
Shape(pConstShape rhs)
Topo::Shape::Shape
Shape()=default
Topo::Edge
Definition: Shape.h:408
Topo::Shape::getGeometricInformation
bool getGeometricInformation(Topo::GeometricInformation &) const override
Definition: Shape.h:150
Topo::Edge::Edge
Edge(ENTITY *ent)
Definition: Shape.h:424
Topo::Shell::~Shell
virtual ~Shell()=default
Topo::Shape::setIndexMesh
virtual void setIndexMesh(pIndexedMesh m)
pConstShape
std::shared_ptr< Topo::Shape const > pConstShape
Definition: Variant.h:65
Topo::Shape::isCompound
virtual bool isCompound() const
Topo::MeshShape::MeshShape
MeshShape()=default
Topo::MeshShape::MeshModel
std::vector< int > MeshModel
Definition: Shape.h:223
Topo::MeshTool
Tools for creating, manipulating and querying Meshes.
Definition: MeshTool.h:49
Topo::Shape::isSingleEdge
virtual bool isSingleEdge() const
Geom::Dir
Definition: Dir.h:45
Topo::Wire::Wire
Wire()=default
Topo::GeometricInformation
Definition: GeometricInformation.h:7
Topo::ConstShapeVariantHandler::isEqual
bool isEqual(const Core::Variant &v1, const Core::Variant &v2, double=1E-06) const
Compares, if two Variants, both of the same type, are equal.
Definition: Shape.h:548
Topo::Shape::~Shape
virtual ~Shape()=default
Topo::MeshShape::getNormals
virtual std::vector< Geom::Pnt > getNormals() const =0
Topo::Shape::CheckShape
CheckShape
Definition: Shape.h:144
Core::DocObject
Definition: DocObject.h:54
pShape
std::shared_ptr< Topo::Shape > pShape
Definition: Variant.h:64
pIndexedDrawable
std::shared_ptr< Topo::IndexedDrawable > pIndexedDrawable
Definition: Types.h:58
Topo::FacetedShape::~FacetedShape
virtual ~FacetedShape()=default
Topo::MeshShape::getFacePoints
virtual void getFacePoints(int index, std::vector< Geom::Pnt > &points) const =0
pConstCompound
std::shared_ptr< Topo::Compound const > pConstCompound
Definition: Types.h:67
Topo::MeshShape::getMeshTool
virtual Topo::MeshTool * getMeshTool() const =0
Topo::MeshShape::getModel
virtual void getModel(MeshModel &model) const =0
Topo::MeshShape::~MeshShape
virtual ~MeshShape()=default
Topo::FaceTool
Tools for creating, manipulating and querying Faces.
Definition: FaceTool.h:59
Topo::Shape::isClosedSolid
virtual bool isClosedSolid() const
Topo::Edge::copyFrom
virtual void copyFrom(pConstEdge rhs, bool deepCopy=true)=0
Topo::Coedge::getEdgeTool
virtual Topo::EdgeTool * getEdgeTool() const =0
Topo::Shape::getBoundingBox
virtual Geom::Bnd_Box getBoundingBox() const =0
Get BoundingBox.
pConstFace
std::shared_ptr< Topo::Face const > pConstFace
Definition: Types.h:70
Topo::Shape::clone
virtual Topo::Shape * clone(bool deepcopy) const =0
Topo::Wire::transform
virtual void transform(const Geom::Trsf &)
Definition: Shape.h:388
Topo::Compound
Definition: Shape.h:258
Topo::Face::~Face
virtual ~Face()=default
Topo::TopologicalItem::TopologicalItem
TopologicalItem(ENTITY *)
Definition: Shape.h:115
Topo::TopologicalItem
Definition: Shape.h:81
Topo::Solid::Solid
Solid(pConstSolid rhs, bool deepCopy=true)
Topo::Compound::Compound
Compound(pConstCompound rhs, bool deepCopy=true)
Topo::Vertex::Vertex
Vertex()=default
Core
Definition: Base.h:5
Topo::Edge::Edge
Edge()=default
Topo::Vertex
Definition: Shape.h:479
Topo::Shape::getShapeAttributes
Topo::ShapeAttributes * getShapeAttributes() const
Returns the ShapeAttributes of this shape.
Topo::ConstShapeVariantHandler::getType
int getType()
Returns the Variant type.
Definition: Shape.h:556
Topo::ShapeType::NCOMPOUND
@ NCOMPOUND
Core::Variant
Definition: Variant.h:78
Geom::Pnt
Defines a non-persistent 3D Cartesian point.
Definition: Pnt.h:44
Topo::ShapeType::SHAPE
@ SHAPE
Topo::TopologicalItem::getShapeTool
virtual Topo::ShapeTool * getShapeTool() const =0
Topo::FacetedShape
Definition: Shape.h:513
Topo::Shape::isSolid
virtual bool isSolid() const
Topo::TopologicalItem::getModelingKernel
virtual ModelingKernel getModelingKernel() const =0
Base.h
Topo::Face::getGeometry
virtual Core::DocObject * getGeometry() const
Definition: Shape.h:354
Topo::LazyFacetedBrepShape::LazyFacetedBrepShape
LazyFacetedBrepShape(pConstShape rhs)
Definition: Shape.h:506
Topo::Shape::createIndexedMesh
virtual bool createIndexedMesh(pIndexedMesh m) const
Core::Variant::getValue
T getValue(bool *ok) const
Definition: Variant.h:329
Topo::Shape::setWasCreatedWithProblems
virtual void setWasCreatedWithProblems(bool)
Definition: Shape.h:182
Core::Variant::ConstShape
@ ConstShape
Definition: Variant.h:143
pIndexedMesh
std::shared_ptr< Geom::IndexedMesh > pIndexedMesh
Definition: IndexedMesh.h:59
Topo::Shape::isWire
virtual bool isWire() const
Topo::TopologicalItem::TopologicalItem
TopologicalItem()=default
Topo::TopologicalItem::~TopologicalItem
virtual ~TopologicalItem()=default
Topo::Edge::~Edge
virtual ~Edge()=default
Topo::MeshShape::getEdge
virtual bool getEdge(int idx, std::pair< Geom::Pnt, Geom::Pnt > &line) const =0
pConstBrepData
std::shared_ptr< const Geom::BrepData > pConstBrepData
Definition: BrepData.h:31
Topo::Solid::~Solid
virtual ~Solid()=default
pConstMesh
std::shared_ptr< Topo::MeshShape const > pConstMesh
Definition: Types.h:66
Topo::Vertex::~Vertex
virtual ~Vertex()=default
Topo::FacetedShape::face_vertices
std::vector< Geom::Pnt > face_vertices
Definition: Shape.h:518
Topo::Coedge::Coedge
Coedge(ENTITY *ent)
Definition: Shape.h:460
pConstEdge
std::shared_ptr< Topo::Edge const > pConstEdge
Definition: Types.h:72
Topo::Face::getFaceTool
virtual Topo::FaceTool * getFaceTool() const =0
Topo::TopologicalItem::getOwner
virtual pConstTopologicalItem getOwner() const =0
Returns top-level owner. Returns this if item is top-level.
Topo::Shape::copyFrom
virtual void copyFrom(pConstShape rhs, bool deepCopy=true)=0
Topo
Definition: DbgInfo.h:17
Types.h
Topo::ShapeTool
Tools for creating, manipulating and querying Shapes.
Definition: ShapeTool.h:98
Topo::Shape::getOwner
pConstTopologicalItem getOwner() const override
Returns top-level owner. Returns this if item is top-level.
Topo::Shape::getTransform
virtual Geom::Trsf getTransform() const
Variant.h
Topo::Shape::wasCreatedWithProblems
virtual bool wasCreatedWithProblems() const
Definition: Shape.h:181
Core::Variant::Shape
@ Shape
Definition: Variant.h:142
Topo::FacetedShape::face_per_vertex_normals
std::vector< Geom::Dir > face_per_vertex_normals
Definition: Shape.h:520
Topo::MeshShape::MeshShape
MeshShape(pConstMesh rhs, bool deepCopy=true)
Topo::Solid::getSolidTool
virtual Topo::SolidTool * getSolidTool() const =0
Topo::TopologicalItem::MesherType
MesherType
Definition: Shape.h:89
Topo::Shape::Shape
Shape(ENTITY *ent)
Topo::Coedge::copyFrom
virtual void copyFrom(pConstCoedge rhs, bool deepCopy=true)=0
Topo::MeshShape::getMeshAsBrepData
virtual pConstBrepData getMeshAsBrepData() const =0
Topo::Coedge
Definition: Shape.h:443
Bnd_Box.h
Topo::Compound::Compound
Compound()=default
Topo::Vertex::getPoint
virtual Geom::Pnt getPoint() const =0
Topo::TopologicalItem::getEntity
virtual ENTITY * getEntity() const
Definition: Shape.h:111
Topo::ShapeFactory::read
static pShape read(const std::string &format, const Base::String &fileName)
Topo::ShapeType::SHELL
@ SHELL
Topo::ShellTool
Tools for creating, manipulating and querying Shells.
Definition: ShellTool.h:12
Topo::ShapeVariantHandler::getType
int getType()
Returns the Variant type.
Definition: Shape.h:540
Core::version
LX_CORE_EXPORT Version & version
pConstTopologicalItem
std::shared_ptr< Topo::TopologicalItem const > pConstTopologicalItem
Definition: Types.h:63
Topo::Solid::copyFrom
virtual void copyFrom(pConstSolid rhs, bool deepCopy=true)=0
Core::VariantHandler
Definition: Variant.h:585
Topo::MeshShape::getEdges
virtual void getEdges(std::vector< std::pair< Geom::Pnt, Geom::Pnt > > &lines) const =0
Topo::LazyFacetedBrepShape::LazyFacetedBrepShape
LazyFacetedBrepShape()=default
Topo::Face::getFaceNormal
virtual bool getFaceNormal(const Geom::Pnt &pnt, Geom::Dir &dir, Geom::Pnt &pointOnFace) const =0
Projects pnt on the face. Returns normal for this point and the calculated pointOnFace.
Topo::Wire::getEdgeCount
virtual int getEdgeCount() const =0
Topo::Coedge::~Coedge
virtual ~Coedge()=default
Topo::MeshShape::copyFrom
virtual void copyFrom(pConstMesh rhs, bool deepCopy=true)=0
Topo::Edge::transform
virtual void transform(const Geom::Trsf &)
Variant operator.
Definition: Shape.h:421
Topo::Compound::getCompoundTool
virtual Topo::CompoundTool * getCompoundTool() const =0
Topo::Shell::Shell
Shell()=default
Topo::FacetedShape::FacetedShape
FacetedShape()=default
Topo::ShapeType::COMPSOLID
@ COMPSOLID
Topo::SolidTool
Tools for creating, manipulating and querying Solids.
Definition: SolidTool.h:15
Topo::Shape::transform
virtual void transform(const Geom::Trsf &t)
Topo::Wire::Wire
Wire(ENTITY *ent)
Definition: Shape.h:392
Topo::Shape::CheckShapeIsValid
@ CheckShapeIsValid
Definition: Shape.h:146
Geom::Trsf
Definition: Trsf.h:58
Topo::Shape::_copy
bool _copy(const Topo::Shape *rhs, bool deepCopy=true)
Base::String
A Utf-16 (windows) or ucs4 (unix) encoded string class.
Definition: String.h:18
Topo::ConstShapeVariantHandler::create
Core::Variant create()
Creates a Variant.
Topo::Vertex::copyFrom
virtual void copyFrom(pConstVertex rhs, bool deepCopy=true)=0
Topo::ShapeType::FACE
@ FACE
Topo::Shell::Shell
Shell(pConstShell rhs, bool deepCopy=true)
Topo::Face::Face
Face(pConstFace rhs, bool deepCopy=false)
Topo::ShapeAttributes
Definition: ShapeAttributes.h:10
Topo::Face::transform
virtual void transform(const Geom::Trsf &)
Definition: Shape.h:355
Topo::Wire
Definition: Shape.h:374
Topo::Shell::Shell
Shell(ENTITY *ent)
Definition: Shape.h:326
Topo::MeshShape::copyFrom
void copyFrom(pConstShape rhs, bool deepCopy=true) override
Topo::FacetedShape::face_coordinateIndices
std::vector< long > face_coordinateIndices
Definition: Shape.h:519
Topo::Coedge::getEdge
virtual pConstEdge getEdge() const =0
TYPESYSTEM_HEADER
#define TYPESYSTEM_HEADER()
define for subclassing Base::BaseClass
Definition: Base.h:12
Topo::ShapeVariantHandler::getAsString
Base::String getAsString(const Core::Variant &v) const
Returns a string representation of the value of the Variant.
Topo::ShapeType::WIRE
@ WIRE
Topo::MeshShape::getOuterBoundaries
virtual void getOuterBoundaries(std::vector< Geom::Pnt > &points, std::vector< int > &edges) const =0
Topo::Wire::isLoop
virtual bool isLoop() const
Definition: Shape.h:389
Topo::FacetedShape::wire_coordinateIndices
std::vector< long > wire_coordinateIndices
Definition: Shape.h:523
Topo::Coedge::Coedge
Coedge()=default
Topo::ShapeType::EDGE
@ EDGE
Topo::Shape::hasShapeAttributes
bool hasShapeAttributes() const
Checks if this shape has ShapeAttributes.
Topo::TopologicalItem::getMesherType
virtual MesherType getMesherType() const =0
Topo::ShapeFactory::read
static pShape read(const std::string &format, std::istream &reader)
Topo::Compound::~Compound
virtual ~Compound()=default
pConstCoedge
std::shared_ptr< Topo::Coedge const > pConstCoedge
Definition: Types.h:73
Topo::ShapeType::MESH
@ MESH
Topo::ShapeFactory::registry
static std::map< std::string, ShapeFactory * > registry
Definition: Shape.h:59
Topo::Shell
Definition: Shape.h:312
Topo::Shape::isSingleWire
virtual bool isSingleWire() const
Topo::Compound::copyFrom
virtual void copyFrom(pConstCompound rhs, bool deepCopy=true)=0
Topo::FacetedShape::wire_vertices
std::vector< Geom::Pnt > wire_vertices
Definition: Shape.h:522