1 // Copyright (C) 2014-2023 CEA, EDF
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef SketchAPI_Circle_H_
21 #define SketchAPI_Circle_H_
23 #include "SketchAPI.h"
24 #include "SketchAPI_SketchEntity.h"
26 #include <SketchPlugin_Circle.h>
28 class ModelHighAPI_Selection;
30 /// \class SketchAPI_Circle
31 /// \ingroup CPPHighAPI
32 /// \brief Interface for Circle feature.
33 class SketchAPI_Circle: public SketchAPI_SketchEntity
36 /// Constructor without values.
38 explicit SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature);
40 /// Constructor with values.
42 SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
48 /// Constructor with values.
50 SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
51 const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
55 /// Constructor with values.
57 SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
58 const ModelHighAPI_Selection& theExternal);
60 /// Constructor with values.
62 SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
63 const std::wstring& theExternalName);
67 virtual ~SketchAPI_Circle();
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 */)
79 /// Set by center and radius.
81 void setByCenterAndRadius(double theCenterX, double theCenterY,
82 double theRadius, double theAngle);
84 /// Set by center and radius.
86 void setByCenterAndRadius(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
87 double theRadius, double theAngle);
91 void setByExternal(const ModelHighAPI_Selection& theExternal);
93 /// Set by external name.
95 void setByExternalName(const std::wstring& theExternalName);
99 void setCenter(double theX, double theY);
103 void setCenter(const std::shared_ptr<GeomAPI_Pnt2d> & theCenter);
107 void setRadius(double theRadius);
111 void setAngle(double theAngle);
113 /// Returns created points on circle
115 std::shared_ptr<SketchAPI_SketchEntity> createdPoint() const;
117 /// Dump wrapped feature
119 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
125 /// Pointer on Circle object.
126 typedef std::shared_ptr<SketchAPI_Circle> CirclePtr;
128 #endif // SketchAPI_Circle_H_