Salome HOME
updated copyright message
[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
47   /// Constructor with values.
48   SKETCHAPI_EXPORT
49   SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
50                    const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
51                    double theRadius);
52
53   /// Constructor with values.
54   SKETCHAPI_EXPORT
55   SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
56                    const ModelHighAPI_Selection& theExternal);
57
58   /// Constructor with values.
59   SKETCHAPI_EXPORT
60   SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
61                    const std::wstring& theExternalName);
62
63   /// Destructor.
64   SKETCHAPI_EXPORT
65   virtual ~SketchAPI_Circle();
66
67   INTERFACE_3(SketchPlugin_Circle::ID(),
68               center, SketchPlugin_Circle::CENTER_ID(),
69               GeomDataAPI_Point2D, /** Center point */,
70               radius, SketchPlugin_Circle::RADIUS_ID(),
71               ModelAPI_AttributeDouble, /** Radius */,
72               external, SketchPlugin_Circle::EXTERNAL_ID(),
73               ModelAPI_AttributeSelection, /** External */)
74
75   /// Set by center and radius.
76   SKETCHAPI_EXPORT
77   void setByCenterAndRadius(double theCenterX, double theCenterY, double theRadius);
78
79   /// Set by center and radius.
80   SKETCHAPI_EXPORT
81   void setByCenterAndRadius(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter, double theRadius);
82
83   /// Set by external.
84   SKETCHAPI_EXPORT
85   void setByExternal(const ModelHighAPI_Selection& theExternal);
86
87   /// Set by external name.
88   SKETCHAPI_EXPORT
89   void setByExternalName(const std::wstring& theExternalName);
90
91   /// Set center.
92   SKETCHAPI_EXPORT
93   void setCenter(double theX, double theY);
94
95   /// Set center.
96   SKETCHAPI_EXPORT
97   void setCenter(const std::shared_ptr<GeomAPI_Pnt2d> & theCenter);
98
99   /// Set radius.
100   SKETCHAPI_EXPORT
101   void setRadius(double theRadius);
102
103   /// Dump wrapped feature
104   SKETCHAPI_EXPORT
105   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
106 };
107
108 /// Pointer on Circle object.
109 typedef std::shared_ptr<SketchAPI_Circle> CirclePtr;
110
111 #endif // SketchAPI_Circle_H_