Salome HOME
0cd903afd062b7669607f0fb839de4fb468db657
[modules/shaper.git] / src / SketchAPI / SketchAPI_Arc.h
1 // Copyright (C) 2014-2023  CEA, EDF
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_Arc_H_
21 #define SketchAPI_Arc_H_
22
23 #include "SketchAPI.h"
24 #include "SketchAPI_SketchEntity.h"
25
26 #include <GeomDataAPI_Point2D.h>
27
28 #include <SketchPlugin_Arc.h>
29
30 class ModelHighAPI_RefAttr;
31 class ModelHighAPI_Selection;
32
33 /// \class SketchAPI_Arc
34 /// \ingroup CPPHighAPI
35 /// \brief Interface for Arc feature.
36 class SketchAPI_Arc: public SketchAPI_SketchEntity
37 {
38 public:
39   /// Constructor without values.
40   SKETCHAPI_EXPORT
41   explicit SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature);
42
43   /// Constructor with values.
44   SKETCHAPI_EXPORT
45   SketchAPI_Arc(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_Arc(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_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
62                 const ModelHighAPI_Selection& theExternal);
63
64   /// Constructor with values.
65   SKETCHAPI_EXPORT
66   SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
67                 const std::wstring& theExternalName);
68
69   /// Destructor.
70   SKETCHAPI_EXPORT
71   virtual ~SketchAPI_Arc();
72
73   INTERFACE_7(SketchPlugin_Arc::ID(),
74                center, SketchPlugin_Arc::CENTER_ID(),
75                GeomDataAPI_Point2D, /** Center point */,
76                startPoint, SketchPlugin_Arc::START_ID(),
77                GeomDataAPI_Point2D, /** Start point */,
78                endPoint, SketchPlugin_Arc::END_ID(),
79                GeomDataAPI_Point2D, /** End point */,
80                reversed, SketchPlugin_Arc::REVERSED_ID(),
81                ModelAPI_AttributeBoolean, /** Inversed flag */,
82                radius, SketchPlugin_Arc::RADIUS_ID(),
83                ModelAPI_AttributeDouble, /** Radius */,
84                angle, SketchPlugin_Arc::ANGLE_ID(),
85                ModelAPI_AttributeDouble, /** Angle */,
86                external, SketchPlugin_Arc::EXTERNAL_ID(),
87                ModelAPI_AttributeSelection, /** External */)
88
89   /// Set by center and start, end point.
90   SKETCHAPI_EXPORT
91   void setByCenterStartEnd(double theCenterX, double theCenterY,
92                            double theStartX, double theStartY,
93                            double theEndX, double theEndY,
94                            bool theInversed);
95
96   /// Set by center and start, end point.
97   SKETCHAPI_EXPORT
98   void setByCenterStartEnd(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
99                            const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
100                            const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
101                            bool theInversed);
102
103   /// Set by external.
104   SKETCHAPI_EXPORT
105   void setByExternal(const ModelHighAPI_Selection& theExternal);
106
107   /// Set by external name.
108   SKETCHAPI_EXPORT
109   void setByExternalName(const std::wstring& theExternalName);
110
111   /// Dump wrapped feature
112   SKETCHAPI_EXPORT
113   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
114 };
115
116 /// Pointer on Arc object.
117 typedef std::shared_ptr<SketchAPI_Arc> ArcPtr;
118
119 #endif // SketchAPI_Arc_H_