1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: SketchAPI_Arc.h
4 // Created: 09 June 2016
5 // Author: Dmitry Bobylev
7 #ifndef SketchAPI_Arc_H_
8 #define SketchAPI_Arc_H_
10 #include "SketchAPI.h"
11 #include "SketchAPI_SketchEntity.h"
13 #include <GeomDataAPI_Point2D.h>
15 #include <SketchPlugin_Arc.h>
17 class ModelHighAPI_RefAttr;
18 class ModelHighAPI_Selection;
20 /// \class SketchAPI_Arc
21 /// \ingroup CPPHighAPI
22 /// \brief Interface for Arc feature.
23 class SketchAPI_Arc: public SketchAPI_SketchEntity
26 /// Constructor without values.
28 explicit SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature);
30 /// Constructor with values.
32 SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
33 double theCenterX, double theCenterY,
34 double theStartX, double theStartY,
35 double theEndX, double theEndY,
38 /// Constructor with values.
40 SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
41 const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
42 const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
43 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
46 /// Constructor with values.
48 SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
49 double theStartX, double theStartY,
50 double theEndX, double theEndY,
51 double thePassedX, double thePassedY);
53 /// Constructor with values.
55 SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
56 const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
57 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
58 const std::shared_ptr<GeomAPI_Pnt2d>& thePassed);
60 /// Constructor with values.
62 SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
63 const ModelHighAPI_RefAttr& theTangentPoint,
64 double theEndX, double theEndY,
67 /// Constructor with values.
69 SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
70 const ModelHighAPI_RefAttr& theTangentPoint,
71 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
74 /// Constructor with values.
76 SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
77 const ModelHighAPI_Selection& theExternal);
79 /// Constructor with values.
81 SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
82 const std::string& theExternalName);
86 virtual ~SketchAPI_Arc();
88 INTERFACE_10(SketchPlugin_Arc::ID(),
89 arcType, SketchPlugin_Arc::ARC_TYPE(),
90 ModelAPI_AttributeString, /** Arc type */,
91 center, SketchPlugin_Arc::CENTER_ID(),
92 GeomDataAPI_Point2D, /** Center point */,
93 startPoint, SketchPlugin_Arc::START_ID(),
94 GeomDataAPI_Point2D, /** Start point */,
95 endPoint, SketchPlugin_Arc::END_ID(),
96 GeomDataAPI_Point2D, /** End point */,
97 inversed, SketchPlugin_Arc::INVERSED_ID(),
98 ModelAPI_AttributeBoolean, /** Inversed flag */,
99 passedPoint, SketchPlugin_Arc::PASSED_POINT_ID(),
100 GeomDataAPI_Point2D, /** Passed point */,
101 tangentPoint, SketchPlugin_Arc::TANGENT_POINT_ID(),
102 ModelAPI_AttributeRefAttr, /** Tangent point */,
103 radius, SketchPlugin_Arc::RADIUS_ID(),
104 ModelAPI_AttributeDouble, /** Radius */,
105 angle, SketchPlugin_Arc::ANGLE_ID(),
106 ModelAPI_AttributeDouble, /** Angle */,
107 external, SketchPlugin_Arc::EXTERNAL_ID(),
108 ModelAPI_AttributeSelection, /** External */)
110 /// Set by center and start, end point.
112 void setByCenterStartEnd(double theCenterX, double theCenterY,
113 double theStartX, double theStartY,
114 double theEndX, double theEndY,
117 /// Set by center and start, end point.
119 void setByCenterStartEnd(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
120 const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
121 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
124 /// Set by start, end and passed points.
126 void setByStartEndPassed(double theStartX, double theStartY,
127 double theEndX, double theEndY,
128 double thePassedX, double thePassedY);
130 /// Set by start, end and passed points.
132 void setByStartEndPassed(const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
133 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
134 const std::shared_ptr<GeomAPI_Pnt2d>& thePassed);
136 /// Set by tangent and end point.
138 void setByTangent(const ModelHighAPI_RefAttr& theTangentPoint,
139 double theEndX, double theEndY,
142 /// Set by tangent and end point.
144 void setByTangent(const ModelHighAPI_RefAttr& theTangentPoint,
145 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
150 void setByExternal(const ModelHighAPI_Selection& theExternal);
152 /// Set by external name.
154 void setByExternalName(const std::string& theExternalName);
158 void setRadius(double theRadius);
162 void setAngle(double theAngle);
164 /// Dump wrapped feature
166 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
169 /// Pointer on Arc object.
170 typedef std::shared_ptr<SketchAPI_Arc> ArcPtr;
172 #endif // SketchAPI_Arc_H_