SHAPER  9.12.0
SketchAPI_Arc.h
1 // Copyright (C) 2014-2023 CEA, EDF
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 email : webmaster.salome@opencascade.com
18 //
19 
20 #ifndef SketchAPI_Arc_H_
21 #define SketchAPI_Arc_H_
22 
23 #include "SketchAPI.h"
24 #include "SketchAPI_SketchEntity.h"
25 
26 #include <GeomDataAPI_Point2D.h>
27 
28 #include <SketchPlugin_Arc.h>
29 
32 
37 {
38 public:
40  SKETCHAPI_EXPORT
41  explicit SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature);
42 
44  SKETCHAPI_EXPORT
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,
49  bool theInversed);
50 
52  SKETCHAPI_EXPORT
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,
57  bool theInversed);
58 
60  SKETCHAPI_EXPORT
61  SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
62  const ModelHighAPI_Selection& theExternal);
63 
65  SKETCHAPI_EXPORT
66  SketchAPI_Arc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
67  const std::wstring& theExternalName);
68 
70  SKETCHAPI_EXPORT
71  virtual ~SketchAPI_Arc();
72 
73  INTERFACE_7(SketchPlugin_Arc::ID(),
88 
89 
90  SKETCHAPI_EXPORT
91  void setByCenterStartEnd(double theCenterX, double theCenterY,
92  double theStartX, double theStartY,
93  double theEndX, double theEndY,
94  bool theInversed);
95 
97  SKETCHAPI_EXPORT
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,
101  bool theInversed);
102 
104  SKETCHAPI_EXPORT
105  void setByExternal(const ModelHighAPI_Selection& theExternal);
106 
108  SKETCHAPI_EXPORT
109  void setByExternalName(const std::wstring& theExternalName);
110 
112  SKETCHAPI_EXPORT
113  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
114 };
115 
117 typedef std::shared_ptr<SketchAPI_Arc> ArcPtr;
118 
119 #endif // SketchAPI_Arc_H_
2D point defined by two coordinates
Definition: GeomAPI_Pnt2d.h:36
Attribute that contains 2D point coordinates.
Definition: GeomDataAPI_Point2D.h:37
Attribute that contains boolean value.
Definition: ModelAPI_AttributeBoolean.h:31
Attribute that contains real value with double precision.
Definition: ModelAPI_AttributeDouble.h:34
Attribute that contains reference to the sub-shape of some result, the selected shape.
Definition: ModelAPI_AttributeSelection.h:35
Dump engine for the model.
Definition: ModelHighAPI_Dumper.h:81
Class for filling ModelAPI_AttributeRefAttr.
Definition: ModelHighAPI_RefAttr.h:41
Class for filling ModelAPI_AttributeSelection.
Definition: ModelHighAPI_Selection.h:49
Interface for Arc feature.
Definition: SketchAPI_Arc.h:37
virtual std::shared_ptr< ModelAPI_AttributeDouble > radius() const
Radius.
Definition: SketchAPI_Arc.h:87
virtual std::shared_ptr< GeomDataAPI_Point2D > endPoint() const
End point.
Definition: SketchAPI_Arc.h:87
void setByCenterStartEnd(double theCenterX, double theCenterY, double theStartX, double theStartY, double theEndX, double theEndY, bool theInversed)
Set by center and start, end point.
Definition: SketchAPI_Arc.cpp:93
virtual std::shared_ptr< ModelAPI_AttributeDouble > angle() const
Angle.
Definition: SketchAPI_Arc.h:87
virtual std::shared_ptr< GeomDataAPI_Point2D > startPoint() const
Start point.
Definition: SketchAPI_Arc.h:87
void setByExternal(const ModelHighAPI_Selection &theExternal)
Set by external.
Definition: SketchAPI_Arc.cpp:121
virtual std::shared_ptr< GeomDataAPI_Point2D > center() const
Center point.
Definition: SketchAPI_Arc.h:87
virtual std::shared_ptr< ModelAPI_AttributeBoolean > reversed() const
Inversed flag.
Definition: SketchAPI_Arc.h:87
void setByExternalName(const std::wstring &theExternalName)
Set by external name.
Definition: SketchAPI_Arc.cpp:129
virtual std::shared_ptr< ModelAPI_AttributeSelection > external() const
External.
Definition: SketchAPI_Arc.h:87
SketchAPI_Arc(const std::shared_ptr< ModelAPI_Feature > &theFeature)
Constructor without values.
Definition: SketchAPI_Arc.cpp:33
virtual ~SketchAPI_Arc()
Destructor.
Definition: SketchAPI_Arc.cpp:87
virtual void dump(ModelHighAPI_Dumper &theDumper) const
Dump wrapped feature.
Definition: SketchAPI_Arc.cpp:137
Base class for Sketch feature interfaces.
Definition: SketchAPI_SketchEntity.h:38
static const std::string & RADIUS_ID()
Arc radius.
Definition: SketchPlugin_Arc.h:68
static const std::string & END_ID()
End 2D point of the arc.
Definition: SketchPlugin_Arc.h:61
static const std::string & REVERSED_ID()
Reversed flag.
Definition: SketchPlugin_Arc.h:82
static const std::string & ANGLE_ID()
Arc angle.
Definition: SketchPlugin_Arc.h:75
static const std::string & CENTER_ID()
Central 2D point of the circle which contains the arc.
Definition: SketchPlugin_Arc.h:47
static const std::string & START_ID()
Start 2D point of the arc.
Definition: SketchPlugin_Arc.h:54
static const std::string & ID()
Arc feature kind.
Definition: SketchPlugin_Arc.h:40
static const std::string & EXTERNAL_ID()
Reference to the external edge or vertex as a AttributeSelection.
Definition: SketchPlugin_SketchEntity.h:55