SHAPER  9.12.0
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 
29 
34 {
35 public:
37  SKETCHAPI_EXPORT
38  explicit SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature);
39 
41  SKETCHAPI_EXPORT
42  SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
43  double theCenterX,
44  double theCenterY,
45  double theRadius);
46 
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 
54  SKETCHAPI_EXPORT
55  SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
56  const ModelHighAPI_Selection& theExternal);
57 
59  SKETCHAPI_EXPORT
60  SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
61  const std::wstring& theExternalName);
62 
64  SKETCHAPI_EXPORT
65  virtual ~SketchAPI_Circle();
66 
67  INTERFACE_3(SketchPlugin_Circle::ID(),
74 
75 
76  SKETCHAPI_EXPORT
77  void setByCenterAndRadius(double theCenterX, double theCenterY, double theRadius);
78 
80  SKETCHAPI_EXPORT
81  void setByCenterAndRadius(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter, double theRadius);
82 
84  SKETCHAPI_EXPORT
85  void setByExternal(const ModelHighAPI_Selection& theExternal);
86 
88  SKETCHAPI_EXPORT
89  void setByExternalName(const std::wstring& theExternalName);
90 
92  SKETCHAPI_EXPORT
93  void setCenter(double theX, double theY);
94 
96  SKETCHAPI_EXPORT
97  void setCenter(const std::shared_ptr<GeomAPI_Pnt2d> & theCenter);
98 
100  SKETCHAPI_EXPORT
101  void setRadius(double theRadius);
102 
104  SKETCHAPI_EXPORT
105  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
106 };
107 
109 typedef std::shared_ptr<SketchAPI_Circle> CirclePtr;
110 
111 #endif // SketchAPI_Circle_H_
2D point defined by two coordinates
Definition: GeomAPI_Pnt2d.h:36
Attribute that contains 2D point coordinates.
Definition: GeomDataAPI_Point2D.h:37
Attribute that contains real value with double precision.
Definition: ModelAPI_AttributeDouble.h:34
Attribute that contains reference to the sub-shape of some result, the selected shape.
Definition: ModelAPI_AttributeSelection.h:35
Dump engine for the model.
Definition: ModelHighAPI_Dumper.h:81
Class for filling ModelAPI_AttributeSelection.
Definition: ModelHighAPI_Selection.h:49
Interface for Circle feature.
Definition: SketchAPI_Circle.h:34
virtual std::shared_ptr< ModelAPI_AttributeDouble > radius() const
Radius.
Definition: SketchAPI_Circle.h:73
virtual std::shared_ptr< ModelAPI_AttributeSelection > external() const
External.
Definition: SketchAPI_Circle.h:73
void setByExternalName(const std::wstring &theExternalName)
Set by external name.
Definition: SketchAPI_Circle.cpp:113
void setCenter(double theX, double theY)
Set center.
Definition: SketchAPI_Circle.cpp:121
void setRadius(double theRadius)
Set radius.
Definition: SketchAPI_Circle.cpp:137
void setByExternal(const ModelHighAPI_Selection &theExternal)
Set by external.
Definition: SketchAPI_Circle.cpp:105
virtual std::shared_ptr< GeomDataAPI_Point2D > center() const
Center point.
Definition: SketchAPI_Circle.h:73
virtual void dump(ModelHighAPI_Dumper &theDumper) const
Dump wrapped feature.
Definition: SketchAPI_Circle.cpp:145
virtual ~SketchAPI_Circle()
Destructor.
Definition: SketchAPI_Circle.cpp:80
SketchAPI_Circle(const std::shared_ptr< ModelAPI_Feature > &theFeature)
Constructor without values.
Definition: SketchAPI_Circle.cpp:30
void setByCenterAndRadius(double theCenterX, double theCenterY, double theRadius)
Set by center and radius.
Definition: SketchAPI_Circle.cpp:86
Base class for Sketch feature interfaces.
Definition: SketchAPI_SketchEntity.h:38
static const std::string & ID()
Circle feature kind.
Definition: SketchPlugin_Circle.h:35
static const std::string & CENTER_ID()
2D point - center of the circle
Definition: SketchPlugin_Circle.h:42
static const std::string & RADIUS_ID()
Radius of the circle.
Definition: SketchPlugin_Circle.h:49
static const std::string & EXTERNAL_ID()
Reference to the external edge or vertex as a AttributeSelection.
Definition: SketchPlugin_SketchEntity.h:55