Salome HOME
Linux porting
[modules/shaper.git] / src / GeomAPI / GeomAPI_PlanarEdges.h
1 // Copyright (C) 2014-2017  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 //
20
21 #ifndef GEOMAPI_WIRE_H_
22 #define GEOMAPI_WIRE_H_
23
24 #include "GeomAPI.h"
25 #include "GeomAPI_Edge.h"
26 #include "GeomAPI_Pnt.h"
27 #include "GeomAPI_Dir.h"
28 #include "GeomAPI_Ax3.h"
29
30 #include <memory>
31
32 #include <list>
33
34 /**\class GeomAPI_PlanarEdges
35  * \ingroup DataModel
36  * \brief Interface to the set of edges located in one plane
37  *
38  * Normally this interface corresponds to theedges of the sketch
39  */
40 class GeomAPI_PlanarEdges : public GeomAPI_Shape
41 {
42  public:
43   /// Creation of empty (null) shape
44   GEOMAPI_EXPORT GeomAPI_PlanarEdges();
45
46   /// Returns whether the shape is alone vertex
47   GEOMAPI_EXPORT virtual bool isVertex() const;
48
49   /// Returns whether the shape is alone edge
50   GEOMAPI_EXPORT virtual bool isEdge() const;
51   /// Appends the edge to the set
52   GEOMAPI_EXPORT void addEdge(std::shared_ptr<GeomAPI_Shape> theEdge);
53   /// Returns the list of edges in this interface
54   GEOMAPI_EXPORT std::list<std::shared_ptr<GeomAPI_Shape> > getEdges();
55
56   /// Returns True if the wire is defined in a plane
57   GEOMAPI_EXPORT bool hasPlane() const;
58
59   /// Returns the plane origin point
60   GEOMAPI_EXPORT std::shared_ptr<GeomAPI_Pnt> origin() const;
61
62   /// Returns X direction vector
63   GEOMAPI_EXPORT std::shared_ptr<GeomAPI_Dir> dirX() const;
64
65   /// Returns Y direction vector
66   GEOMAPI_EXPORT std::shared_ptr<GeomAPI_Dir> dirY() const;
67
68   /// Returns Z direction vector
69   GEOMAPI_EXPORT std::shared_ptr<GeomAPI_Dir> norm() const;
70
71   /// Returns whether the shape is planar
72   GEOMAPI_EXPORT virtual bool isPlanar() const;
73
74   /// Set working plane
75   /// \param theOrigin origin of the plane axis
76   /// \param theDirX X direction of the plane axis
77   /// \param theNorm normal direction of the plane axis
78   GEOMAPI_EXPORT void setPlane(const std::shared_ptr<GeomAPI_Pnt>& theOrigin,
79                                const std::shared_ptr<GeomAPI_Dir>& theDirX,
80                                const std::shared_ptr<GeomAPI_Dir>& theNorm);
81
82   /// Returns whether the shapes are equal
83   GEOMAPI_EXPORT
84   virtual bool isEqual(const std::shared_ptr<GeomAPI_Shape> theShape) const;
85
86 private:
87
88   std::shared_ptr<GeomAPI_Ax3> myPlane;
89 };
90
91 #endif
92