SHAPER  9.15.0
SketchAPI_MacroArc.h
1 // Copyright (C) 2014-2025 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_MacroArc_H_
21 #define SketchAPI_MacroArc_H_
22 
23 #include "SketchAPI.h"
24 #include "SketchAPI_SketchEntity.h"
25 
26 #include <GeomDataAPI_Point2D.h>
27 
28 #include <SketchPlugin_MacroArc.h>
29 
32 
37 {
38 public:
40  SKETCHAPI_EXPORT
41  explicit SketchAPI_MacroArc(const std::shared_ptr<ModelAPI_Feature>& theFeature);
42 
44  SKETCHAPI_EXPORT
45  SketchAPI_MacroArc(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_MacroArc(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_MacroArc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
62  double theStartX, double theStartY,
63  double theEndX, double theEndY,
64  double thePassedX, double thePassedY);
65 
67  SKETCHAPI_EXPORT
68  SketchAPI_MacroArc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
69  const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
70  const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
71  const std::shared_ptr<GeomAPI_Pnt2d>& thePassed);
72 
74  SKETCHAPI_EXPORT
75  SketchAPI_MacroArc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
76  const ModelHighAPI_RefAttr& theTangentPoint,
77  double theEndX, double theEndY,
78  bool theInversed);
79 
81  SKETCHAPI_EXPORT
82  SketchAPI_MacroArc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
83  const ModelHighAPI_RefAttr& theTangentPoint,
84  const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
85  bool theInversed);
86 
88  SKETCHAPI_EXPORT
89  virtual ~SketchAPI_MacroArc();
90 
91  INTERFACE_14(SketchPlugin_MacroArc::ID(),
92  arcType, SketchPlugin_MacroArc::ARC_TYPE(),
106  tangentPoint, SketchPlugin_MacroArc::TANGENT_POINT_ID(),
110  transversalPoint, SketchPlugin_MacroArc::TRANSVERSAL_POINT_ID(),
120 
121 
122  SKETCHAPI_EXPORT
123  void setByCenterStartEnd(double theCenterX, double theCenterY,
124  double theStartX, double theStartY,
125  double theEndX, double theEndY,
126  bool theInversed);
127 
129  SKETCHAPI_EXPORT
130  void setByCenterStartEnd(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
131  const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
132  const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
133  bool theInversed);
134 
136  SKETCHAPI_EXPORT
137  void setByStartEndPassed(double theStartX, double theStartY,
138  double theEndX, double theEndY,
139  double thePassedX, double thePassedY);
140 
142  SKETCHAPI_EXPORT
143  void setByStartEndPassed(const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
144  const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
145  const std::shared_ptr<GeomAPI_Pnt2d>& thePassed);
146 
148  SKETCHAPI_EXPORT
149  void setByTangent(const ModelHighAPI_RefAttr& theTangentPoint,
150  double theEndX, double theEndY,
151  bool theInversed);
152 
154  SKETCHAPI_EXPORT
155  void setByTangent(const ModelHighAPI_RefAttr& theTangentPoint,
156  const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
157  bool theInversed);
158 
160  SKETCHAPI_EXPORT
161  void setByTransversal(const ModelHighAPI_RefAttr& theTransversalPoint,
162  double theEndX, double theEndY,
163  bool theInversed);
164 
166  SKETCHAPI_EXPORT
167  void setByTransversal(const ModelHighAPI_RefAttr& theTransversalPoint,
168  const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
169  bool theInversed);
170 };
171 
173 typedef std::shared_ptr<SketchAPI_MacroArc> MacroArcPtr;
174 
175 #endif // SketchAPI_MacroArc_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 an attribute of a feature or reference to a feature (switchable)
Definition: ModelAPI_AttributeRefAttr.h:33
API for the attribute that contains std (null terminated) string.
Definition: ModelAPI_AttributeString.h:33
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_MacroArc.h:37
void setByTangent(const ModelHighAPI_RefAttr &theTangentPoint, double theEndX, double theEndY, bool theInversed)
Set by tangent and end point.
Definition: SketchAPI_MacroArc.cpp:177
virtual std::shared_ptr< ModelAPI_AttributeBoolean > reversed() const
Reversed flag.
Definition: SketchAPI_MacroArc.h:119
virtual std::shared_ptr< GeomDataAPI_Point2D > startPoint1() const
Start point.
Definition: SketchAPI_MacroArc.h:119
virtual std::shared_ptr< GeomDataAPI_Point2D > endPoint1() const
End point.
Definition: SketchAPI_MacroArc.h:119
virtual std::shared_ptr< ModelAPI_AttributeRefAttr > tangentPoint() const
Tangent point.
Definition: SketchAPI_MacroArc.h:119
virtual std::shared_ptr< GeomDataAPI_Point2D > passedPoint() const
Passed point.
Definition: SketchAPI_MacroArc.h:119
virtual std::shared_ptr< GeomDataAPI_Point2D > center() const
Center point.
Definition: SketchAPI_MacroArc.h:119
virtual std::shared_ptr< ModelAPI_AttributeString > arcType() const
Arc type.
Definition: SketchAPI_MacroArc.h:119
virtual std::shared_ptr< GeomDataAPI_Point2D > endPoint2() const
End point.
Definition: SketchAPI_MacroArc.h:119
virtual std::shared_ptr< GeomDataAPI_Point2D > endPoint3() const
End point.
Definition: SketchAPI_MacroArc.h:119
void setByTransversal(const ModelHighAPI_RefAttr &theTransversalPoint, double theEndX, double theEndY, bool theInversed)
Set by tangent and end point.
Definition: SketchAPI_MacroArc.cpp:203
void setByStartEndPassed(double theStartX, double theStartY, double theEndX, double theEndY, double thePassedX, double thePassedY)
Set by start, end and passed points.
Definition: SketchAPI_MacroArc.cpp:151
virtual std::shared_ptr< GeomDataAPI_Point2D > endPoint4() const
End point.
Definition: SketchAPI_MacroArc.h:119
virtual std::shared_ptr< ModelAPI_AttributeDouble > angle() const
Angle.
Definition: SketchAPI_MacroArc.h:119
virtual std::shared_ptr< GeomDataAPI_Point2D > startPoint2() const
Start point.
Definition: SketchAPI_MacroArc.h:119
virtual ~SketchAPI_MacroArc()
Destructor.
Definition: SketchAPI_MacroArc.cpp:115
SketchAPI_MacroArc(const std::shared_ptr< ModelAPI_Feature > &theFeature)
Constructor without values.
Definition: SketchAPI_MacroArc.cpp:33
virtual std::shared_ptr< ModelAPI_AttributeRefAttr > transversalPoint() const
Transversal point.
Definition: SketchAPI_MacroArc.h:119
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_MacroArc.cpp:121
virtual std::shared_ptr< ModelAPI_AttributeDouble > radius() const
Radius.
Definition: SketchAPI_MacroArc.h:119
Base class for Sketch feature interfaces.
Definition: SketchAPI_SketchEntity.h:38
static const std::string & END_POINT_2_ID()
End 2D point of the arc.
Definition: SketchPlugin_MacroArc.h:122
static const std::string & END_POINT_3_ID()
End 2D point of the arc.
Definition: SketchPlugin_MacroArc.h:129
static const std::string & START_POINT_2_ID()
Start 2D point of the arc.
Definition: SketchPlugin_MacroArc.h:102
static const std::string & ID()
Arc feature kind.
Definition: SketchPlugin_MacroArc.h:46
static const std::string & CENTER_POINT_ID()
Central 2D point of the circle which contains the arc.
Definition: SketchPlugin_MacroArc.h:82
static const std::string & START_POINT_1_ID()
Start 2D point of the arc.
Definition: SketchPlugin_MacroArc.h:95
static const std::string & PASSED_POINT_ID()
Passed point of the arc.
Definition: SketchPlugin_MacroArc.h:149
static const std::string & REVERSED_ID()
Reversed flag.
Definition: SketchPlugin_MacroArc.h:174
static const std::string & ANGLE_ID()
Arc angle.
Definition: SketchPlugin_MacroArc.h:188
static const std::string & END_POINT_1_ID()
End 2D point of the arc.
Definition: SketchPlugin_MacroArc.h:115
static const std::string & RADIUS_ID()
Arc radius.
Definition: SketchPlugin_MacroArc.h:181
static const std::string & END_POINT_4_ID()
End 2D point of the arc.
Definition: SketchPlugin_MacroArc.h:136