1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomAPI_Shape.hxx
4 // Created: 23 Apr 2014
5 // Author: Mikhail PONIKAROV
7 #ifndef GeomAPI_Shape_H_
8 #define GeomAPI_Shape_H_
10 #include <GeomAPI_Interface.h>
14 /**\class GeomAPI_Shape
16 * \brief Interface to the topological shape object
18 class GeomAPI_Shape : public GeomAPI_Interface
23 COMPOUND, COMPSOLID, SOLID, SHELL,
24 FACE, WIRE, EDGE, VERTEX,
37 /// Creation of empty (null) shape
41 /// \return a new Shape with the same Orientation and Location and a new TShape with the same
42 /// geometry and no sub-shapes.
43 GEOMAPI_EXPORT std::shared_ptr<GeomAPI_Shape> emptyCopied() const;
45 /// Returns true if the underlied shape is null
49 /// Returns whether the shapes are equal
51 virtual bool isEqual(const std::shared_ptr<GeomAPI_Shape> theShape) const;
53 /// Returns whether the shapes are same
55 virtual bool isSame(const std::shared_ptr<GeomAPI_Shape> theShape) const;
57 /// Returns whether the shape is a vertex
59 virtual bool isVertex() const;
61 /// Returns whether the shape is an edge
63 virtual bool isEdge() const;
65 /// Returns whether the shape is a face
67 virtual bool isFace() const;
69 /// Returns whether the shape is a compound
71 virtual bool isCompound() const;
73 /// Returns whether the shape is a compound of solids
75 virtual bool isCompoundOfSolids() const;
77 /// Returns whether the shape is a compound where all elements are topologically connected
79 virtual bool isConnectedTopology() const;
81 /// Returns whether the shape is a solid
83 virtual bool isSolid() const;
85 /// Returns whether the shape is a compsolid
87 virtual bool isCompSolid() const;
89 /// Returns whether the shape is planar
91 virtual bool isPlanar() const;
93 /// Returns the shape type
95 virtual ShapeType shapeType() const;
97 /// Returns the type enumeration by the string-type
98 GEOMAPI_EXPORT static ShapeType shapeTypeByStr(std::string theType);
100 /// \return the shape type as string.
102 virtual std::string shapeTypeStr() const;
104 /// \return the shape orientation.
105 GEOMAPI_EXPORT virtual Orientation orientation() const;
107 /// Sets the shape orientation.
108 GEOMAPI_EXPORT virtual void setOrientation(const Orientation theOrientation);
110 /// \return true if passed shape is a sub-shape of this shape.
111 /// \param theShape shape to search.
112 GEOMAPI_EXPORT virtual bool isSubShape(const std::shared_ptr<GeomAPI_Shape> theShape) const;
114 /// Computes boundary dimensions of the shape
115 /// Returns False if it is not possible
117 bool computeSize(double& theXmin, double& theYmin, double& theZmin,
118 double& theXmax, double& theYmax, double& theZmax) const;
120 /// Returns the shape as BRep stream
122 std::string getShapeStream() const;
124 /// Returns intersection of shapes
126 std::shared_ptr<GeomAPI_Shape> intersect(const std::shared_ptr<GeomAPI_Shape> theShape) const;
129 //! Pointer on list of shapes
130 typedef std::list<std::shared_ptr<GeomAPI_Shape> > ListOfShape;
132 //! Pointer on attribute object
133 typedef std::shared_ptr<GeomAPI_Shape> GeomShapePtr;