1 // Copyright (C) 2014-2017 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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef SketchAPI_Circle_H_
22 #define SketchAPI_Circle_H_
24 #include "SketchAPI.h"
25 #include "SketchAPI_SketchEntity.h"
27 #include <SketchPlugin_Circle.h>
29 class ModelHighAPI_Selection;
31 /// \class SketchAPI_Circle
32 /// \ingroup CPPHighAPI
33 /// \brief Interface for Circle feature.
34 class SketchAPI_Circle: public SketchAPI_SketchEntity
37 /// Constructor without values.
39 explicit SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature);
41 /// Constructor with values.
43 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,
54 /// Constructor with values.
56 SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
57 const ModelHighAPI_Selection& theExternal);
59 /// Constructor with values.
61 SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
62 const std::string& theExternalName);
66 virtual ~SketchAPI_Circle();
68 INTERFACE_3(SketchPlugin_Circle::ID(),
69 center, SketchPlugin_Circle::CENTER_ID(),
70 GeomDataAPI_Point2D, /** Center point */,
71 radius, SketchPlugin_Circle::RADIUS_ID(),
72 ModelAPI_AttributeDouble, /** Radius */,
73 external, SketchPlugin_Circle::EXTERNAL_ID(),
74 ModelAPI_AttributeSelection, /** External */)
76 /// Set by center and radius.
78 void setByCenterAndRadius(double theCenterX, double theCenterY, double theRadius);
80 /// Set by center and radius.
82 void setByCenterAndRadius(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter, double theRadius);
86 void setByExternal(const ModelHighAPI_Selection& theExternal);
88 /// Set by external name.
90 void setByExternalName(const std::string& theExternalName);
94 void setCenter(double theX, double theY);
98 void setCenter(const std::shared_ptr<GeomAPI_Pnt2d> & theCenter);
102 void setRadius(double theRadius);
104 /// Dump wrapped feature
106 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
109 /// Pointer on Circle object.
110 typedef std::shared_ptr<SketchAPI_Circle> CirclePtr;
112 #endif // SketchAPI_Circle_H_