SHAPER 9.16.0
SketchAPI_Circle.h
1// Copyright (C) 2014-2026 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{
35public:
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 bool theIsAddPoint = false,
47 double theAngle = 0.0);
48
50 SKETCHAPI_EXPORT
51 SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
52 const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
53 double theRadius,
54 bool theIsAddPoint = false,
55 double theAngle = 0.0);
56
58 SKETCHAPI_EXPORT
59 SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
60 const ModelHighAPI_Selection& theExternal);
61
63 SKETCHAPI_EXPORT
64 SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
65 const std::wstring& theExternalName);
66
68 SKETCHAPI_EXPORT
69 virtual ~SketchAPI_Circle();
70
71 INTERFACE_5(SketchPlugin_Circle::ID(),
82
83
84 SKETCHAPI_EXPORT
85 void setByCenterAndRadius(double theCenterX, double theCenterY,
86 double theRadius,
87 bool theIsAddPoint = false,
88 double theAngle = 0.0);
89
91 SKETCHAPI_EXPORT
92 void setByCenterAndRadius(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
93 double theRadius,
94 bool theIsAddPoint = false,
95 double theAngle = 0.0);
96
98 SKETCHAPI_EXPORT
99 void setByExternal(const ModelHighAPI_Selection& theExternal);
100
102 SKETCHAPI_EXPORT
103 void setByExternalName(const std::wstring& theExternalName);
104
106 SKETCHAPI_EXPORT
107 void setCenter(double theX, double theY);
108
110 SKETCHAPI_EXPORT
111 void setCenter(const std::shared_ptr<GeomAPI_Pnt2d> & theCenter);
112
114 SKETCHAPI_EXPORT
115 void setRadius(double theRadius);
116
118 SKETCHAPI_EXPORT
119 void setAngle(double theAngle);
120
122 SKETCHAPI_EXPORT
123 void setIsToAddPoint(bool theIsToAddPoint);
124
126 SKETCHAPI_EXPORT
127 std::shared_ptr<SketchAPI_SketchEntity> createdPoint() const;
128
130 SKETCHAPI_EXPORT
131 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
132
133private:
134 void createPoint();
135};
136
138typedef std::shared_ptr<SketchAPI_Circle> CirclePtr;
139
140#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 boolean value.
Definition: ModelAPI_AttributeBoolean.h:31
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:81
virtual std::shared_ptr< ModelAPI_AttributeDouble > angle() const
Angle.
Definition: SketchAPI_Circle.h:81
virtual std::shared_ptr< ModelAPI_AttributeSelection > external() const
External.
Definition: SketchAPI_Circle.h:81
void setByExternalName(const std::wstring &theExternalName)
Set by external name.
Definition: SketchAPI_Circle.cpp:129
void setAngle(double theAngle)
Set angle.
Definition: SketchAPI_Circle.cpp:169
void setCenter(double theX, double theY)
Set center.
Definition: SketchAPI_Circle.cpp:137
void setRadius(double theRadius)
Set radius.
Definition: SketchAPI_Circle.cpp:153
void setByExternal(const ModelHighAPI_Selection &theExternal)
Set by external.
Definition: SketchAPI_Circle.cpp:121
virtual std::shared_ptr< GeomDataAPI_Point2D > center() const
Center point.
Definition: SketchAPI_Circle.h:81
virtual std::shared_ptr< ModelAPI_AttributeBoolean > addpoint() const
Is to add point.
Definition: SketchAPI_Circle.h:81
void setIsToAddPoint(bool theIsToAddPoint)
Set is to add point.
Definition: SketchAPI_Circle.cpp:161
virtual void dump(ModelHighAPI_Dumper &theDumper) const
Dump wrapped feature.
Definition: SketchAPI_Circle.cpp:193
virtual ~SketchAPI_Circle()
Destructor.
Definition: SketchAPI_Circle.cpp:87
SketchAPI_Circle(const std::shared_ptr< ModelAPI_Feature > &theFeature)
Constructor without values.
Definition: SketchAPI_Circle.cpp:33
std::shared_ptr< SketchAPI_SketchEntity > createdPoint() const
Returns created points on circle.
Definition: SketchAPI_Circle.cpp:178
void setByCenterAndRadius(double theCenterX, double theCenterY, double theRadius, bool theIsAddPoint=false, double theAngle=0.0)
Set by center and radius.
Definition: SketchAPI_Circle.cpp:93
Base class for Sketch feature interfaces.
Definition: SketchAPI_SketchEntity.h:38
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:63
static const std::string & ID()
Circle feature kind.
Definition: SketchPlugin_Circle.h:35
static const std::string & ANGLE_ID()
Angle of rotation sewing point of the circle.
Definition: SketchPlugin_Circle.h:70
static const std::string & ADD_CONSTRUCTION_POINT_ID()
Is to create construction point or not.
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