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_MacroArc_H_
21 #define SketchAPI_MacroArc_H_
23 #include "SketchAPI.h"
24 #include "SketchAPI_SketchEntity.h"
26 #include <GeomDataAPI_Point2D.h>
28 #include <SketchPlugin_MacroArc.h>
30 class ModelHighAPI_RefAttr;
31 class ModelHighAPI_Selection;
33 /// \class SketchAPI_MacroArc
34 /// \ingroup CPPHighAPI
35 /// \brief Interface for Arc feature.
36 class SketchAPI_MacroArc: public SketchAPI_SketchEntity
39 /// Constructor without values.
41 explicit SketchAPI_MacroArc(const std::shared_ptr<ModelAPI_Feature>& theFeature);
43 /// Constructor with values.
45 SketchAPI_MacroArc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
46 double theCenterX, double theCenterY,
47 double theStartX, double theStartY,
48 double theEndX, double theEndY,
51 /// Constructor with values.
53 SketchAPI_MacroArc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
54 const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
55 const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
56 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
59 /// Constructor with values.
61 SketchAPI_MacroArc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
62 double theStartX, double theStartY,
63 double theEndX, double theEndY,
64 double thePassedX, double thePassedY);
66 /// Constructor with values.
68 SketchAPI_MacroArc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
69 const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
70 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
71 const std::shared_ptr<GeomAPI_Pnt2d>& thePassed);
73 /// Constructor with values.
75 SketchAPI_MacroArc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
76 const ModelHighAPI_RefAttr& theTangentPoint,
77 double theEndX, double theEndY,
80 /// Constructor with values.
82 SketchAPI_MacroArc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
83 const ModelHighAPI_RefAttr& theTangentPoint,
84 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
89 virtual ~SketchAPI_MacroArc();
91 INTERFACE_14(SketchPlugin_MacroArc::ID(),
92 arcType, SketchPlugin_MacroArc::ARC_TYPE(),
93 ModelAPI_AttributeString, /** Arc type */,
94 center, SketchPlugin_MacroArc::CENTER_POINT_ID(),
95 GeomDataAPI_Point2D, /** Center point */,
96 startPoint1, SketchPlugin_MacroArc::START_POINT_1_ID(),
97 GeomDataAPI_Point2D, /** Start point */,
98 endPoint1, SketchPlugin_MacroArc::END_POINT_1_ID(),
99 GeomDataAPI_Point2D, /** End point */,
100 startPoint2, SketchPlugin_MacroArc::START_POINT_2_ID(),
101 GeomDataAPI_Point2D, /** Start point */,
102 endPoint2, SketchPlugin_MacroArc::END_POINT_2_ID(),
103 GeomDataAPI_Point2D, /** End point */,
104 passedPoint, SketchPlugin_MacroArc::PASSED_POINT_ID(),
105 GeomDataAPI_Point2D, /** Passed point */,
106 tangentPoint, SketchPlugin_MacroArc::TANGENT_POINT_ID(),
107 ModelAPI_AttributeRefAttr, /** Tangent point */,
108 endPoint3, SketchPlugin_MacroArc::END_POINT_3_ID(),
109 GeomDataAPI_Point2D, /** End point */,
110 transversalPoint, SketchPlugin_MacroArc::TRANSVERSAL_POINT_ID(),
111 ModelAPI_AttributeRefAttr, /** Transversal point */,
112 endPoint4, SketchPlugin_MacroArc::END_POINT_4_ID(),
113 GeomDataAPI_Point2D, /** End point */,
114 reversed, SketchPlugin_MacroArc::REVERSED_ID(),
115 ModelAPI_AttributeBoolean, /** Reversed flag */,
116 radius, SketchPlugin_MacroArc::RADIUS_ID(),
117 ModelAPI_AttributeDouble, /** Radius */,
118 angle, SketchPlugin_MacroArc::ANGLE_ID(),
119 ModelAPI_AttributeDouble, /** Angle */)
121 /// Set by center and start, end point.
123 void setByCenterStartEnd(double theCenterX, double theCenterY,
124 double theStartX, double theStartY,
125 double theEndX, double theEndY,
128 /// Set by center and start, end point.
130 void setByCenterStartEnd(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
131 const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
132 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
135 /// Set by start, end and passed points.
137 void setByStartEndPassed(double theStartX, double theStartY,
138 double theEndX, double theEndY,
139 double thePassedX, double thePassedY);
141 /// Set by start, end and passed points.
143 void setByStartEndPassed(const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
144 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
145 const std::shared_ptr<GeomAPI_Pnt2d>& thePassed);
147 /// Set by tangent and end point.
149 void setByTangent(const ModelHighAPI_RefAttr& theTangentPoint,
150 double theEndX, double theEndY,
153 /// Set by tangent and end point.
155 void setByTangent(const ModelHighAPI_RefAttr& theTangentPoint,
156 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
159 /// Set by tangent and end point.
161 void setByTransversal(const ModelHighAPI_RefAttr& theTransversalPoint,
162 double theEndX, double theEndY,
165 /// Set by tangent and end point.
167 void setByTransversal(const ModelHighAPI_RefAttr& theTransversalPoint,
168 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
172 /// Pointer on Arc object.
173 typedef std::shared_ptr<SketchAPI_MacroArc> MacroArcPtr;
175 #endif // SketchAPI_MacroArc_H_