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 const ModelHighAPI_Selection& theExternal);
51 /// Constructor with values.
53 SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
54 const std::string& theExternalName);
58 virtual ~SketchAPI_Arc();
60 INTERFACE_7(SketchPlugin_Arc::ID(),
61 center, SketchPlugin_Arc::CENTER_ID(),
62 GeomDataAPI_Point2D, /** Center point */,
63 startPoint, SketchPlugin_Arc::START_ID(),
64 GeomDataAPI_Point2D, /** Start point */,
65 endPoint, SketchPlugin_Arc::END_ID(),
66 GeomDataAPI_Point2D, /** End point */,
67 reversed, SketchPlugin_Arc::REVERSED_ID(),
68 ModelAPI_AttributeBoolean, /** Inversed flag */,
69 radius, SketchPlugin_Arc::RADIUS_ID(),
70 ModelAPI_AttributeDouble, /** Radius */,
71 angle, SketchPlugin_Arc::ANGLE_ID(),
72 ModelAPI_AttributeDouble, /** Angle */,
73 external, SketchPlugin_Arc::EXTERNAL_ID(),
74 ModelAPI_AttributeSelection, /** External */)
76 /// Set by center and start, end point.
78 void setByCenterStartEnd(double theCenterX, double theCenterY,
79 double theStartX, double theStartY,
80 double theEndX, double theEndY,
83 /// Set by center and start, end point.
85 void setByCenterStartEnd(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
86 const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
87 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
92 void setByExternal(const ModelHighAPI_Selection& theExternal);
94 /// Set by external name.
96 void setByExternalName(const std::string& theExternalName);
98 /// Dump wrapped feature
100 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
103 /// Pointer on Arc object.
104 typedef std::shared_ptr<SketchAPI_Arc> ArcPtr;
106 #endif // SketchAPI_Arc_H_