]> SALOME platform Git repositories - modules/shaper.git/blob - src/GeomAPI/GeomAPI_Edge.h
Salome HOME
Add copyright header according to request of CEA from 06.06.2017
[modules/shaper.git] / src / GeomAPI / GeomAPI_Edge.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 email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
18 //
19
20 #ifndef GeomAPI_Edge_H_
21 #define GeomAPI_Edge_H_
22
23 #include <GeomAPI_Shape.h>
24
25 class GeomAPI_Pln;
26 class GeomAPI_Pnt;
27 class GeomAPI_Circ;
28 class GeomAPI_Lin;
29
30 /**\class GeomAPI_Edge
31 * \ingroup DataModel
32  * \brief Interface to the edge object
33  */
34
35 class GeomAPI_Edge : public GeomAPI_Shape
36 {
37 public:
38    /// Makes an undefined Edge (no geometry).
39   GEOMAPI_EXPORT
40    GeomAPI_Edge();
41
42    /// Creation of edge by the edge-shape
43   GEOMAPI_EXPORT
44    GeomAPI_Edge(const std::shared_ptr<GeomAPI_Shape>& theShape);
45
46   /// Verifies that the edge is a line
47   GEOMAPI_EXPORT
48   bool isLine() const;
49
50   /// Verifies that the edge is a circle
51   GEOMAPI_EXPORT
52   bool isCircle() const;
53
54   /// Verifies that the edge is an arc of circle
55   GEOMAPI_EXPORT
56   bool isArc() const;
57
58   /// Returns the first vertex coordinates of the edge
59   GEOMAPI_EXPORT
60   std::shared_ptr<GeomAPI_Pnt> firstPoint();
61
62   /// Returns the Last vertex coordinates of the edge
63   GEOMAPI_EXPORT
64   std::shared_ptr<GeomAPI_Pnt> lastPoint();
65
66   /// Returns a circle if edge is based on the circle curve
67   GEOMAPI_EXPORT
68   std::shared_ptr<GeomAPI_Circ> circle();
69
70   /// Returns a line if edge is based on the linear curve
71   GEOMAPI_EXPORT
72   std::shared_ptr<GeomAPI_Lin> line();
73
74   /// Returns true if the current edge is geometrically equal to the given edge
75   GEOMAPI_EXPORT
76   bool isEqual(const std::shared_ptr<GeomAPI_Shape> theEdge) const;
77
78   /// Returns range of parameter on the curve
79   GEOMAPI_EXPORT
80   void getRange(double& theFirst, double& theLast) const;
81
82   /// Returns true, if the edge is fully placed in the specified plane
83   GEOMAPI_EXPORT
84   bool isInPlane(const std::shared_ptr<GeomAPI_Pln> thePlane) const;
85
86   /// Returns edge length.
87   GEOMAPI_EXPORT
88   double length() const;
89 };
90
91 #endif
92