Salome HOME
098245119c13aa28dc5775ad90170410d5ab714b
[modules/shaper.git] / src / GeomAPI / GeomAPI_Shape.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomAPI_Shape.hxx
4 // Created:     23 Apr 2014
5 // Author:      Mikhail PONIKAROV
6
7 #ifndef GeomAPI_Shape_H_
8 #define GeomAPI_Shape_H_
9
10 #include <GeomAPI_Interface.h>
11 #include <memory>
12 #include <list>
13
14 /**\class GeomAPI_Shape
15  * \ingroup DataModel
16  * \brief Interface to the topological shape object
17  */
18 class GeomAPI_Shape : public GeomAPI_Interface
19 {
20 public:
21   /// Shape type enum
22   enum ShapeType {
23     COMPOUND, COMPSOLID, SOLID, SHELL,
24     FACE, WIRE, EDGE, VERTEX,
25     SHAPE
26   };
27
28  public:
29   /// Creation of empty (null) shape
30   GEOMAPI_EXPORT 
31   GeomAPI_Shape();
32
33   /// Returns true if the underlied shape is null
34   GEOMAPI_EXPORT 
35   bool isNull() const;
36
37   /// Returns whether the shapes are equal
38   GEOMAPI_EXPORT 
39   virtual bool isEqual(const std::shared_ptr<GeomAPI_Shape> theShape) const;
40
41   /// Returns whether the shape is a vertex
42   GEOMAPI_EXPORT 
43   virtual bool isVertex() const;
44
45   /// Returns whether the shape is an edge
46   GEOMAPI_EXPORT 
47   virtual bool isEdge() const;
48
49   /// Returns whether the shape is a face
50   GEOMAPI_EXPORT 
51   virtual bool isFace() const;
52
53   /// Returns whether the shape is a compound
54   GEOMAPI_EXPORT 
55   virtual bool isCompound() const;
56
57   /// Returns whether the shape is a compound of solids
58   GEOMAPI_EXPORT 
59   virtual bool isCompoundOfSolids() const;
60
61   /// Returns whether the shape is a compound where all elements are topologically connected
62   GEOMAPI_EXPORT 
63   virtual bool isConnectedTopology() const;
64
65   /// Returns whether the shape is a solid
66   GEOMAPI_EXPORT 
67   virtual bool isSolid() const;
68
69   /// Returns whether the shape is a compsolid
70   GEOMAPI_EXPORT
71   virtual bool isCompSolid() const;
72
73   /// Returns whether the shape is planar
74   GEOMAPI_EXPORT
75   virtual bool isPlanar() const;
76
77   /// Returns the shape type
78   GEOMAPI_EXPORT
79   virtual ShapeType shapeType() const;
80
81   /// \return the shape type as string.
82   GEOMAPI_EXPORT
83   virtual std::string shapeTypeStr() const;
84
85   /// \return true if passed shape is a sub-shape of this shape.
86   /// \param theShape shape to search.
87   GEOMAPI_EXPORT virtual bool isSubShape(const std::shared_ptr<GeomAPI_Shape> theShape) const;
88
89
90   /// Computes boundary dimensions of the shape
91   /// Returns False if it is not possible
92   GEOMAPI_EXPORT 
93   bool computeSize(double& theXmin, double& theYmin, double& theZmin,
94                    double& theXmax, double& theYmax, double& theZmax) const;
95
96   /// Returns the shape as BRep stream
97   GEOMAPI_EXPORT 
98   std::string getShapeStream() const;
99 };
100
101 //! Pointer on list of shapes
102 typedef std::list<std::shared_ptr<GeomAPI_Shape> > ListOfShape;
103
104 //! Pointer on attribute object
105 typedef std::shared_ptr<GeomAPI_Shape> GeomShapePtr;
106
107 #endif