]> SALOME platform Git repositories - modules/shaper.git/blob - src/SketchAPI/SketchAPI_MacroArc.h
Salome HOME
#18963 C++17 ready
[modules/shaper.git] / src / SketchAPI / SketchAPI_MacroArc.h
1 // Copyright (C) 2014-2020  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
18 //
19
20 #ifndef SketchAPI_MacroArc_H_
21 #define SketchAPI_MacroArc_H_
22
23 #include "SketchAPI.h"
24 #include "SketchAPI_SketchEntity.h"
25
26 #include <GeomDataAPI_Point2D.h>
27
28 #include <SketchPlugin_MacroArc.h>
29
30 class ModelHighAPI_RefAttr;
31 class ModelHighAPI_Selection;
32
33 /// \class SketchAPI_MacroArc
34 /// \ingroup CPPHighAPI
35 /// \brief Interface for Arc feature.
36 class SketchAPI_MacroArc: public SketchAPI_SketchEntity
37 {
38 public:
39   /// Constructor without values.
40   SKETCHAPI_EXPORT
41   explicit SketchAPI_MacroArc(const std::shared_ptr<ModelAPI_Feature>& theFeature);
42
43   /// Constructor with values.
44   SKETCHAPI_EXPORT
45   SketchAPI_MacroArc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
46                 double theCenterX, double theCenterY,
47                 double theStartX, double theStartY,
48                 double theEndX, double theEndY,
49                 bool theInversed);
50
51   /// Constructor with values.
52   SKETCHAPI_EXPORT
53   SketchAPI_MacroArc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
54                 const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
55                 const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
56                 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
57                 bool theInversed);
58
59   /// Constructor with values.
60   SKETCHAPI_EXPORT
61   SketchAPI_MacroArc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
62                 double theStartX, double theStartY,
63                 double theEndX, double theEndY,
64                 double thePassedX, double thePassedY);
65
66   /// Constructor with values.
67   SKETCHAPI_EXPORT
68   SketchAPI_MacroArc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
69                 const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
70                 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
71                 const std::shared_ptr<GeomAPI_Pnt2d>& thePassed);
72
73   /// Constructor with values.
74   SKETCHAPI_EXPORT
75   SketchAPI_MacroArc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
76                 const ModelHighAPI_RefAttr& theTangentPoint,
77                 double theEndX, double theEndY,
78                 bool theInversed);
79
80   /// Constructor with values.
81   SKETCHAPI_EXPORT
82   SketchAPI_MacroArc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
83                 const ModelHighAPI_RefAttr& theTangentPoint,
84                 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
85                 bool theInversed);
86
87   /// Destructor.
88   SKETCHAPI_EXPORT
89   virtual ~SketchAPI_MacroArc();
90
91   INTERFACE_14(SketchPlugin_MacroArc::ID(),
92                arcType, SketchPlugin_MacroArc::ARC_TYPE(),
93                ModelAPI_AttributeString, /** Arc type */,
94                center, SketchPlugin_MacroArc::CENTER_POINT_ID(),
95                GeomDataAPI_Point2D, /** Center point */,
96                startPoint1, SketchPlugin_MacroArc::START_POINT_1_ID(),
97                GeomDataAPI_Point2D, /** Start point */,
98                endPoint1, SketchPlugin_MacroArc::END_POINT_1_ID(),
99                GeomDataAPI_Point2D, /** End point */,
100                startPoint2, SketchPlugin_MacroArc::START_POINT_2_ID(),
101                GeomDataAPI_Point2D, /** Start point */,
102                endPoint2, SketchPlugin_MacroArc::END_POINT_2_ID(),
103                GeomDataAPI_Point2D, /** End point */,
104                passedPoint, SketchPlugin_MacroArc::PASSED_POINT_ID(),
105                GeomDataAPI_Point2D, /** Passed point */,
106                tangentPoint, SketchPlugin_MacroArc::TANGENT_POINT_ID(),
107                ModelAPI_AttributeRefAttr, /** Tangent point */,
108                endPoint3, SketchPlugin_MacroArc::END_POINT_3_ID(),
109                GeomDataAPI_Point2D, /** End point */,
110                transversalPoint, SketchPlugin_MacroArc::TRANSVERSAL_POINT_ID(),
111                ModelAPI_AttributeRefAttr, /** Transversal point */,
112                endPoint4, SketchPlugin_MacroArc::END_POINT_4_ID(),
113                GeomDataAPI_Point2D, /** End point */,
114                reversed, SketchPlugin_MacroArc::REVERSED_ID(),
115                ModelAPI_AttributeBoolean, /** Reversed flag */,
116                radius, SketchPlugin_MacroArc::RADIUS_ID(),
117                ModelAPI_AttributeDouble, /** Radius */,
118                angle, SketchPlugin_MacroArc::ANGLE_ID(),
119                ModelAPI_AttributeDouble, /** Angle */)
120
121   /// Set by center and start, end point.
122   SKETCHAPI_EXPORT
123   void setByCenterStartEnd(double theCenterX, double theCenterY,
124                            double theStartX, double theStartY,
125                            double theEndX, double theEndY,
126                            bool theInversed);
127
128   /// Set by center and start, end point.
129   SKETCHAPI_EXPORT
130   void setByCenterStartEnd(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
131                            const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
132                            const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
133                            bool theInversed);
134
135   /// Set by start, end and passed points.
136   SKETCHAPI_EXPORT
137   void setByStartEndPassed(double theStartX, double theStartY,
138                            double theEndX, double theEndY,
139                            double thePassedX, double thePassedY);
140
141   /// Set by start, end and passed points.
142   SKETCHAPI_EXPORT
143   void setByStartEndPassed(const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
144                            const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
145                            const std::shared_ptr<GeomAPI_Pnt2d>& thePassed);
146
147   /// Set by tangent and end point.
148   SKETCHAPI_EXPORT
149   void setByTangent(const ModelHighAPI_RefAttr& theTangentPoint,
150                     double theEndX, double theEndY,
151                     bool theInversed);
152
153   /// Set by tangent and end point.
154   SKETCHAPI_EXPORT
155   void setByTangent(const ModelHighAPI_RefAttr& theTangentPoint,
156                     const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
157                     bool theInversed);
158
159   /// Set by tangent and end point.
160   SKETCHAPI_EXPORT
161   void setByTransversal(const ModelHighAPI_RefAttr& theTransversalPoint,
162                         double theEndX, double theEndY,
163                         bool theInversed);
164
165   /// Set by tangent and end point.
166   SKETCHAPI_EXPORT
167   void setByTransversal(const ModelHighAPI_RefAttr& theTransversalPoint,
168                         const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
169                         bool theInversed);
170 };
171
172 /// Pointer on Arc object.
173 typedef std::shared_ptr<SketchAPI_MacroArc> MacroArcPtr;
174
175 #endif // SketchAPI_MacroArc_H_