1 // Copyright (C) 2014-2020 CEA/DEN, EDF R&D
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,
47 /// Constructor with values.
49 SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
50 const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
53 /// Constructor with values.
55 SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
56 const ModelHighAPI_Selection& theExternal);
58 /// Constructor with values.
60 SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
61 const std::wstring& theExternalName);
65 virtual ~SketchAPI_Circle();
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 */)
75 /// Set by center and radius.
77 void setByCenterAndRadius(double theCenterX, double theCenterY, double theRadius);
79 /// Set by center and radius.
81 void setByCenterAndRadius(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter, double theRadius);
85 void setByExternal(const ModelHighAPI_Selection& theExternal);
87 /// Set by external name.
89 void setByExternalName(const std::wstring& theExternalName);
93 void setCenter(double theX, double theY);
97 void setCenter(const std::shared_ptr<GeomAPI_Pnt2d> & theCenter);
101 void setRadius(double theRadius);
103 /// Dump wrapped feature
105 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
108 /// Pointer on Circle object.
109 typedef std::shared_ptr<SketchAPI_Circle> CirclePtr;
111 #endif // SketchAPI_Circle_H_