Salome HOME
Documentation update
[modules/shaper.git] / src / SketchAPI / SketchAPI_Arc.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        SketchAPI_Arc.h
4 // Created:     09 June 2016
5 // Author:      Dmitry Bobylev
6
7 #ifndef SketchAPI_Arc_H_
8 #define SketchAPI_Arc_H_
9
10 #include "SketchAPI.h"
11 #include "SketchAPI_SketchEntity.h"
12
13 #include <GeomDataAPI_Point2D.h>
14
15 #include <SketchPlugin_Arc.h>
16
17 class ModelHighAPI_RefAttr;
18 class ModelHighAPI_Selection;
19
20 /// \class SketchAPI_Arc
21 /// \ingroup CPPHighAPI
22 /// \brief Interface for Arc feature.
23 class SketchAPI_Arc: public SketchAPI_SketchEntity
24 {
25 public:
26   /// Constructor without values.
27   SKETCHAPI_EXPORT
28   explicit SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature);
29
30   /// Constructor with values.
31   SKETCHAPI_EXPORT
32   SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
33                 double theCenterX, double theCenterY,
34                 double theStartX, double theStartY,
35                 double theEndX, double theEndY,
36                 bool theInversed);
37
38   /// Constructor with values.
39   SKETCHAPI_EXPORT
40   SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
41                 const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
42                 const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
43                 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
44                 bool theInversed);
45
46   /// Constructor with values.
47   SKETCHAPI_EXPORT
48   SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
49                 double theStartX, double theStartY,
50                 double theEndX, double theEndY,
51                 double thePassedX, double thePassedY);
52
53   /// Constructor with values.
54   SKETCHAPI_EXPORT
55   SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
56                 const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
57                 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
58                 const std::shared_ptr<GeomAPI_Pnt2d>& thePassed);
59
60   /// Constructor with values.
61   SKETCHAPI_EXPORT
62   SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
63                 const ModelHighAPI_RefAttr& theTangentPoint,
64                 double theEndX, double theEndY,
65                 bool theInversed);
66
67   /// Constructor with values.
68   SKETCHAPI_EXPORT
69   SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
70                 const ModelHighAPI_RefAttr& theTangentPoint,
71                 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
72                 bool theInversed);
73
74   /// Constructor with values.
75   SKETCHAPI_EXPORT
76   SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
77                 const ModelHighAPI_Selection& theExternal);
78
79   /// Constructor with values.
80   SKETCHAPI_EXPORT
81   SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
82                 const std::string& theExternalName);
83
84   /// Destructor.
85   SKETCHAPI_EXPORT
86   virtual ~SketchAPI_Arc();
87
88   INTERFACE_10(SketchPlugin_Arc::ID(),
89                arcType, SketchPlugin_Arc::ARC_TYPE(), ModelAPI_AttributeString, /** Arc type */,
90                center, SketchPlugin_Arc::CENTER_ID(), GeomDataAPI_Point2D, /** Center point */,
91                startPoint, SketchPlugin_Arc::START_ID(), GeomDataAPI_Point2D, /** Start point */,
92                endPoint, SketchPlugin_Arc::END_ID(), GeomDataAPI_Point2D, /** End point */,
93                inversed, SketchPlugin_Arc::INVERSED_ID(), ModelAPI_AttributeBoolean, /** Inversed flag */,
94                passedPoint, SketchPlugin_Arc::PASSED_POINT_ID(), GeomDataAPI_Point2D, /** Passed point */,
95                tangentPoint, SketchPlugin_Arc::TANGENT_POINT_ID(), ModelAPI_AttributeRefAttr, /** Tangent point */,
96                radius, SketchPlugin_Arc::RADIUS_ID(), ModelAPI_AttributeDouble, /** Radius */,
97                angle, SketchPlugin_Arc::ANGLE_ID(), ModelAPI_AttributeDouble, /** Angle */,
98                external, SketchPlugin_Arc::EXTERNAL_ID(), ModelAPI_AttributeSelection, /** External */)
99
100   /// Set by center and start, end point.
101   SKETCHAPI_EXPORT
102   void setByCenterStartEnd(double theCenterX, double theCenterY,
103                            double theStartX, double theStartY,
104                            double theEndX, double theEndY,
105                            bool theInversed);
106
107   /// Set by center and start, end point.
108   SKETCHAPI_EXPORT
109   void setByCenterStartEnd(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
110                            const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
111                            const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
112                            bool theInversed);
113
114   /// Set by start, end and passed points.
115   SKETCHAPI_EXPORT
116   void setByStartEndPassed(double theStartX, double theStartY,
117                            double theEndX, double theEndY,
118                            double thePassedX, double thePassedY);
119
120   /// Set by start, end and passed points.
121   SKETCHAPI_EXPORT
122   void setByStartEndPassed(const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
123                            const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
124                            const std::shared_ptr<GeomAPI_Pnt2d>& thePassed);
125
126   /// Set by tangent and end point.
127   SKETCHAPI_EXPORT
128   void setByTangent(const ModelHighAPI_RefAttr& theTangentPoint,
129                     double theEndX, double theEndY,
130                     bool theInversed);
131
132   /// Set by tangent and end point.
133   SKETCHAPI_EXPORT
134   void setByTangent(const ModelHighAPI_RefAttr& theTangentPoint,
135                     const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
136                     bool theInversed);
137
138   /// Set by external.
139   SKETCHAPI_EXPORT
140   void setByExternal(const ModelHighAPI_Selection& theExternal);
141
142   /// Set by external name.
143   SKETCHAPI_EXPORT
144   void setByExternalName(const std::string& theExternalName);
145
146   /// Set radius.
147   SKETCHAPI_EXPORT
148   void setRadius(double theRadius);
149
150   /// Set angle.
151   SKETCHAPI_EXPORT
152   void setAngle(double theAngle);
153
154   /// Dump wrapped feature
155   SKETCHAPI_EXPORT
156   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
157 };
158
159 /// Pointer on Arc object.
160 typedef std::shared_ptr<SketchAPI_Arc> ArcPtr;
161
162 #endif // SketchAPI_Arc_H_