Salome HOME
Update copyrights
[modules/shaper.git] / src / SketchAPI / SketchAPI_MacroArc.h
1 // Copyright (C) 2014-2019  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_12(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                reversed, SketchPlugin_MacroArc::REVERSED_ID(),
111                ModelAPI_AttributeBoolean, /** Reversed flag */,
112                radius, SketchPlugin_MacroArc::RADIUS_ID(),
113                ModelAPI_AttributeDouble, /** Radius */,
114                angle, SketchPlugin_MacroArc::ANGLE_ID(),
115                ModelAPI_AttributeDouble, /** Angle */)
116
117 private:
118
119   /// Set by center and start, end point.
120   SKETCHAPI_EXPORT
121   void setByCenterStartEnd(double theCenterX, double theCenterY,
122                            double theStartX, double theStartY,
123                            double theEndX, double theEndY,
124                            bool theInversed);
125
126   /// Set by center and start, end point.
127   SKETCHAPI_EXPORT
128   void setByCenterStartEnd(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
129                            const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
130                            const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
131                            bool theInversed);
132
133   /// Set by start, end and passed points.
134   SKETCHAPI_EXPORT
135   void setByStartEndPassed(double theStartX, double theStartY,
136                            double theEndX, double theEndY,
137                            double thePassedX, double thePassedY);
138
139   /// Set by start, end and passed points.
140   SKETCHAPI_EXPORT
141   void setByStartEndPassed(const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
142                            const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
143                            const std::shared_ptr<GeomAPI_Pnt2d>& thePassed);
144
145   /// Set by tangent and end point.
146   SKETCHAPI_EXPORT
147   void setByTangent(const ModelHighAPI_RefAttr& theTangentPoint,
148                     double theEndX, double theEndY,
149                     bool theInversed);
150
151   /// Set by tangent and end point.
152   SKETCHAPI_EXPORT
153   void setByTangent(const ModelHighAPI_RefAttr& theTangentPoint,
154                     const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
155                     bool theInversed);
156 };
157
158 /// Pointer on Arc object.
159 typedef std::shared_ptr<SketchAPI_MacroArc> MacroArcPtr;
160
161 #endif // SketchAPI_MacroArc_H_