Salome HOME
Fix tests using unittest (failed cases were not reported by ctest).
[modules/shaper.git] / src / SketchAPI / SketchAPI_Arc.h
1 // Copyright (C) 2014-2017  CEA/DEN, EDF R&D
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 //
20
21 #ifndef SketchAPI_Arc_H_
22 #define SketchAPI_Arc_H_
23
24 #include "SketchAPI.h"
25 #include "SketchAPI_SketchEntity.h"
26
27 #include <GeomDataAPI_Point2D.h>
28
29 #include <SketchPlugin_Arc.h>
30
31 class ModelHighAPI_RefAttr;
32 class ModelHighAPI_Selection;
33
34 /// \class SketchAPI_Arc
35 /// \ingroup CPPHighAPI
36 /// \brief Interface for Arc feature.
37 class SketchAPI_Arc: public SketchAPI_SketchEntity
38 {
39 public:
40   /// Constructor without values.
41   SKETCHAPI_EXPORT
42   explicit SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature);
43
44   /// Constructor with values.
45   SKETCHAPI_EXPORT
46   SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
47                 double theCenterX, double theCenterY,
48                 double theStartX, double theStartY,
49                 double theEndX, double theEndY,
50                 bool theInversed);
51
52   /// Constructor with values.
53   SKETCHAPI_EXPORT
54   SketchAPI_Arc(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,
58                 bool theInversed);
59
60   /// Constructor with values.
61   SKETCHAPI_EXPORT
62   SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
63                 const ModelHighAPI_Selection& theExternal);
64
65   /// Constructor with values.
66   SKETCHAPI_EXPORT
67   SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
68                 const std::string& theExternalName);
69
70   /// Destructor.
71   SKETCHAPI_EXPORT
72   virtual ~SketchAPI_Arc();
73
74   INTERFACE_7(SketchPlugin_Arc::ID(),
75                center, SketchPlugin_Arc::CENTER_ID(),
76                GeomDataAPI_Point2D, /** Center point */,
77                startPoint, SketchPlugin_Arc::START_ID(),
78                GeomDataAPI_Point2D, /** Start point */,
79                endPoint, SketchPlugin_Arc::END_ID(),
80                GeomDataAPI_Point2D, /** End point */,
81                reversed, SketchPlugin_Arc::REVERSED_ID(),
82                ModelAPI_AttributeBoolean, /** Inversed flag */,
83                radius, SketchPlugin_Arc::RADIUS_ID(),
84                ModelAPI_AttributeDouble, /** Radius */,
85                angle, SketchPlugin_Arc::ANGLE_ID(),
86                ModelAPI_AttributeDouble, /** Angle */,
87                external, SketchPlugin_Arc::EXTERNAL_ID(),
88                ModelAPI_AttributeSelection, /** External */)
89
90   /// Set by center and start, end point.
91   SKETCHAPI_EXPORT
92   void setByCenterStartEnd(double theCenterX, double theCenterY,
93                            double theStartX, double theStartY,
94                            double theEndX, double theEndY,
95                            bool theInversed);
96
97   /// Set by center and start, end point.
98   SKETCHAPI_EXPORT
99   void setByCenterStartEnd(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
100                            const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
101                            const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
102                            bool theInversed);
103
104   /// Set by external.
105   SKETCHAPI_EXPORT
106   void setByExternal(const ModelHighAPI_Selection& theExternal);
107
108   /// Set by external name.
109   SKETCHAPI_EXPORT
110   void setByExternalName(const std::string& theExternalName);
111
112   /// Dump wrapped feature
113   SKETCHAPI_EXPORT
114   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
115 };
116
117 /// Pointer on Arc object.
118 typedef std::shared_ptr<SketchAPI_Arc> ArcPtr;
119
120 #endif // SketchAPI_Arc_H_