1 // Copyright (C) 2014-2019 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_12(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 reversed, SketchPlugin_MacroArc::REVERSED_ID(),
111 ModelAPI_AttributeBoolean, /** Reversed flag */,
112 radius, SketchPlugin_MacroArc::RADIUS_ID(),
113 ModelAPI_AttributeDouble, /** Radius */,
114 angle, SketchPlugin_MacroArc::ANGLE_ID(),
115 ModelAPI_AttributeDouble, /** Angle */)
119 /// Set by center and start, end point.
121 void setByCenterStartEnd(double theCenterX, double theCenterY,
122 double theStartX, double theStartY,
123 double theEndX, double theEndY,
126 /// Set by center and start, end point.
128 void setByCenterStartEnd(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
129 const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
130 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
133 /// Set by start, end and passed points.
135 void setByStartEndPassed(double theStartX, double theStartY,
136 double theEndX, double theEndY,
137 double thePassedX, double thePassedY);
139 /// Set by start, end and passed points.
141 void setByStartEndPassed(const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
142 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
143 const std::shared_ptr<GeomAPI_Pnt2d>& thePassed);
145 /// Set by tangent and end point.
147 void setByTangent(const ModelHighAPI_RefAttr& theTangentPoint,
148 double theEndX, double theEndY,
151 /// Set by tangent and end point.
153 void setByTangent(const ModelHighAPI_RefAttr& theTangentPoint,
154 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
158 /// Pointer on Arc object.
159 typedef std::shared_ptr<SketchAPI_MacroArc> MacroArcPtr;
161 #endif // SketchAPI_MacroArc_H_