]> SALOME platform Git repositories - modules/shaper.git/blob - src/SketchAPI/SketchAPI_Circle.h
Salome HOME
96744ebf5cf42fe0f9c8e594611fa003e70e0d4d
[modules/shaper.git] / src / SketchAPI / SketchAPI_Circle.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_Circle_H_
21 #define SketchAPI_Circle_H_
22
23 #include "SketchAPI.h"
24 #include "SketchAPI_SketchEntity.h"
25
26 #include <SketchPlugin_Circle.h>
27
28 class ModelHighAPI_Selection;
29
30 /// \class SketchAPI_Circle
31 /// \ingroup CPPHighAPI
32 /// \brief Interface for Circle feature.
33 class SketchAPI_Circle: public SketchAPI_SketchEntity
34 {
35 public:
36   /// Constructor without values.
37   SKETCHAPI_EXPORT
38   explicit SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature);
39
40   /// Constructor with values.
41   SKETCHAPI_EXPORT
42   SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
43                    double theCenterX,
44                    double theCenterY,
45                    double theRadius,
46                    double theAngle);
47
48   /// Constructor with values.
49   SKETCHAPI_EXPORT
50   SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
51                    const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
52                    double theRadius,
53                    double theAngle);
54
55   /// Constructor with values.
56   SKETCHAPI_EXPORT
57   SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
58                    const ModelHighAPI_Selection& theExternal);
59
60   /// Constructor with values.
61   SKETCHAPI_EXPORT
62   SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
63                    const std::wstring& theExternalName);
64
65   /// Destructor.
66   SKETCHAPI_EXPORT
67   virtual ~SketchAPI_Circle();
68
69   INTERFACE_4(SketchPlugin_Circle::ID(),
70               center, SketchPlugin_Circle::CENTER_ID(),
71               GeomDataAPI_Point2D, /** Center point */,
72               radius, SketchPlugin_Circle::RADIUS_ID(),
73               ModelAPI_AttributeDouble, /** Radius */,
74               external, SketchPlugin_Circle::EXTERNAL_ID(),
75               ModelAPI_AttributeSelection, /** External */,
76               angle, SketchPlugin_Circle::ANGLE_ID(),
77               ModelAPI_AttributeDouble, /** Angle */)
78
79   /// Set by center and radius.
80   SKETCHAPI_EXPORT
81   void setByCenterAndRadius(double theCenterX, double theCenterY,
82                             double theRadius, double theAngle);
83
84   /// Set by center and radius.
85   SKETCHAPI_EXPORT
86   void setByCenterAndRadius(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
87                             double theRadius, double theAngle);
88
89   /// Set by external.
90   SKETCHAPI_EXPORT
91   void setByExternal(const ModelHighAPI_Selection& theExternal);
92
93   /// Set by external name.
94   SKETCHAPI_EXPORT
95   void setByExternalName(const std::wstring& theExternalName);
96
97   /// Set center.
98   SKETCHAPI_EXPORT
99   void setCenter(double theX, double theY);
100
101   /// Set center.
102   SKETCHAPI_EXPORT
103   void setCenter(const std::shared_ptr<GeomAPI_Pnt2d> & theCenter);
104
105   /// Set radius.
106   SKETCHAPI_EXPORT
107   void setRadius(double theRadius);
108
109   /// Set angle.
110   SKETCHAPI_EXPORT
111   void setAngle(double theAngle);
112
113   /// Returns created points on circle
114   SKETCHAPI_EXPORT
115   std::shared_ptr<SketchAPI_SketchEntity> createdPoint() const;
116
117   /// Dump wrapped feature
118   SKETCHAPI_EXPORT
119   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
120
121 private:
122   void createPoint();
123 };
124
125 /// Pointer on Circle object.
126 typedef std::shared_ptr<SketchAPI_Circle> CirclePtr;
127
128 #endif // SketchAPI_Circle_H_