1 // Copyright (C) 2014-2017 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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef SketchAPI_MacroArc_H_
22 #define SketchAPI_MacroArc_H_
24 #include "SketchAPI.h"
25 #include "SketchAPI_SketchEntity.h"
27 #include <GeomDataAPI_Point2D.h>
29 #include <SketchPlugin_MacroArc.h>
31 class ModelHighAPI_RefAttr;
32 class ModelHighAPI_Selection;
34 /// \class SketchAPI_MacroArc
35 /// \ingroup CPPHighAPI
36 /// \brief Interface for Arc feature.
37 class SketchAPI_MacroArc: public SketchAPI_SketchEntity
40 /// Constructor without values.
42 explicit SketchAPI_MacroArc(const std::shared_ptr<ModelAPI_Feature>& theFeature);
44 /// Constructor with values.
46 SketchAPI_MacroArc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
47 double theCenterX, double theCenterY,
48 double theStartX, double theStartY,
49 double theEndX, double theEndY,
52 /// Constructor with values.
54 SketchAPI_MacroArc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
55 const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
56 const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
57 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
60 /// Constructor with values.
62 SketchAPI_MacroArc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
63 double theStartX, double theStartY,
64 double theEndX, double theEndY,
65 double thePassedX, double thePassedY);
67 /// Constructor with values.
69 SketchAPI_MacroArc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
70 const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
71 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
72 const std::shared_ptr<GeomAPI_Pnt2d>& thePassed);
74 /// Constructor with values.
76 SketchAPI_MacroArc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
77 const ModelHighAPI_RefAttr& theTangentPoint,
78 double theEndX, double theEndY,
81 /// Constructor with values.
83 SketchAPI_MacroArc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
84 const ModelHighAPI_RefAttr& theTangentPoint,
85 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
90 virtual ~SketchAPI_MacroArc();
92 INTERFACE_12(SketchPlugin_MacroArc::ID(),
93 arcType, SketchPlugin_MacroArc::ARC_TYPE(),
94 ModelAPI_AttributeString, /** Arc type */,
95 center, SketchPlugin_MacroArc::CENTER_POINT_ID(),
96 GeomDataAPI_Point2D, /** Center point */,
97 startPoint1, SketchPlugin_MacroArc::START_POINT_1_ID(),
98 GeomDataAPI_Point2D, /** Start point */,
99 endPoint1, SketchPlugin_MacroArc::END_POINT_1_ID(),
100 GeomDataAPI_Point2D, /** End point */,
101 startPoint2, SketchPlugin_MacroArc::START_POINT_2_ID(),
102 GeomDataAPI_Point2D, /** Start point */,
103 endPoint2, SketchPlugin_MacroArc::END_POINT_2_ID(),
104 GeomDataAPI_Point2D, /** End point */,
105 passedPoint, SketchPlugin_MacroArc::PASSED_POINT_ID(),
106 GeomDataAPI_Point2D, /** Passed point */,
107 tangentPoint, SketchPlugin_MacroArc::TANGENT_POINT_ID(),
108 ModelAPI_AttributeRefAttr, /** Tangent point */,
109 endPoint3, SketchPlugin_MacroArc::END_POINT_3_ID(),
110 GeomDataAPI_Point2D, /** End point */,
111 reversed, SketchPlugin_MacroArc::REVERSED_ID(),
112 ModelAPI_AttributeBoolean, /** Reversed flag */,
113 radius, SketchPlugin_MacroArc::RADIUS_ID(),
114 ModelAPI_AttributeDouble, /** Radius */,
115 angle, SketchPlugin_MacroArc::ANGLE_ID(),
116 ModelAPI_AttributeDouble, /** Angle */)
120 /// Set by center and start, end point.
122 void setByCenterStartEnd(double theCenterX, double theCenterY,
123 double theStartX, double theStartY,
124 double theEndX, double theEndY,
127 /// Set by center and start, end point.
129 void setByCenterStartEnd(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
130 const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
131 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
134 /// Set by start, end and passed points.
136 void setByStartEndPassed(double theStartX, double theStartY,
137 double theEndX, double theEndY,
138 double thePassedX, double thePassedY);
140 /// Set by start, end and passed points.
142 void setByStartEndPassed(const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
143 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
144 const std::shared_ptr<GeomAPI_Pnt2d>& thePassed);
146 /// Set by tangent and end point.
148 void setByTangent(const ModelHighAPI_RefAttr& theTangentPoint,
149 double theEndX, double theEndY,
152 /// Set by tangent and end point.
154 void setByTangent(const ModelHighAPI_RefAttr& theTangentPoint,
155 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
159 /// Pointer on Arc object.
160 typedef std::shared_ptr<SketchAPI_MacroArc> MacroArcPtr;
162 #endif // SketchAPI_MacroArc_H_