1 // Copyright (C) 2014-2017 CEA/DEN, EDF R&D
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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef SketchAPI_Arc_H_
22 #define SketchAPI_Arc_H_
24 #include "SketchAPI.h"
25 #include "SketchAPI_SketchEntity.h"
27 #include <GeomDataAPI_Point2D.h>
29 #include <SketchPlugin_Arc.h>
31 class ModelHighAPI_RefAttr;
32 class ModelHighAPI_Selection;
34 /// \class SketchAPI_Arc
35 /// \ingroup CPPHighAPI
36 /// \brief Interface for Arc feature.
37 class SketchAPI_Arc: public SketchAPI_SketchEntity
40 /// Constructor without values.
42 explicit SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature);
44 /// Constructor with values.
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,
52 /// Constructor with values.
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,
60 /// Constructor with values.
62 SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
63 const ModelHighAPI_Selection& theExternal);
65 /// Constructor with values.
67 SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
68 const std::string& theExternalName);
72 virtual ~SketchAPI_Arc();
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 */)
90 /// Set by center and start, end point.
92 void setByCenterStartEnd(double theCenterX, double theCenterY,
93 double theStartX, double theStartY,
94 double theEndX, double theEndY,
97 /// Set by center and start, end point.
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,
106 void setByExternal(const ModelHighAPI_Selection& theExternal);
108 /// Set by external name.
110 void setByExternalName(const std::string& theExternalName);
112 /// Dump wrapped feature
114 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
117 /// Pointer on Arc object.
118 typedef std::shared_ptr<SketchAPI_Arc> ArcPtr;
120 #endif // SketchAPI_Arc_H_