]> SALOME platform Git repositories - modules/shaper.git/blob - src/GeomAPI/GeomAPI_Wire.h
Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / GeomAPI / GeomAPI_Wire.h
1 // File:        GeomAPI_Wire.hxx
2 // Created:     24 Jul 2014
3 // Author:      Artem ZHIDKOV
4
5 #ifndef GEOMAPI_WIRE_H_
6 #define GEOMAPI_WIRE_H_
7
8 #include "GeomAPI.h"
9 #include "GeomAPI_Edge.h"
10 #include "GeomAPI_Pnt.h"
11 #include "GeomAPI_Dir.h"
12
13 #include <boost/smart_ptr/shared_ptr.hpp>
14
15 #include <list>
16
17 /**\class GeomAPI_Wire
18  * \ingroup DataModel
19  * \brief Interface to the edge object
20  */
21
22 class GEOMAPI_EXPORT GeomAPI_Wire : public GeomAPI_Shape
23 {
24  public:
25   /// Creation of empty (null) shape
26   GeomAPI_Wire();
27
28   virtual bool isVertex() const
29   {
30     return false;
31   }
32
33   /// Returns whether the shape is an edge
34   virtual bool isEdge() const
35   {
36     return false;
37   }
38
39   void addEdge(boost::shared_ptr<GeomAPI_Shape> theEdge);
40   std::list<boost::shared_ptr<GeomAPI_Shape> > getEdges();
41
42   /// Returns True if the wire is defined in a plane
43   bool hasPlane() const { return myOrigin && myNorm && myDirX && myDirY; }
44
45   /// Set/Get origin point
46   void setOrigin(const boost::shared_ptr<GeomAPI_Pnt>& theOrigin) { myOrigin = theOrigin; }
47   boost::shared_ptr<GeomAPI_Pnt> origin() const { return myOrigin; }
48
49   /// Set/Get X direction vector
50   void setDirX(const boost::shared_ptr<GeomAPI_Dir>& theDirX) { myDirX = theDirX; }
51   boost::shared_ptr<GeomAPI_Dir> dirX() const { return myDirX; }
52
53   /// Set/Get Y direction vector
54   void setDirY(const boost::shared_ptr<GeomAPI_Dir>& theDirY) { myDirY = theDirY; }
55   boost::shared_ptr<GeomAPI_Dir> dirY() const { return myDirY; }
56
57   /// Set/Get Normal direction vector
58   void setNorm(const boost::shared_ptr<GeomAPI_Dir>& theNorm) { myNorm = theNorm; }
59   boost::shared_ptr<GeomAPI_Dir> norm() const { return myNorm; }
60
61 private:
62   boost::shared_ptr<GeomAPI_Pnt> myOrigin;
63   boost::shared_ptr<GeomAPI_Dir> myDirX;
64   boost::shared_ptr<GeomAPI_Dir> myDirY;
65   boost::shared_ptr<GeomAPI_Dir> myNorm;
66 };
67
68 #endif
69