]> SALOME platform Git repositories - modules/shaper.git/blob - src/SketchAPI/SketchAPI_MacroArc.h
Salome HOME
Revert change for MacroArc attribute names
[modules/shaper.git] / src / SketchAPI / SketchAPI_MacroArc.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        SketchAPI_MacroArc.h
4 // Created:     09 June 2016
5 // Author:      Dmitry Bobylev
6
7 #ifndef SketchAPI_MacroArc_H_
8 #define SketchAPI_MacroArc_H_
9
10 #include "SketchAPI.h"
11 #include "SketchAPI_SketchEntity.h"
12
13 #include <GeomDataAPI_Point2D.h>
14
15 #include <SketchPlugin_MacroArc.h>
16
17 class ModelHighAPI_RefAttr;
18 class ModelHighAPI_Selection;
19
20 /// \class SketchAPI_MacroArc
21 /// \ingroup CPPHighAPI
22 /// \brief Interface for Arc feature.
23 class SketchAPI_MacroArc: public SketchAPI_SketchEntity
24 {
25 public:
26   /// Constructor without values.
27   SKETCHAPI_EXPORT
28   explicit SketchAPI_MacroArc(const std::shared_ptr<ModelAPI_Feature>& theFeature);
29
30   /// Constructor with values.
31   SKETCHAPI_EXPORT
32   SketchAPI_MacroArc(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_MacroArc(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_MacroArc(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_MacroArc(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_MacroArc(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_MacroArc(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   /// Destructor.
75   SKETCHAPI_EXPORT
76   virtual ~SketchAPI_MacroArc();
77
78   void test() {
79     SketchPlugin_MacroArc::ID();
80   }
81
82   INTERFACE_12(SketchPlugin_MacroArc::ID(),
83                arcType, SketchPlugin_MacroArc::ARC_TYPE(),
84                ModelAPI_AttributeString, /** Arc type */,
85                center, SketchPlugin_MacroArc::CENTER_POINT_ID(),
86                GeomDataAPI_Point2D, /** Center point */,
87                startPoint1, SketchPlugin_MacroArc::START_POINT_1_ID(),
88                GeomDataAPI_Point2D, /** Start point */,
89                endPoint1, SketchPlugin_MacroArc::END_POINT_1_ID(),
90                GeomDataAPI_Point2D, /** End point */,
91                startPoint2, SketchPlugin_MacroArc::START_POINT_2_ID(),
92                GeomDataAPI_Point2D, /** Start point */,
93                endPoint2, SketchPlugin_MacroArc::END_POINT_2_ID(),
94                GeomDataAPI_Point2D, /** End point */,
95                passedPoint, SketchPlugin_MacroArc::PASSED_POINT_ID(),
96                GeomDataAPI_Point2D, /** Passed point */,
97                tangentPoint, SketchPlugin_MacroArc::TANGENT_POINT_ID(),
98                ModelAPI_AttributeRefAttr, /** Tangent point */,
99                endPoint3, SketchPlugin_MacroArc::END_POINT_3_ID(),
100                GeomDataAPI_Point2D, /** End point */,
101                reversed, SketchPlugin_MacroArc::REVERSED_ID(),
102                ModelAPI_AttributeBoolean, /** Reversed flag */,
103                radius, SketchPlugin_MacroArc::RADIUS_ID(),
104                ModelAPI_AttributeDouble, /** Radius */,
105                angle, SketchPlugin_MacroArc::ANGLE_ID(),
106                ModelAPI_AttributeDouble, /** Angle */)
107
108 private:
109
110   /// Set by center and start, end point.
111   SKETCHAPI_EXPORT
112   void setByCenterStartEnd(double theCenterX, double theCenterY,
113                            double theStartX, double theStartY,
114                            double theEndX, double theEndY,
115                            bool theInversed);
116
117   /// Set by center and start, end point.
118   SKETCHAPI_EXPORT
119   void setByCenterStartEnd(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
120                            const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
121                            const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
122                            bool theInversed);
123
124   /// Set by start, end and passed points.
125   SKETCHAPI_EXPORT
126   void setByStartEndPassed(double theStartX, double theStartY,
127                            double theEndX, double theEndY,
128                            double thePassedX, double thePassedY);
129
130   /// Set by start, end and passed points.
131   SKETCHAPI_EXPORT
132   void setByStartEndPassed(const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
133                            const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
134                            const std::shared_ptr<GeomAPI_Pnt2d>& thePassed);
135
136   /// Set by tangent and end point.
137   SKETCHAPI_EXPORT
138   void setByTangent(const ModelHighAPI_RefAttr& theTangentPoint,
139                     double theEndX, double theEndY,
140                     bool theInversed);
141
142   /// Set by tangent and end point.
143   SKETCHAPI_EXPORT
144   void setByTangent(const ModelHighAPI_RefAttr& theTangentPoint,
145                     const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
146                     bool theInversed);
147 };
148
149 /// Pointer on Arc object.
150 typedef std::shared_ptr<SketchAPI_MacroArc> MacroArcPtr;
151
152 #endif // SketchAPI_MacroArc_H_