Salome HOME
Add copyright header according to request of CEA from 06.06.2017
[modules/shaper.git] / src / SketchAPI / SketchAPI_MacroCircle.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_MacroCircle_H_
22 #define SketchAPI_MacroCircle_H_
23
24 #include "SketchAPI.h"
25 #include "SketchAPI_SketchEntity.h"
26
27 #include <SketchPlugin_MacroCircle.h>
28
29 class ModelHighAPI_Selection;
30
31 /// \class SketchAPI_MacroCircle
32 /// \ingroup CPPHighAPI
33 /// \brief Interface for Circle feature.
34 class SketchAPI_MacroCircle: public SketchAPI_SketchEntity
35 {
36 public:
37   /// Constructor without values.
38   SKETCHAPI_EXPORT
39   explicit SketchAPI_MacroCircle(const std::shared_ptr<ModelAPI_Feature>& theFeature);
40
41   /// Constructor with values.
42   SKETCHAPI_EXPORT
43   SketchAPI_MacroCircle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
44                         double theCenterX,
45                         double theCenterY,
46                         double thePassedX,
47                         double thePassedY);
48
49   /// Constructor with values.
50   SKETCHAPI_EXPORT
51   SketchAPI_MacroCircle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
52                         const std::shared_ptr<GeomAPI_Pnt2d>& theCenterPoint,
53                         const std::shared_ptr<GeomAPI_Pnt2d>& thePassedPoint);
54
55   /// Constructor with values.
56   SKETCHAPI_EXPORT
57   SketchAPI_MacroCircle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
58                         double theX1, double theY1,
59                         double theX2, double theY2,
60                         double theX3, double theY3);
61
62   /// Constructor with values.
63   SKETCHAPI_EXPORT
64   SketchAPI_MacroCircle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
65                         const std::shared_ptr<GeomAPI_Pnt2d>& thePoint1,
66                         const std::shared_ptr<GeomAPI_Pnt2d>& thePoint2,
67                         const std::shared_ptr<GeomAPI_Pnt2d>& thePoint3);
68
69   /// Destructor.
70   SKETCHAPI_EXPORT
71   virtual ~SketchAPI_MacroCircle();
72
73   INTERFACE_6(SketchPlugin_MacroCircle::ID(),
74               circleType, SketchPlugin_MacroCircle::CIRCLE_TYPE(),
75               ModelAPI_AttributeString, /** Circle type */,
76               centerPoint, SketchPlugin_MacroCircle::CENTER_POINT_ID(),
77               GeomDataAPI_Point2D, /** Center point */,
78               passedPoint, SketchPlugin_MacroCircle::PASSED_POINT_ID(),
79               GeomDataAPI_Point2D, /** Passed point */,
80               firstPoint, SketchPlugin_MacroCircle::FIRST_POINT_ID(),
81               GeomDataAPI_Point2D, /** First point */,
82               secondPoint, SketchPlugin_MacroCircle::SECOND_POINT_ID(),
83               GeomDataAPI_Point2D, /** Second point */,
84               thirdPoint, SketchPlugin_MacroCircle::THIRD_POINT_ID(),
85               GeomDataAPI_Point2D, /** Third point */)
86
87   /// Set by center and passed points.
88   SKETCHAPI_EXPORT
89   void setByCenterAndPassedPoints(double theCenterX, double theCenterY,
90                                   double thePassedX, double thePassedY);
91
92   /// Set by center and passed points.
93   SKETCHAPI_EXPORT
94   void setByCenterAndPassedPoints(const std::shared_ptr<GeomAPI_Pnt2d>& theCenterPoint,
95                                   const std::shared_ptr<GeomAPI_Pnt2d>& thePassedPoint);
96
97   /// Set by three points.
98   SKETCHAPI_EXPORT
99   void setByThreePoints(double theX1, double theY1,
100                         double theX2, double theY2,
101                         double theX3, double theY3);
102
103   /// Set by three points.
104   SKETCHAPI_EXPORT
105   void setByThreePoints(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint1,
106                         const std::shared_ptr<GeomAPI_Pnt2d>& thePoint2,
107                         const std::shared_ptr<GeomAPI_Pnt2d>& thePoint3);
108
109   /// Set center point.
110   SKETCHAPI_EXPORT
111   void setCenterPoint(double theX, double theY);
112
113   /// Set center point.
114   SKETCHAPI_EXPORT
115   void setCenterPoint(const std::shared_ptr<GeomAPI_Pnt2d>& theCenterPoint);
116
117   /// Set passed point.
118   SKETCHAPI_EXPORT
119   void setPassedPoint(double theX, double theY);
120
121   /// Set passed point.
122   SKETCHAPI_EXPORT
123   void setPassedPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePassedPoint);
124
125   /// Set first point.
126   SKETCHAPI_EXPORT
127   void setFirstPoint(double theX, double theY);
128
129   /// Set first point.
130   SKETCHAPI_EXPORT
131   void setFirstPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
132
133   /// Set second point.
134   SKETCHAPI_EXPORT
135   void setSecondPoint(double theX, double theY);
136
137   /// Set second point.
138   SKETCHAPI_EXPORT
139   void setSecondPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
140
141   /// Set third point.
142   SKETCHAPI_EXPORT
143   void setThirdPoint(double theX, double theY);
144
145   /// Set third point.
146   SKETCHAPI_EXPORT
147   void setThirdPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
148 };
149
150 /// Pointer on Circle object.
151 typedef std::shared_ptr<SketchAPI_MacroCircle> MacroCirclePtr;
152
153 #endif // SketchAPI_MacroCircle_H_