]> SALOME platform Git repositories - modules/shaper.git/blob - src/GeomAPI/GeomAPI_Edge.h
Salome HOME
Add ellipse data type
[modules/shaper.git] / src / GeomAPI / GeomAPI_Edge.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomAPI_Edge.hxx
4 // Created:     24 Jul 2014
5 // Author:      Artem ZHIDKOV
6
7 #ifndef GeomAPI_Edge_H_
8 #define GeomAPI_Edge_H_
9
10 #include <GeomAPI_Shape.h>
11
12 class GeomAPI_Pln;
13 class GeomAPI_Pnt;
14 class GeomAPI_Circ;
15 class GeomAPI_Lin;
16 class GeomAPI_Ellipse;
17
18 /**\class GeomAPI_Edge
19 * \ingroup DataModel
20  * \brief Interface to the edge object
21  */
22
23 class GeomAPI_Edge : public GeomAPI_Shape
24 {
25 public:
26    /// Makes an undefined Edge (no geometry).
27   GEOMAPI_EXPORT
28    GeomAPI_Edge();
29
30    /// Creation of edge by the edge-shape
31   GEOMAPI_EXPORT
32    GeomAPI_Edge(const std::shared_ptr<GeomAPI_Shape>& theShape);
33
34   /// Verifies that the edge is a line
35   GEOMAPI_EXPORT
36   bool isLine() const;
37
38   /// Verifies that the edge is a circle
39   GEOMAPI_EXPORT
40   bool isCircle() const;
41
42   /// Verifies that the edge is an arc of circle
43   GEOMAPI_EXPORT
44   bool isArc() const;
45
46   /// Verifies that the edge is an arc of circle
47   GEOMAPI_EXPORT
48   bool isEllipse() const;
49
50   /// Returns the first vertex coordinates of the edge
51   GEOMAPI_EXPORT
52   std::shared_ptr<GeomAPI_Pnt> firstPoint();
53
54   /// Returns the Last vertex coordinates of the edge
55   GEOMAPI_EXPORT
56   std::shared_ptr<GeomAPI_Pnt> lastPoint();
57
58   /// Returns a circle if edge is based on the circle curve
59   GEOMAPI_EXPORT
60   std::shared_ptr<GeomAPI_Circ> circle() const;
61
62   /// Returns an ellipse if edge is based on the ellipse curve
63   GEOMAPI_EXPORT
64   std::shared_ptr<GeomAPI_Ellipse> ellipse() const;
65
66   /// Returns a line if edge is based on the linear curve
67   GEOMAPI_EXPORT
68   std::shared_ptr<GeomAPI_Lin> line() const;
69
70   /// Returns true if the current edge is geometrically equal to the given edge
71   GEOMAPI_EXPORT
72   bool isEqual(const std::shared_ptr<GeomAPI_Shape> theEdge) const;
73
74   /// Returns range of parameter on the curve
75   GEOMAPI_EXPORT
76   void getRange(double& theFirst, double& theLast) const;
77
78   /// Returns true, if the edge is fully placed in the specified plane
79   GEOMAPI_EXPORT
80   bool isInPlane(const std::shared_ptr<GeomAPI_Pln> thePlane) const;
81
82   /// Returns edge length.
83   GEOMAPI_EXPORT
84   double length() const;
85 };
86
87 //! Pointer on attribute object
88 typedef std::shared_ptr<GeomAPI_Edge> GeomEdgePtr;
89
90 #endif
91