1 // Copyright (C) 2014-2024 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_MacroCircle_H_
21 #define SketchAPI_MacroCircle_H_
23 #include "SketchAPI.h"
24 #include "SketchAPI_SketchEntity.h"
26 #include <SketchPlugin_MacroCircle.h>
28 class ModelHighAPI_Selection;
30 /// \class SketchAPI_MacroCircle
31 /// \ingroup CPPHighAPI
32 /// \brief Interface for Circle feature.
33 class SketchAPI_MacroCircle: public SketchAPI_SketchEntity
36 /// Constructor without values.
38 explicit SketchAPI_MacroCircle(const std::shared_ptr<ModelAPI_Feature>& theFeature);
40 /// Constructor with values.
42 SketchAPI_MacroCircle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
47 bool theIsToAddPoint = false,
48 double theAngle = 0.0);
50 /// Constructor with values.
52 SketchAPI_MacroCircle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
53 const std::shared_ptr<GeomAPI_Pnt2d>& theCenterPoint,
54 const std::shared_ptr<GeomAPI_Pnt2d>& thePassedPoint,
55 bool theIsToAddPoint = false,
56 double theAngle = 0.0);
58 /// Constructor with values.
60 SketchAPI_MacroCircle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
61 double theX1, double theY1,
62 double theX2, double theY2,
63 double theX3, double theY3,
64 bool theIsToAddPoint = false,
65 double theAngle = 0.0);
67 /// Constructor with values.
69 SketchAPI_MacroCircle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
70 const std::shared_ptr<GeomAPI_Pnt2d>& thePoint1,
71 const std::shared_ptr<GeomAPI_Pnt2d>& thePoint2,
72 const std::shared_ptr<GeomAPI_Pnt2d>& thePoint3,
73 bool theIsToAddPoint = false,
74 double theAngle = 0.0);
78 virtual ~SketchAPI_MacroCircle();
80 INTERFACE_8(SketchPlugin_MacroCircle::ID(),
81 circleType, SketchPlugin_MacroCircle::CIRCLE_TYPE(),
82 ModelAPI_AttributeString, /** Circle type */,
83 centerPoint, SketchPlugin_MacroCircle::CENTER_POINT_ID(),
84 GeomDataAPI_Point2D, /** Center point */,
85 passedPoint, SketchPlugin_MacroCircle::PASSED_POINT_ID(),
86 GeomDataAPI_Point2D, /** Passed point */,
87 firstPoint, SketchPlugin_MacroCircle::FIRST_POINT_ID(),
88 GeomDataAPI_Point2D, /** First point */,
89 secondPoint, SketchPlugin_MacroCircle::SECOND_POINT_ID(),
90 GeomDataAPI_Point2D, /** Second point */,
91 thirdPoint, SketchPlugin_MacroCircle::THIRD_POINT_ID(),
92 GeomDataAPI_Point2D, /** Third point */,
93 angle, SketchPlugin_MacroCircle::CIRCLE_ROTATE_ANGLE_ID(),
94 ModelAPI_AttributeDouble, /** Angle */,
95 addpoint, SketchPlugin_MacroCircle::ADD_CONSTRUCTION_POINT_ID(),
96 ModelAPI_AttributeBoolean, /** Is to add point */)
99 /// Set by center and passed points.
100 void setByCenterAndPassedPoints(double theCenterX, double theCenterY,
101 double thePassedX, double thePassedY,
102 bool theIsToAddPoint = false,
103 double theAngle = 0.0);
105 /// Set by center and passed points.
106 void setByCenterAndPassedPoints(const std::shared_ptr<GeomAPI_Pnt2d>& theCenterPoint,
107 const std::shared_ptr<GeomAPI_Pnt2d>& thePassedPoint,
108 bool theIsToAddPoint = false,
109 double theAngle = 0.0);
111 /// Set by three points.
112 void setByThreePoints(double theX1, double theY1,
113 double theX2, double theY2,
114 double theX3, double theY3,
115 bool theIsToAddPoint = false,
116 double theAngle = 0.0);
118 /// Set by three points.
119 void setByThreePoints(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint1,
120 const std::shared_ptr<GeomAPI_Pnt2d>& thePoint2,
121 const std::shared_ptr<GeomAPI_Pnt2d>& thePoint3,
122 bool theIsToAddPoint = false,
123 double theAngle = 0.0);
126 /// Pointer on Circle object.
127 typedef std::shared_ptr<SketchAPI_MacroCircle> MacroCirclePtr;
129 #endif // SketchAPI_MacroCircle_H_