Salome HOME
Added option to create Construction Point by distance on edge. Fixed tests.
[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
17 /**\class GeomAPI_Edge
18 * \ingroup DataModel
19  * \brief Interface to the edge object
20  */
21
22 class GeomAPI_Edge : public GeomAPI_Shape
23 {
24 public:
25    /// Makes an undefined Edge (no geometry).
26   GEOMAPI_EXPORT 
27    GeomAPI_Edge();
28
29    /// Creation of edge by the edge-shape
30   GEOMAPI_EXPORT 
31    GeomAPI_Edge(const std::shared_ptr<GeomAPI_Shape>& theShape);
32
33   /// Verifies that the edge is a line
34   GEOMAPI_EXPORT 
35   bool isLine() const;
36
37   /// Verifies that the edge is a circle
38   GEOMAPI_EXPORT 
39   bool isCircle() const;
40
41   /// Verifies that the edge is an arc of circle
42   GEOMAPI_EXPORT 
43   bool isArc() const;
44
45   /// Returns the first vertex coordinates of the edge 
46   GEOMAPI_EXPORT 
47   std::shared_ptr<GeomAPI_Pnt> firstPoint();
48
49   /// Returns the Last vertex coordinates of the edge 
50   GEOMAPI_EXPORT 
51   std::shared_ptr<GeomAPI_Pnt> lastPoint();
52
53   /// Returns a circle if edge is based on the circle curve
54   GEOMAPI_EXPORT 
55   std::shared_ptr<GeomAPI_Circ> circle();
56
57   /// Returns a line if edge is based on the linear curve
58   GEOMAPI_EXPORT 
59   std::shared_ptr<GeomAPI_Lin> line();
60
61   /// Returns true if the current edge is geometrically equal to the given edge
62   GEOMAPI_EXPORT 
63   bool isEqual(const std::shared_ptr<GeomAPI_Shape> theEdge) const;
64
65   /// Returns range of parameter on the curve
66   GEOMAPI_EXPORT 
67   void getRange(double& theFirst, double& theLast) const;
68
69   /// Returns true, if the edge is fully placed in the specified plane
70   GEOMAPI_EXPORT
71   bool isInPlane(const std::shared_ptr<GeomAPI_Pln> thePlane) const;
72
73   /// Returns edge length.
74   GEOMAPI_EXPORT
75   double length() const;
76 };
77
78 #endif
79