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