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();
93 SketchPlugin_MacroArc::ID();
96 INTERFACE_12(SketchPlugin_MacroArc::ID(),
97 arcType, SketchPlugin_MacroArc::ARC_TYPE(),
98 ModelAPI_AttributeString, /** Arc type */,
99 center, SketchPlugin_MacroArc::CENTER_POINT_ID(),
100 GeomDataAPI_Point2D, /** Center point */,
101 startPoint1, SketchPlugin_MacroArc::START_POINT_1_ID(),
102 GeomDataAPI_Point2D, /** Start point */,
103 endPoint1, SketchPlugin_MacroArc::END_POINT_1_ID(),
104 GeomDataAPI_Point2D, /** End point */,
105 startPoint2, SketchPlugin_MacroArc::START_POINT_2_ID(),
106 GeomDataAPI_Point2D, /** Start point */,
107 endPoint2, SketchPlugin_MacroArc::END_POINT_2_ID(),
108 GeomDataAPI_Point2D, /** End point */,
109 passedPoint, SketchPlugin_MacroArc::PASSED_POINT_ID(),
110 GeomDataAPI_Point2D, /** Passed point */,
111 tangentPoint, SketchPlugin_MacroArc::TANGENT_POINT_ID(),
112 ModelAPI_AttributeRefAttr, /** Tangent point */,
113 endPoint3, SketchPlugin_MacroArc::END_POINT_3_ID(),
114 GeomDataAPI_Point2D, /** End point */,
115 reversed, SketchPlugin_MacroArc::REVERSED_ID(),
116 ModelAPI_AttributeBoolean, /** Reversed flag */,
117 radius, SketchPlugin_MacroArc::RADIUS_ID(),
118 ModelAPI_AttributeDouble, /** Radius */,
119 angle, SketchPlugin_MacroArc::ANGLE_ID(),
120 ModelAPI_AttributeDouble, /** Angle */)
124 /// Set by center and start, end point.
126 void setByCenterStartEnd(double theCenterX, double theCenterY,
127 double theStartX, double theStartY,
128 double theEndX, double theEndY,
131 /// Set by center and start, end point.
133 void setByCenterStartEnd(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
134 const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
135 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
138 /// Set by start, end and passed points.
140 void setByStartEndPassed(double theStartX, double theStartY,
141 double theEndX, double theEndY,
142 double thePassedX, double thePassedY);
144 /// Set by start, end and passed points.
146 void setByStartEndPassed(const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
147 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
148 const std::shared_ptr<GeomAPI_Pnt2d>& thePassed);
150 /// Set by tangent and end point.
152 void setByTangent(const ModelHighAPI_RefAttr& theTangentPoint,
153 double theEndX, double theEndY,
156 /// Set by tangent and end point.
158 void setByTangent(const ModelHighAPI_RefAttr& theTangentPoint,
159 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
163 /// Pointer on Arc object.
164 typedef std::shared_ptr<SketchAPI_MacroArc> MacroArcPtr;
166 #endif // SketchAPI_MacroArc_H_