Salome HOME
Merge branch 'master' into cgt/devCEA
[modules/shaper.git] / src / SketchAPI / SketchAPI_Arc.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        SketchAPI_Arc.h
4 // Created:     09 June 2016
5 // Author:      Dmitry Bobylev
6
7 #ifndef SketchAPI_Arc_H_
8 #define SketchAPI_Arc_H_
9
10 #include "SketchAPI.h"
11 #include "SketchAPI_SketchEntity.h"
12
13 #include <GeomDataAPI_Point2D.h>
14
15 #include <SketchPlugin_Arc.h>
16
17 class ModelHighAPI_RefAttr;
18 class ModelHighAPI_Selection;
19
20 /// \class SketchAPI_Arc
21 /// \ingroup CPPHighAPI
22 /// \brief Interface for Arc feature.
23 class SketchAPI_Arc: public SketchAPI_SketchEntity
24 {
25 public:
26   /// Constructor without values.
27   SKETCHAPI_EXPORT
28   explicit SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature);
29
30   /// Constructor with values.
31   SKETCHAPI_EXPORT
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,
36                 bool theInversed);
37
38   /// Constructor with values.
39   SKETCHAPI_EXPORT
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,
44                 bool theInversed);
45
46   /// Constructor with values.
47   SKETCHAPI_EXPORT
48   SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
49                 const ModelHighAPI_Selection& theExternal);
50
51   /// Constructor with values.
52   SKETCHAPI_EXPORT
53   SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
54                 const std::string& theExternalName);
55
56   /// Destructor.
57   SKETCHAPI_EXPORT
58   virtual ~SketchAPI_Arc();
59
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 */)
75
76   /// Set by center and start, end point.
77   SKETCHAPI_EXPORT
78   void setByCenterStartEnd(double theCenterX, double theCenterY,
79                            double theStartX, double theStartY,
80                            double theEndX, double theEndY,
81                            bool theInversed);
82
83   /// Set by center and start, end point.
84   SKETCHAPI_EXPORT
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,
88                            bool theInversed);
89
90   /// Set by external.
91   SKETCHAPI_EXPORT
92   void setByExternal(const ModelHighAPI_Selection& theExternal);
93
94   /// Set by external name.
95   SKETCHAPI_EXPORT
96   void setByExternalName(const std::string& theExternalName);
97
98   /// Dump wrapped feature
99   SKETCHAPI_EXPORT
100   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
101 };
102
103 /// Pointer on Arc object.
104 typedef std::shared_ptr<SketchAPI_Arc> ArcPtr;
105
106 #endif // SketchAPI_Arc_H_