Go to the documentation of this file.
35 class ShapeVariantHandler;
59 static std::map<std::string, ShapeFactory*>
registry;
61 static pShape read(
const std::string& format, std::istream& reader);
65 virtual pShape read(
const std::string& data,
int version) = 0;
66 virtual pShape read(std::istream& reader) = 0;
130 public std::enable_shared_from_this<Topo::Shape>
184 mutable std::set<Core::DocObject*> m_appGeometryBackLinks{};
199 virtual bool isMesh()
const {
return false; }
234 virtual void getTextureCoordinates(std::vector<Geom::Pnt2d>& textureCoordinates, std::vector<int>& textureIndices)
const = 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;
242 virtual void getFacePoints(
int index, std::vector<Geom::Pnt>& points)
const = 0;
310 public std::enable_shared_from_this<Topo::Shell>
340 public std::enable_shared_from_this<Topo::Face>
372 public std::enable_shared_from_this<Topo::Wire>
383 friend class Acis::AcisWireTool;
389 virtual bool isLoop()
const {
return false; }
406 public std::enable_shared_from_this<Topo::Edge>
428 double _passagePntParam;
429 bool _hasPassagePntParam =
false;
441 public std::enable_shared_from_this<Topo::Coedge>
464 double _passagePntParam;
465 bool _hasPassagePntParam =
false;
477 public std::enable_shared_from_this<Topo::Vertex>
562 #define REGISTER_SHAPE_FACTORY(_factoryName_, _shapeFormat_) Topo::ShapeFactory::registry[_shapeFormat_] = (Topo::ShapeFactory*)new _factoryName_();
std::shared_ptr< Topo::Shell const > pConstShell
Definition: Types.h:69
ShapeType
Definition: Shape.h:38
std::shared_ptr< Topo::Vertex const > pConstVertex
Definition: Types.h:74
virtual Topo::WireTool * getWireTool() const =0
Vertex(pConstVertex rhs, bool deepCopy=true)
Face(ENTITY *ent)
Definition: Shape.h:358
virtual bool calculateDetail(CA_Detail &detail, const CA_Snap &theSnap)=0
Compound(ENTITY *ent)
Definition: Shape.h:271
BaseClass class and root of the type system.
Definition: Base.h:78
virtual bool isSingleFace() const
virtual Topo::VertexTool * getVertexTool() const =0
virtual pIndexedDrawable getIndexedDrawable() const
Edge(pConstEdge rhs, bool deepCopy=true)
virtual pConstEdge getEdgeByIndex(int idx) const =0
virtual bool isSingleVertex() const
Solid(ENTITY *ent)
Definition: Shape.h:297
virtual std::shared_ptr< Core::DbgInfo > getDbgInfo() const
virtual Topo::EdgeTool * getEdgeTool() const =0
virtual void transform(const Geom::Trsf &)
Definition: Shape.h:491
virtual void getPoints(std::vector< Geom::Pnt > &points) const =0
virtual Topo::ShellTool * getShellTool() const =0
virtual void copyFrom(pConstWire rhs, bool deepCopy=true)=0
Vertex(ENTITY *ent)
Definition: Shape.h:494
virtual void getTextureCoordinates(std::vector< Geom::Pnt2d > &textureCoordinates, std::vector< int > &textureIndices) const =0
virtual void transform(const Geom::Trsf &)
Variant operator.
Definition: Shape.h:456
virtual pIndexedMesh getIndexedMesh() const
virtual Topo::ShapeType getShapeType() const =0
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
virtual bool isMesh() const
Definition: Shape.h:199
Core::Variant create()
Creates a Variant.
std::shared_ptr< Topo::Solid const > pConstSolid
Definition: Types.h:68
Base::String getAsString(const Core::Variant &v) const
Returns a string representation of the value of the Variant.
std::vector< MeshModel > SubMeshModels
Definition: Shape.h:224
@ CheckShapeIsValidAndThrowException
Definition: Shape.h:145
virtual ~LazyFacetedBrepShape()=default
void releaseShapesAttributes()
Deletes the ShapeAttributes associated with this shape.
static pShape read(const std::string &format, const std::string &data, int version)
virtual void transform(const Geom::Trsf &)
Definition: Shape.h:323
Coedge(pConstCoedge rhs, bool deepCopy=true)
ModelingKernel
Definition: Shape.h:96
std::shared_ptr< Topo::Wire const > pConstWire
Definition: Types.h:71
void addShapeAttributes(Topo::ShapeAttributes *atts)
Adds ShapeAttributes to this shape. If shape already had some attributes they are released.
virtual bool getGeometricInformation(Topo::GeometricInformation &) const
virtual void copyFrom(pConstShell rhs, bool deepCopy=true)=0
virtual void setIndexedDrawable(pIndexedDrawable)
bool getGeometricInformation(Topo::GeometricInformation &) const override
Definition: Shape.h:150
Edge(ENTITY *ent)
Definition: Shape.h:424
virtual void setIndexMesh(pIndexedMesh m)
std::shared_ptr< Topo::Shape const > pConstShape
Definition: Variant.h:65
virtual bool isCompound() const
std::vector< int > MeshModel
Definition: Shape.h:223
virtual bool isSingleEdge() const
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
virtual std::vector< Geom::Pnt > getNormals() const =0
CheckShape
Definition: Shape.h:144
Definition: DocObject.h:54
std::shared_ptr< Topo::Shape > pShape
Definition: Variant.h:64
std::shared_ptr< Topo::IndexedDrawable > pIndexedDrawable
Definition: Types.h:58
virtual ~FacetedShape()=default
virtual void getFacePoints(int index, std::vector< Geom::Pnt > &points) const =0
std::shared_ptr< Topo::Compound const > pConstCompound
Definition: Types.h:67
virtual Topo::MeshTool * getMeshTool() const =0
virtual void getModel(MeshModel &model) const =0
virtual ~MeshShape()=default
virtual bool isClosedSolid() const
virtual void copyFrom(pConstEdge rhs, bool deepCopy=true)=0
virtual Topo::EdgeTool * getEdgeTool() const =0
virtual Geom::Bnd_Box getBoundingBox() const =0
Get BoundingBox.
std::shared_ptr< Topo::Face const > pConstFace
Definition: Types.h:70
virtual Topo::Shape * clone(bool deepcopy) const =0
virtual void transform(const Geom::Trsf &)
Definition: Shape.h:388
TopologicalItem(ENTITY *)
Definition: Shape.h:115
Solid(pConstSolid rhs, bool deepCopy=true)
Compound(pConstCompound rhs, bool deepCopy=true)
Topo::ShapeAttributes * getShapeAttributes() const
Returns the ShapeAttributes of this shape.
int getType()
Returns the Variant type.
Definition: Shape.h:556
Defines a non-persistent 3D Cartesian point.
Definition: Pnt.h:44
virtual Topo::ShapeTool * getShapeTool() const =0
virtual bool isSolid() const
virtual ModelingKernel getModelingKernel() const =0
virtual Core::DocObject * getGeometry() const
Definition: Shape.h:354
LazyFacetedBrepShape(pConstShape rhs)
Definition: Shape.h:506
virtual bool createIndexedMesh(pIndexedMesh m) const
T getValue(bool *ok) const
Definition: Variant.h:329
virtual void setWasCreatedWithProblems(bool)
Definition: Shape.h:182
@ ConstShape
Definition: Variant.h:143
std::shared_ptr< Geom::IndexedMesh > pIndexedMesh
Definition: IndexedMesh.h:59
virtual bool isWire() const
TopologicalItem()=default
virtual ~TopologicalItem()=default
virtual bool getEdge(int idx, std::pair< Geom::Pnt, Geom::Pnt > &line) const =0
std::shared_ptr< const Geom::BrepData > pConstBrepData
Definition: BrepData.h:31
std::shared_ptr< Topo::MeshShape const > pConstMesh
Definition: Types.h:66
virtual ~Vertex()=default
std::vector< Geom::Pnt > face_vertices
Definition: Shape.h:518
Coedge(ENTITY *ent)
Definition: Shape.h:460
std::shared_ptr< Topo::Edge const > pConstEdge
Definition: Types.h:72
virtual Topo::FaceTool * getFaceTool() const =0
virtual pConstTopologicalItem getOwner() const =0
Returns top-level owner. Returns this if item is top-level.
virtual void copyFrom(pConstShape rhs, bool deepCopy=true)=0
pConstTopologicalItem getOwner() const override
Returns top-level owner. Returns this if item is top-level.
virtual Geom::Trsf getTransform() const
virtual bool wasCreatedWithProblems() const
Definition: Shape.h:181
@ Shape
Definition: Variant.h:142
std::vector< Geom::Dir > face_per_vertex_normals
Definition: Shape.h:520
MeshShape(pConstMesh rhs, bool deepCopy=true)
virtual Topo::SolidTool * getSolidTool() const =0
MesherType
Definition: Shape.h:89
virtual void copyFrom(pConstCoedge rhs, bool deepCopy=true)=0
virtual pConstBrepData getMeshAsBrepData() const =0
virtual Geom::Pnt getPoint() const =0
virtual ENTITY * getEntity() const
Definition: Shape.h:111
static pShape read(const std::string &format, const Base::String &fileName)
int getType()
Returns the Variant type.
Definition: Shape.h:540
LX_CORE_EXPORT Version & version
std::shared_ptr< Topo::TopologicalItem const > pConstTopologicalItem
Definition: Types.h:63
virtual void copyFrom(pConstSolid rhs, bool deepCopy=true)=0
Definition: Variant.h:585
virtual void getEdges(std::vector< std::pair< Geom::Pnt, Geom::Pnt > > &lines) const =0
LazyFacetedBrepShape()=default
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.
virtual int getEdgeCount() const =0
virtual ~Coedge()=default
virtual void copyFrom(pConstMesh rhs, bool deepCopy=true)=0
virtual void transform(const Geom::Trsf &)
Variant operator.
Definition: Shape.h:421
virtual Topo::CompoundTool * getCompoundTool() const =0
virtual void transform(const Geom::Trsf &t)
Wire(ENTITY *ent)
Definition: Shape.h:392
@ CheckShapeIsValid
Definition: Shape.h:146
bool _copy(const Topo::Shape *rhs, bool deepCopy=true)
A Utf-16 (windows) or ucs4 (unix) encoded string class.
Definition: String.h:18
Core::Variant create()
Creates a Variant.
virtual void copyFrom(pConstVertex rhs, bool deepCopy=true)=0
Shell(pConstShell rhs, bool deepCopy=true)
Face(pConstFace rhs, bool deepCopy=false)
Definition: ShapeAttributes.h:10
virtual void transform(const Geom::Trsf &)
Definition: Shape.h:355
Shell(ENTITY *ent)
Definition: Shape.h:326
void copyFrom(pConstShape rhs, bool deepCopy=true) override
std::vector< long > face_coordinateIndices
Definition: Shape.h:519
virtual pConstEdge getEdge() const =0
#define TYPESYSTEM_HEADER()
define for subclassing Base::BaseClass
Definition: Base.h:12
Base::String getAsString(const Core::Variant &v) const
Returns a string representation of the value of the Variant.
virtual void getOuterBoundaries(std::vector< Geom::Pnt > &points, std::vector< int > &edges) const =0
virtual bool isLoop() const
Definition: Shape.h:389
std::vector< long > wire_coordinateIndices
Definition: Shape.h:523
bool hasShapeAttributes() const
Checks if this shape has ShapeAttributes.
virtual MesherType getMesherType() const =0
static pShape read(const std::string &format, std::istream &reader)
virtual ~Compound()=default
std::shared_ptr< Topo::Coedge const > pConstCoedge
Definition: Types.h:73
static std::map< std::string, ShapeFactory * > registry
Definition: Shape.h:59
virtual bool isSingleWire() const
virtual void copyFrom(pConstCompound rhs, bool deepCopy=true)=0
std::vector< Geom::Pnt > wire_vertices
Definition: Shape.h:522