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 shape is a vertex
55 virtual bool isVertex() const;
57 /// Returns whether the shape is an edge
59 virtual bool isEdge() const;
61 /// Returns whether the shape is a face
63 virtual bool isFace() const;
65 /// Returns whether the shape is a compound
67 virtual bool isCompound() const;
69 /// Returns whether the shape is a compound of solids
71 virtual bool isCompoundOfSolids() const;
73 /// Returns whether the shape is a compound where all elements are topologically connected
75 virtual bool isConnectedTopology() const;
77 /// Returns whether the shape is a solid
79 virtual bool isSolid() const;
81 /// Returns whether the shape is a compsolid
83 virtual bool isCompSolid() const;
85 /// Returns whether the shape is planar
87 virtual bool isPlanar() const;
89 /// Returns the shape type
91 virtual ShapeType shapeType() const;
93 /// \return the shape type as string.
95 virtual std::string shapeTypeStr() const;
97 /// \return the shape orientation.
98 GEOMAPI_EXPORT virtual Orientation orientation() const;
100 /// Sets the shape orientation.
101 GEOMAPI_EXPORT virtual void setOrientation(const Orientation theOrientation);
103 /// \return true if passed shape is a sub-shape of this shape.
104 /// \param theShape shape to search.
105 GEOMAPI_EXPORT virtual bool isSubShape(const std::shared_ptr<GeomAPI_Shape> theShape) const;
107 /// Computes boundary dimensions of the shape
108 /// Returns False if it is not possible
110 bool computeSize(double& theXmin, double& theYmin, double& theZmin,
111 double& theXmax, double& theYmax, double& theZmax) const;
113 /// Returns the shape as BRep stream
115 std::string getShapeStream() const;
118 //! Pointer on list of shapes
119 typedef std::list<std::shared_ptr<GeomAPI_Shape> > ListOfShape;
121 //! Pointer on attribute object
122 typedef std::shared_ptr<GeomAPI_Shape> GeomShapePtr;