20 #ifndef SRC_SKETCHAPI_SKETCHAPI_SKETCH_H_
21 #define SRC_SKETCHAPI_SKETCHAPI_SKETCH_H_
24 #include "SketchAPI.h"
29 #include <SketchPlugin_Sketch.h>
30 #include <SketchPlugin_SketchEntity.h>
31 #include <SketchPlugin_Offset.h>
33 #include <ModelHighAPI_Double.h>
34 #include <ModelHighAPI_Interface.h>
35 #include <ModelHighAPI_Macro.h>
36 #include <ModelHighAPI_Selection.h>
75 explicit SketchAPI_Sketch(
const std::shared_ptr<ModelAPI_Feature> & theFeature);
79 const std::shared_ptr<GeomAPI_Ax3> & thePlane);
87 std::shared_ptr<ModelAPI_Object> thePlaneObject);
116 bool theRemoveExternalDependency = false);
137 double theX,
double theY);
153 bool theKeepResult = false);
158 bool theKeepResult = false);
163 double theX1,
double theY1,
double theX2,
double theY2);
179 double theX1,
double theY1,
double theX2,
double theY2);
193 double theCenterX,
double theCenterY,
194 double theCornerX,
double theCornerY
200 double theCenterX,
double theCenterY,
210 double theCenterX,
double theCenterY,
211 double thePassedX,
double thePassedY);
220 double theX1,
double theY1,
221 double theX2,
double theY2,
222 double theX3,
double theY3);
239 double theCenterX,
double theCenterY,
240 double theRadius,
double theAngle);
245 double theRadius,
double theAngle);
249 double theCenterX,
double theCenterY,
250 double thePassedX,
double thePassedY,
261 double theX1,
double theY1,
262 double theX2,
double theY2,
263 double theX3,
double theY3,
282 double theCenterX,
double theCenterY,
283 double theStartX,
double theStartY,
284 double theEndX,
double theEndY,
298 double theStartX,
double theStartY,
299 double theEndX,
double theEndY,
300 double thePassedX,
double thePassedY);
313 double theEndX,
double theEndY,
315 bool theTransversal = false);
323 bool theTransversal = false);
336 double theCenterX,
double theCenterY,
337 double theFocusX,
double theFocusY,
338 double theMinorRadius);
348 double thePoint1X,
double thePoint1Y,
349 double thePoint2X,
double thePoint2Y,
350 double thePassedX,
double thePassedY,
351 bool isPoint1Center = true);
355 const PointOrReference& thePoint1,
356 const PointOrReference& thePoint2,
357 const PointOrReference& thePassedPoint,
358 bool isPoint1Center = true);
369 double theCenterX,
double theCenterY,
370 double theFocusX,
double theFocusY,
371 double theStartX,
double theStartY,
372 double theEndX,
double theEndY,
373 bool theInversed = false);
377 const PointOrReference& theCenter,
378 const PointOrReference& theMajorAxisPoint,
379 const PointOrReference& theStartPoint,
380 const PointOrReference& theEndPoint,
381 bool theInversed = false);
393 const
int degree = -1,
394 const std::list<PointOrReference>& poles = std::list<PointOrReference>(),
398 const
bool periodic = false);
404 const
bool periodic = false,
405 const
bool closed = false);
412 const
bool periodic = false,
413 const
bool closed = false);
419 bool keepResult = false,
420 bool keepRefToOriginal = true);
433 const
bool theReversed = false,
435 const
bool theApprox = false);
444 bool theFullValue = false);
453 bool theFullValue = false,
454 bool theReversed = false);
474 const std::
string& type = std::
string(),
475 bool is_active = true);
483 bool is_active = true);
491 bool is_active = true);
498 bool is_active = true);
505 bool is_active = true);
513 bool isSigned = false,
514 bool is_active = true);
522 bool is_active = true);
530 bool is_active = true);
538 bool is_active = true);
546 bool is_active = true);
553 bool is_active = true);
570 bool is_active = true);
576 bool is_active = true);
583 bool is_active = true);
590 bool is_active = true);
596 bool is_active = true);
603 bool is_active = true);
610 bool is_active = true);
617 bool is_active = true);
624 bool is_active = true);
630 bool is_active = true);
646 double theTargetX,
double theTargetY);
689 const std::wstring & theExternalName);
705 const SketchPtr & theSketch);
The class represents a coordinate plane which is 2d plane with X and Y directions and origin.
Definition: GeomAPI_Ax3.h:33
2D point defined by two coordinates
Definition: GeomAPI_Pnt2d.h:36
3D point defined by three coordinates
Definition: GeomAPI_Pnt.h:38
Attribute that contains 3D direction coordinates.
Definition: GeomDataAPI_Dir.h:35
Attribute that contains 3D point coordinates.
Definition: GeomDataAPI_Point.h:36
Attribute that contains list of references to features (located in the same document).
Definition: ModelAPI_AttributeRefList.h:33
Attribute that contains reference to the sub-shape of some result, the selected shape.
Definition: ModelAPI_AttributeSelection.h:35
API for the attribute that contains std (null terminated) string.
Definition: ModelAPI_AttributeString.h:33
Feature that consists of other features: like sketcher with edges inside.
Definition: ModelAPI_CompositeFeature.h:33
Document for internal data structure of any object storage.
Definition: ModelAPI_Document.h:53
Represents any object in the data model and in the object browser.
Definition: ModelAPI_Object.h:45
Class for filling ModelAPI_AttributeDouble.
Definition: ModelHighAPI_Double.h:37
Dump engine for the model.
Definition: ModelHighAPI_Dumper.h:81
Class for filling ModelAPI_AttributeInteger.
Definition: ModelHighAPI_Integer.h:36
Base class for feature interfaces.
Definition: ModelHighAPI_Interface.h:46
Class for filling ModelAPI_AttributeRefAttr.
Definition: ModelHighAPI_RefAttr.h:41
Class for filling ModelAPI_AttributeReference.
Definition: ModelHighAPI_Reference.h:41
Class for filling ModelAPI_AttributeSelection.
Definition: ModelHighAPI_Selection.h:49
Interface for Arc feature.
Definition: SketchAPI_Arc.h:37
Interface for BSpline feature.
Definition: SketchAPI_BSpline.h:42
Interface for Circle feature.
Definition: SketchAPI_Circle.h:34
Interface for Ellipse feature.
Definition: SketchAPI_Ellipse.h:36
Interface for Elliptic Arc feature.
Definition: SketchAPI_EllipticArc.h:34
Interface for IntersectionPoint feature.
Definition: SketchAPI_IntersectionPoint.h:37
Interface for Line feature.
Definition: SketchAPI_Line.h:39
Interface for Arc feature.
Definition: SketchAPI_MacroArc.h:37
Interface for Circle feature.
Definition: SketchAPI_MacroCircle.h:34
Interface for Ellipse feature.
Definition: SketchAPI_MacroEllipse.h:36
Interface for Elliptic Arc feature.
Definition: SketchAPI_MacroEllipticArc.h:32
Interface for Middle Point feature.
Definition: SketchAPI_MacroMiddlePoint.h:35
Interface for Mirror feature.
Definition: SketchAPI_Mirror.h:42
Interface for Offset feature.
Definition: SketchAPI_Offset.h:43
Interface for Point feature.
Definition: SketchAPI_Point.h:39
Interface for Projection feature.
Definition: SketchAPI_Projection.h:37
Interface for Rectangle feature.
Definition: SketchAPI_Rectangle.h:37
Interface for Rotation feature.
Definition: SketchAPI_Rotation.h:44
Interface for Sketch feature.
Definition: SketchAPI_Sketch.h:71
std::shared_ptr< ModelHighAPI_Interface > setAngleBackward(const ModelHighAPI_RefAttr &theLine1, const ModelHighAPI_RefAttr &theLine2, const ModelHighAPI_Double &theValue, bool is_active=true)
Set backward angle (= 360 - angle)
Definition: SketchAPI_Sketch.cpp:1304
std::shared_ptr< ModelHighAPI_Interface > setTangent(const ModelHighAPI_RefAttr &theLine, const ModelHighAPI_RefAttr &theCircle, bool is_active=true)
Set tangent.
Definition: SketchAPI_Sketch.cpp:1576
std::shared_ptr< ModelHighAPI_Interface > setPerpendicular(const ModelHighAPI_RefAttr &theLine1, const ModelHighAPI_RefAttr &theLine2, bool is_active=true)
Set perpendicular.
Definition: SketchAPI_Sketch.cpp:1548
std::shared_ptr< SketchAPI_Line > addLine(double theX1, double theY1, double theX2, double theY2)
Add line.
Definition: SketchAPI_Sketch.cpp:503
std::shared_ptr< ModelHighAPI_Interface > setCoincident(const ModelHighAPI_RefAttr &thePoint1, const ModelHighAPI_RefAttr &thePoint2, bool is_active=true)
Set coincident.
Definition: SketchAPI_Sketch.cpp:1324
SketchAPI_Sketch(const std::shared_ptr< ModelAPI_Feature > &theFeature)
Constructor without values.
Definition: SketchAPI_Sketch.cpp:209
std::shared_ptr< ModelHighAPI_Interface > setSignedDistance(const ModelHighAPI_RefAttr &thePoint, const ModelHighAPI_RefAttr &thePointOrLine, const ModelHighAPI_Double &theValue, bool is_active=true)
Set signed distance.
Definition: SketchAPI_Sketch.cpp:1370
std::shared_ptr< ModelHighAPI_Interface > setEqual(const ModelHighAPI_RefAttr &theObject1, const ModelHighAPI_RefAttr &theObject2, bool is_active=true)
Set equal.
Definition: SketchAPI_Sketch.cpp:1422
virtual std::shared_ptr< ModelAPI_AttributeSelection > external() const
External.
Definition: SketchAPI_Sketch.h:107
std::shared_ptr< SketchAPI_Circle > addCircle(double theCenterX, double theCenterY, double theRadius)
Add circle.
Definition: SketchAPI_Sketch.cpp:622
std::list< std::shared_ptr< SketchAPI_Point > > getFreePoints()
List points not connected by constraints with other sketch entities.
Definition: SketchAPI_Sketch.cpp:380
std::shared_ptr< ModelHighAPI_Interface > setDistance(const ModelHighAPI_RefAttr &thePoint, const ModelHighAPI_RefAttr &thePointOrLine, const ModelHighAPI_Double &theValue, bool isSigned=false, bool is_active=true)
Set distance.
Definition: SketchAPI_Sketch.cpp:1352
void setValue(const std::shared_ptr< ModelHighAPI_Interface > &theConstraint, const ModelHighAPI_Double &theValue)
Set constraint value.
Definition: SketchAPI_Sketch.cpp:301
virtual std::shared_ptr< GeomDataAPI_Point > origin() const
Origin point.
Definition: SketchAPI_Sketch.h:107
std::shared_ptr< SketchAPI_Point > addPoint(double theX, double theY)
Add point.
Definition: SketchAPI_Sketch.cpp:452
std::shared_ptr< ModelHighAPI_Interface > setVertical(const ModelHighAPI_RefAttr &theLine, bool is_active=true)
Set vertical.
Definition: SketchAPI_Sketch.cpp:1590
std::pair< std::shared_ptr< SketchAPI_Rectangle >, std::shared_ptr< SketchAPI_Point > > addRectangleCentered(const std::pair< std::shared_ptr< GeomAPI_Pnt2d >, ModelHighAPI_RefAttr > &theCenter, const std::pair< std::shared_ptr< GeomAPI_Pnt2d >, ModelHighAPI_RefAttr > &theCorner)
Add rectangle.
Definition: SketchAPI_Sketch.cpp:586
std::shared_ptr< ModelHighAPI_Interface > setAngle(const ModelHighAPI_RefAttr &theLine1, const ModelHighAPI_RefAttr &theLine2, const ModelHighAPI_Double &theValue, const std::string &type=std::string(), bool is_active=true)
Set angle.
Definition: SketchAPI_Sketch.cpp:1242
virtual void dump(ModelHighAPI_Dumper &theDumper) const
Dump wrapped feature.
Definition: SketchAPI_Sketch.cpp:1742
std::shared_ptr< SketchAPI_BSpline > addSpline(const ModelHighAPI_Selection &external=ModelHighAPI_Selection(), const int degree=-1, const std::list< PointOrReference > &poles=std::list< PointOrReference >(), const std::list< ModelHighAPI_Double > &weights=std::list< ModelHighAPI_Double >(), const std::list< ModelHighAPI_Double > &knots=std::list< ModelHighAPI_Double >(), const std::list< ModelHighAPI_Integer > &multiplicities=std::list< ModelHighAPI_Integer >(), const bool periodic=false)
Add B-spline.
Definition: SketchAPI_Sketch.cpp:1001
std::shared_ptr< SketchAPI_Ellipse > addEllipse(double theCenterX, double theCenterY, double theFocusX, double theFocusY, double theMinorRadius)
Add ellipse.
Definition: SketchAPI_Sketch.cpp:874
std::shared_ptr< SketchAPI_Offset > addOffset(const std::list< std::shared_ptr< ModelAPI_Object > > &theObjects, const ModelHighAPI_Double &theValue, const bool theReversed=false, const std::string &theJointType=SketchPlugin_Offset::JOINT_KEEP_DISTANCE(), const bool theApprox=false)
Add offset.
Definition: SketchAPI_Sketch.cpp:1163
std::shared_ptr< ModelHighAPI_Interface > setUnsignedDistance(const ModelHighAPI_RefAttr &thePoint, const ModelHighAPI_RefAttr &thePointOrLine, const ModelHighAPI_Double &theValue, bool is_active=true)
Set unsigned distance.
Definition: SketchAPI_Sketch.cpp:1379
std::shared_ptr< ModelHighAPI_Interface > setLength(const ModelHighAPI_RefAttr &theLine, const ModelHighAPI_Double &theValue, bool is_active=true)
Set length.
Definition: SketchAPI_Sketch.cpp:1488
std::shared_ptr< SketchAPI_Circle > addCircleWithPoint(double theCenterX, double theCenterY, double theRadius, double theAngle)
Add circle with point.
Definition: SketchAPI_Sketch.cpp:699
virtual std::shared_ptr< ModelAPI_AttributeString > solverDOF() const
Solver DOF.
Definition: SketchAPI_Sketch.h:107
virtual std::shared_ptr< ModelAPI_AttributeRefList > features() const
Features.
Definition: SketchAPI_Sketch.h:107
std::shared_ptr< SketchAPI_BSpline > addApproximation(const std::list< ModelHighAPI_RefAttr > &points, const ModelHighAPI_Double &precision=ModelHighAPI_Double(1.e-3), const bool periodic=false, const bool closed=false)
Add approximation feature.
Definition: SketchAPI_Sketch.cpp:1123
std::shared_ptr< SketchAPI_IntersectionPoint > addIntersectionPoint(const ModelHighAPI_Selection &theExternal, bool theKeepResult=false)
Add intersection point.
Definition: SketchAPI_Sketch.cpp:481
std::shared_ptr< ModelHighAPI_Interface > setVerticalDistance(const ModelHighAPI_RefAttr &thePoint1, const ModelHighAPI_RefAttr &thePoint2, const ModelHighAPI_Double &theValue, bool is_active=true)
Set vertical distance.
Definition: SketchAPI_Sketch.cpp:1405
virtual ~SketchAPI_Sketch()
Destructor.
Definition: SketchAPI_Sketch.cpp:246
std::shared_ptr< ModelHighAPI_Interface > setParallel(const ModelHighAPI_RefAttr &theLine1, const ModelHighAPI_RefAttr &theLine2, bool is_active=true)
Set parallel.
Definition: SketchAPI_Sketch.cpp:1534
std::shared_ptr< SketchAPI_EllipticArc > addEllipticArc(double theCenterX, double theCenterY, double theFocusX, double theFocusY, double theStartX, double theStartY, double theEndX, double theEndY, bool theInversed=false)
Add elliptic arc.
Definition: SketchAPI_Sketch.cpp:949
std::list< ModelHighAPI_Selection > selectFace() const
Select face.
Definition: SketchAPI_Sketch.cpp:311
virtual std::shared_ptr< GeomDataAPI_Dir > normal() const
Normal.
Definition: SketchAPI_Sketch.h:107
virtual std::shared_ptr< ModelAPI_AttributeString > solverError() const
Solver error.
Definition: SketchAPI_Sketch.h:107
std::shared_ptr< ModelHighAPI_Interface > setHorizontalDistance(const ModelHighAPI_RefAttr &thePoint1, const ModelHighAPI_RefAttr &thePoint2, const ModelHighAPI_Double &theValue, bool is_active=true)
Set horizontal distance.
Definition: SketchAPI_Sketch.cpp:1388
std::shared_ptr< SketchAPI_Rotation > addRotation(const std::list< std::shared_ptr< ModelAPI_Object > > &theObjects, const ModelHighAPI_RefAttr &theCenter, const ModelHighAPI_Double &theAngle, const ModelHighAPI_Integer &theNumberOfObjects, bool theFullValue=false, bool theReversed=false)
Add rotation.
Definition: SketchAPI_Sketch.cpp:1190
std::shared_ptr< ModelHighAPI_Interface > setFixed(const ModelHighAPI_RefAttr &theObject, bool is_active=true)
Set fixed.
Definition: SketchAPI_Sketch.cpp:1464
std::shared_ptr< ModelHighAPI_Interface > setMiddlePoint(const ModelHighAPI_RefAttr &thePoint, const ModelHighAPI_RefAttr &theLine, bool is_active=true)
Set middle.
Definition: SketchAPI_Sketch.cpp:1502
std::shared_ptr< SketchAPI_Translation > addTranslation(const std::list< std::shared_ptr< ModelAPI_Object > > &theObjects, const ModelHighAPI_RefAttr &thePoint1, const ModelHighAPI_RefAttr &thePoint2, const ModelHighAPI_Integer &theNumberOfObjects, bool theFullValue=false)
Add translation.
Definition: SketchAPI_Sketch.cpp:1176
std::shared_ptr< ModelHighAPI_Interface > setFilletWithRadius(const ModelHighAPI_RefAttr &thePoint, const ModelHighAPI_Double &theRadius)
Set fillet with additional radius constraint.
Definition: SketchAPI_Sketch.cpp:1446
void setExternal(const ModelHighAPI_Selection &theExternal)
Set external.
Definition: SketchAPI_Sketch.cpp:286
std::shared_ptr< ModelHighAPI_Interface > setRadius(const ModelHighAPI_RefAttr &theCircleOrArc, const ModelHighAPI_Double &theValue, bool is_active=true)
Set radius.
Definition: SketchAPI_Sketch.cpp:1562
virtual std::shared_ptr< GeomDataAPI_Dir > dirX() const
Direction of X.
Definition: SketchAPI_Sketch.h:107
std::shared_ptr< SketchAPI_Projection > addProjection(const ModelHighAPI_Selection &theExternalFeature, bool keepResult=false, bool keepRefToOriginal=true)
Add projection.
Definition: SketchAPI_Sketch.cpp:1138
std::shared_ptr< SketchAPI_Mirror > addMirror(const ModelHighAPI_RefAttr &theMirrorLine, const std::list< std::shared_ptr< ModelAPI_Object > > &theObjects)
Add mirror.
Definition: SketchAPI_Sketch.cpp:1153
std::shared_ptr< ModelHighAPI_Interface > setFillet(const ModelHighAPI_RefAttr &thePoint)
Set fillet.
Definition: SketchAPI_Sketch.cpp:1436
void move(const ModelHighAPI_RefAttr &theMovedEntity, const std::shared_ptr< GeomAPI_Pnt2d > &theTargetPoint)
Move point or sketch feature.
Definition: SketchAPI_Sketch.cpp:1604
std::shared_ptr< ModelHighAPI_Interface > setAngleComplementary(const ModelHighAPI_RefAttr &theLine1, const ModelHighAPI_RefAttr &theLine2, const ModelHighAPI_Double &theValue, bool is_active=true)
Set complementary angle.
Definition: SketchAPI_Sketch.cpp:1284
std::shared_ptr< SketchAPI_Arc > addArc(double theCenterX, double theCenterY, double theStartX, double theStartY, double theEndX, double theEndY, bool theInversed)
Add arc.
Definition: SketchAPI_Sketch.cpp:780
void changeFacesOrder(const std::list< std::list< ModelHighAPI_Selection > > &theFaces)
Change order of sketch results (faces)
Definition: SketchAPI_Sketch.cpp:401
std::shared_ptr< SketchAPI_Rectangle > addRectangle(double theX1, double theY1, double theX2, double theY2)
Add rectangle.
Definition: SketchAPI_Sketch.cpp:533
std::shared_ptr< ModelHighAPI_Interface > addTrim(const ModelHighAPI_Reference &theFeature, const std::shared_ptr< GeomAPI_Pnt2d > &thePositionPoint)
Add trim.
Definition: SketchAPI_Sketch.cpp:1224
void setPlane(const std::shared_ptr< GeomAPI_Ax3 > &thePlane)
Set plane.
Definition: SketchAPI_Sketch.cpp:258
std::shared_ptr< SketchAPI_BSpline > addInterpolation(const std::list< ModelHighAPI_RefAttr > &points, const bool periodic=false, const bool closed=false)
Add interpolation feature.
Definition: SketchAPI_Sketch.cpp:1111
std::shared_ptr< ModelHighAPI_Interface > setHorizontal(const ModelHighAPI_RefAttr &theLine, bool is_active=true)
Set horizontal.
Definition: SketchAPI_Sketch.cpp:1476
std::shared_ptr< ModelHighAPI_Interface > setCollinear(const ModelHighAPI_RefAttr &theLine1, const ModelHighAPI_RefAttr &theLine2, bool is_active=true)
Set collinear.
Definition: SketchAPI_Sketch.cpp:1338
std::shared_ptr< ModelHighAPI_Interface > addSplit(const ModelHighAPI_Reference &theFeature, const std::shared_ptr< GeomAPI_Pnt2d > &thePositionPoint)
Add split.
Definition: SketchAPI_Sketch.cpp:1206
Interface for Translation feature.
Definition: SketchAPI_Translation.h:43
Builds offset curves in the sketch.
Definition: SketchPlugin_Offset.h:39
static const std::string & EXTERNAL_ID()
Reference to the external edge or vertex as a AttributeSelection.
Definition: SketchPlugin_SketchEntity.h:55
static const std::string & ID()
Sketch feature kind.
Definition: SketchPlugin_Sketch.h:50
static const std::string & SOLVER_DOF()
Sketch solver error.
Definition: SketchPlugin_Sketch.h:165
static const std::string & NORM_ID()
Vector Z, normal to the sketch plane.
Definition: SketchPlugin_Sketch.h:68
static const std::string & SOLVER_ERROR()
Sketch solver error.
Definition: SketchPlugin_Sketch.h:158
static const std::string & DIRX_ID()
Vector X inside of the sketch plane.
Definition: SketchPlugin_Sketch.h:62
static const std::string & ORIGIN_ID()
Origin point of the sketcher in 3D space.
Definition: SketchPlugin_Sketch.h:56
static const std::string & FEATURES_ID()
All features of this sketch (list of references)
Definition: SketchPlugin_Sketch.h:152
SketchPtr addSketch(const std::shared_ptr< ModelAPI_Document > &thePart, const std::shared_ptr< GeomAPI_Ax3 > &thePlane)
Create Sketch feature.
Definition: SketchAPI_Sketch.cpp:332
SketchPtr copySketch(const std::shared_ptr< ModelAPI_Document > &thePart, const SketchPtr &theSketch)
Copy sketch with all its sub-features.
Definition: SketchAPI_Sketch.cpp:362