Salome HOME
Issue #1860: fix end lines with spaces
[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   /// Shape orientation
29   enum Orientation {
30     FORWARD,
31     REVERSED,
32     INTERNAL,
33     EXTERNAL
34   };
35
36  public:
37   /// Creation of empty (null) shape
38   GEOMAPI_EXPORT
39   GeomAPI_Shape();
40
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;
44
45   /// Returns true if the underlied shape is null
46   GEOMAPI_EXPORT
47   bool isNull() const;
48
49   /// Returns whether the shapes are equal
50   GEOMAPI_EXPORT
51   virtual bool isEqual(const std::shared_ptr<GeomAPI_Shape> theShape) const;
52
53   /// Returns whether the shape is a vertex
54   GEOMAPI_EXPORT
55   virtual bool isVertex() const;
56
57   /// Returns whether the shape is an edge
58   GEOMAPI_EXPORT
59   virtual bool isEdge() const;
60
61   /// Returns whether the shape is a face
62   GEOMAPI_EXPORT
63   virtual bool isFace() const;
64
65   /// Returns whether the shape is a compound
66   GEOMAPI_EXPORT
67   virtual bool isCompound() const;
68
69   /// Returns whether the shape is a compound of solids
70   GEOMAPI_EXPORT
71   virtual bool isCompoundOfSolids() const;
72
73   /// Returns whether the shape is a compound where all elements are topologically connected
74   GEOMAPI_EXPORT
75   virtual bool isConnectedTopology() const;
76
77   /// Returns whether the shape is a solid
78   GEOMAPI_EXPORT
79   virtual bool isSolid() const;
80
81   /// Returns whether the shape is a compsolid
82   GEOMAPI_EXPORT
83   virtual bool isCompSolid() const;
84
85   /// Returns whether the shape is planar
86   GEOMAPI_EXPORT
87   virtual bool isPlanar() const;
88
89   /// Returns the shape type
90   GEOMAPI_EXPORT
91   virtual ShapeType shapeType() const;
92
93   /// \return the shape type as string.
94   GEOMAPI_EXPORT
95   virtual std::string shapeTypeStr() const;
96
97   /// \return the shape orientation.
98   GEOMAPI_EXPORT virtual Orientation orientation() const;
99
100   /// Sets the shape orientation.
101   GEOMAPI_EXPORT virtual void setOrientation(const Orientation theOrientation);
102
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;
106
107   /// Computes boundary dimensions of the shape
108   /// Returns False if it is not possible
109   GEOMAPI_EXPORT
110   bool computeSize(double& theXmin, double& theYmin, double& theZmin,
111                    double& theXmax, double& theYmax, double& theZmax) const;
112
113   /// Returns the shape as BRep stream
114   GEOMAPI_EXPORT
115   std::string getShapeStream() const;
116 };
117
118 //! Pointer on list of shapes
119 typedef std::list<std::shared_ptr<GeomAPI_Shape> > ListOfShape;
120
121 //! Pointer on attribute object
122 typedef std::shared_ptr<GeomAPI_Shape> GeomShapePtr;
123
124 #endif