Salome HOME
Add copyright header according to request of CEA from 06.06.2017
[modules/shaper.git] / src / SketchAPI / SketchAPI_Circle.h
1 // Copyright (C) 2014-2017  CEA/DEN, EDF R&D
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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 //
20
21 #ifndef SketchAPI_Circle_H_
22 #define SketchAPI_Circle_H_
23
24 #include "SketchAPI.h"
25 #include "SketchAPI_SketchEntity.h"
26
27 #include <SketchPlugin_Circle.h>
28
29 class ModelHighAPI_Selection;
30
31 /// \class SketchAPI_Circle
32 /// \ingroup CPPHighAPI
33 /// \brief Interface for Circle feature.
34 class SketchAPI_Circle: public SketchAPI_SketchEntity
35 {
36 public:
37   /// Constructor without values.
38   SKETCHAPI_EXPORT
39   explicit SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature);
40
41   /// Constructor with values.
42   SKETCHAPI_EXPORT
43   SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
44                    double theCenterX,
45                    double theCenterY,
46                    double theRadius);
47
48   /// Constructor with values.
49   SKETCHAPI_EXPORT
50   SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
51                    const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
52                    double theRadius);
53
54   /// Constructor with values.
55   SKETCHAPI_EXPORT
56   SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
57                    const ModelHighAPI_Selection& theExternal);
58
59   /// Constructor with values.
60   SKETCHAPI_EXPORT
61   SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
62                    const std::string& theExternalName);
63
64   /// Destructor.
65   SKETCHAPI_EXPORT
66   virtual ~SketchAPI_Circle();
67
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 */)
75
76   /// Set by center and radius.
77   SKETCHAPI_EXPORT
78   void setByCenterAndRadius(double theCenterX, double theCenterY, double theRadius);
79
80   /// Set by center and radius.
81   SKETCHAPI_EXPORT
82   void setByCenterAndRadius(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter, double theRadius);
83
84   /// Set by external.
85   SKETCHAPI_EXPORT
86   void setByExternal(const ModelHighAPI_Selection& theExternal);
87
88   /// Set by external name.
89   SKETCHAPI_EXPORT
90   void setByExternalName(const std::string& theExternalName);
91
92   /// Set center.
93   SKETCHAPI_EXPORT
94   void setCenter(double theX, double theY);
95
96   /// Set center.
97   SKETCHAPI_EXPORT
98   void setCenter(const std::shared_ptr<GeomAPI_Pnt2d> & theCenter);
99
100   /// Set radius.
101   SKETCHAPI_EXPORT
102   void setRadius(double theRadius);
103
104   /// Dump wrapped feature
105   SKETCHAPI_EXPORT
106   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
107 };
108
109 /// Pointer on Circle object.
110 typedef std::shared_ptr<SketchAPI_Circle> CirclePtr;
111
112 #endif // SketchAPI_Circle_H_