1 // Copyright (C) 2014-2023 CEA, EDF
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 email : webmaster.salome@opencascade.com
20 #ifndef SketchAPI_Arc_H_
21 #define SketchAPI_Arc_H_
23 #include "SketchAPI.h"
24 #include "SketchAPI_SketchEntity.h"
26 #include <GeomDataAPI_Point2D.h>
28 #include <SketchPlugin_Arc.h>
30 class ModelHighAPI_RefAttr;
31 class ModelHighAPI_Selection;
33 /// \class SketchAPI_Arc
34 /// \ingroup CPPHighAPI
35 /// \brief Interface for Arc feature.
36 class SketchAPI_Arc: public SketchAPI_SketchEntity
39 /// Constructor without values.
41 explicit SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature);
43 /// Constructor with values.
45 SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
46 double theCenterX, double theCenterY,
47 double theStartX, double theStartY,
48 double theEndX, double theEndY,
51 /// Constructor with values.
53 SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
54 const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
55 const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
56 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
59 /// Constructor with values.
61 SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
62 const ModelHighAPI_Selection& theExternal);
64 /// Constructor with values.
66 SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
67 const std::wstring& theExternalName);
71 virtual ~SketchAPI_Arc();
73 INTERFACE_7(SketchPlugin_Arc::ID(),
74 center, SketchPlugin_Arc::CENTER_ID(),
75 GeomDataAPI_Point2D, /** Center point */,
76 startPoint, SketchPlugin_Arc::START_ID(),
77 GeomDataAPI_Point2D, /** Start point */,
78 endPoint, SketchPlugin_Arc::END_ID(),
79 GeomDataAPI_Point2D, /** End point */,
80 reversed, SketchPlugin_Arc::REVERSED_ID(),
81 ModelAPI_AttributeBoolean, /** Inversed flag */,
82 radius, SketchPlugin_Arc::RADIUS_ID(),
83 ModelAPI_AttributeDouble, /** Radius */,
84 angle, SketchPlugin_Arc::ANGLE_ID(),
85 ModelAPI_AttributeDouble, /** Angle */,
86 external, SketchPlugin_Arc::EXTERNAL_ID(),
87 ModelAPI_AttributeSelection, /** External */)
89 /// Set by center and start, end point.
91 void setByCenterStartEnd(double theCenterX, double theCenterY,
92 double theStartX, double theStartY,
93 double theEndX, double theEndY,
96 /// Set by center and start, end point.
98 void setByCenterStartEnd(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
99 const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
100 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
105 void setByExternal(const ModelHighAPI_Selection& theExternal);
107 /// Set by external name.
109 void setByExternalName(const std::wstring& theExternalName);
111 /// Dump wrapped feature
113 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
116 /// Pointer on Arc object.
117 typedef std::shared_ptr<SketchAPI_Arc> ArcPtr;
119 #endif // SketchAPI_Arc_H_