SHAPER  9.12.0
SketchAPI_Sketch.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 SRC_SKETCHAPI_SKETCHAPI_SKETCH_H_
21 #define SRC_SKETCHAPI_SKETCHAPI_SKETCH_H_
22 
23 //--------------------------------------------------------------------------------------
24 #include "SketchAPI.h"
25 
26 #include <list>
27 
28 #include <SketchPlugin_Sketch.h>
29 #include <SketchPlugin_SketchEntity.h>
30 #include <SketchPlugin_Offset.h>
31 
32 #include <ModelHighAPI_Double.h>
33 #include <ModelHighAPI_Interface.h>
34 #include <ModelHighAPI_Macro.h>
35 #include <ModelHighAPI_Selection.h>
36 //--------------------------------------------------------------------------------------
38 class ModelAPI_Object;
42 class SketchAPI_Arc;
43 class SketchAPI_MacroArc;
44 class SketchAPI_Circle;
46 class SketchAPI_Ellipse;
50 class SketchAPI_BSpline;
52 class SketchAPI_Line;
53 class SketchAPI_Mirror;
54 class SketchAPI_Offset;
55 class SketchAPI_Point;
58 class SketchAPI_Rotation;
61 
62 //--------------------------------------------------------------------------------------
63 typedef std::pair<std::shared_ptr<GeomAPI_Pnt2d>, ModelHighAPI_RefAttr> PointOrReference;
64 //--------------------------------------------------------------------------------------
70 {
71 public:
73  SKETCHAPI_EXPORT
74  explicit SketchAPI_Sketch(const std::shared_ptr<ModelAPI_Feature> & theFeature);
76  SKETCHAPI_EXPORT
77  SketchAPI_Sketch(const std::shared_ptr<ModelAPI_Feature> & theFeature,
78  const std::shared_ptr<GeomAPI_Ax3> & thePlane);
80  SKETCHAPI_EXPORT
81  SketchAPI_Sketch(const std::shared_ptr<ModelAPI_Feature> & theFeature,
82  const ModelHighAPI_Selection & theExternal);
84  SKETCHAPI_EXPORT
85  SketchAPI_Sketch(const std::shared_ptr<ModelAPI_Feature> & theFeature,
86  std::shared_ptr<ModelAPI_Object> thePlaneObject);
88  SKETCHAPI_EXPORT
89  virtual ~SketchAPI_Sketch();
90 
91  INTERFACE_7(SketchPlugin_Sketch::ID(),
106  )
107 
108 
109  SKETCHAPI_EXPORT
110  void setPlane(const std::shared_ptr<GeomAPI_Ax3> & thePlane);
111 
113  SKETCHAPI_EXPORT
114  void setPlane(const ModelHighAPI_Selection & thePlane,
115  bool theRemoveExternalDependency = false);
116 
118  SKETCHAPI_EXPORT
119  void setExternal(const ModelHighAPI_Selection & theExternal);
120 
122  SKETCHAPI_EXPORT
123  void setExternal(std::shared_ptr<ModelAPI_Object> thePlaneObject);
124 
126  SKETCHAPI_EXPORT
127  void changeFacesOrder(const std::list<std::list<ModelHighAPI_Selection> >& theFaces);
128 
130  SKETCHAPI_EXPORT
131  std::list< std::shared_ptr<SketchAPI_Point> > getFreePoints();
132 
134  SKETCHAPI_EXPORT
135  std::shared_ptr<SketchAPI_Point> addPoint(
136  double theX, double theY);
138  SKETCHAPI_EXPORT
139  std::shared_ptr<SketchAPI_Point> addPoint(
140  const std::shared_ptr<GeomAPI_Pnt2d> & thePoint);
142  SKETCHAPI_EXPORT
143  std::shared_ptr<SketchAPI_Point> addPoint(const ModelHighAPI_Selection & theExternal);
145  SKETCHAPI_EXPORT
146  std::shared_ptr<SketchAPI_Point> addPoint(const std::wstring & theExternalName);
147 
149  SKETCHAPI_EXPORT
150  std::shared_ptr<SketchAPI_IntersectionPoint>
151  addIntersectionPoint(const ModelHighAPI_Selection & theExternal,
152  bool theKeepResult = false);
154  SKETCHAPI_EXPORT
155  std::shared_ptr<SketchAPI_IntersectionPoint>
156  addIntersectionPoint(const std::wstring & theExternalName,
157  bool theKeepResult = false);
158 
160  SKETCHAPI_EXPORT
161  std::shared_ptr<SketchAPI_Line> addLine(
162  double theX1, double theY1, double theX2, double theY2);
164  SKETCHAPI_EXPORT
165  std::shared_ptr<SketchAPI_Line> addLine(
166  const std::shared_ptr<GeomAPI_Pnt2d> & theStartPoint,
167  const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint);
169  SKETCHAPI_EXPORT
170  std::shared_ptr<SketchAPI_Line> addLine(const ModelHighAPI_Selection & theExternal);
172  SKETCHAPI_EXPORT
173  std::shared_ptr<SketchAPI_Line> addLine(const std::wstring & theExternalName);
174 
176  SKETCHAPI_EXPORT
177  std::shared_ptr<SketchAPI_Rectangle> addRectangle(
178  double theX1, double theY1, double theX2, double theY2);
180  SKETCHAPI_EXPORT
181  std::shared_ptr<SketchAPI_Rectangle> addRectangle(
182  const std::shared_ptr<GeomAPI_Pnt2d> & theStartPoint,
183  const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint);
185  SKETCHAPI_EXPORT
186  std::shared_ptr<SketchAPI_Rectangle> addRectangleCentered(
187  const std::pair<std::shared_ptr<GeomAPI_Pnt2d>, ModelHighAPI_RefAttr> & theCenter,
188  const std::pair<std::shared_ptr<GeomAPI_Pnt2d>, ModelHighAPI_RefAttr> & theCorner);
189 
191  SKETCHAPI_EXPORT
192  std::shared_ptr<SketchAPI_Circle> addCircle(
193  double theCenterX, double theCenterY,
194  double theRadius);
196  SKETCHAPI_EXPORT
197  std::shared_ptr<SketchAPI_Circle> addCircle(
198  const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
199  double theRadius);
201  SKETCHAPI_EXPORT
202  std::shared_ptr<SketchAPI_MacroCircle> addCircle(
203  double theCenterX, double theCenterY,
204  double thePassedX, double thePassedY);
206  SKETCHAPI_EXPORT
207  std::shared_ptr<SketchAPI_MacroCircle> addCircle(
208  const std::shared_ptr<GeomAPI_Pnt2d>& theCenterPoint,
209  const std::shared_ptr<GeomAPI_Pnt2d>& thePassedPoint);
211  SKETCHAPI_EXPORT
212  std::shared_ptr<SketchAPI_MacroCircle> addCircle(
213  double theX1, double theY1,
214  double theX2, double theY2,
215  double theX3, double theY3);
217  SKETCHAPI_EXPORT
218  std::shared_ptr<SketchAPI_MacroCircle> addCircle(
219  const std::shared_ptr<GeomAPI_Pnt2d>& thePoint1,
220  const std::shared_ptr<GeomAPI_Pnt2d>& thePoint2,
221  const std::shared_ptr<GeomAPI_Pnt2d>& thePoint3);
223  SKETCHAPI_EXPORT
224  std::shared_ptr<SketchAPI_Circle> addCircle(const ModelHighAPI_Selection & theExternal);
226  SKETCHAPI_EXPORT
227  std::shared_ptr<SketchAPI_Circle> addCircle(const std::wstring & theExternalName);
228 
230  SKETCHAPI_EXPORT
231  std::shared_ptr<SketchAPI_Arc> addArc(
232  double theCenterX, double theCenterY,
233  double theStartX, double theStartY,
234  double theEndX, double theEndY,
235  bool theInversed);
236 
238  SKETCHAPI_EXPORT
239  std::shared_ptr<SketchAPI_Arc> addArc(
240  const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
241  const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
242  const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
243  bool theInversed);
244 
246  SKETCHAPI_EXPORT
247  std::shared_ptr<SketchAPI_MacroArc> addArc(
248  double theStartX, double theStartY,
249  double theEndX, double theEndY,
250  double thePassedX, double thePassedY);
251 
253  SKETCHAPI_EXPORT
254  std::shared_ptr<SketchAPI_MacroArc> addArc(
255  const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
256  const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
257  const std::shared_ptr<GeomAPI_Pnt2d>& thePassed);
258 
260  SKETCHAPI_EXPORT
261  std::shared_ptr<SketchAPI_MacroArc> addArc(
262  const ModelHighAPI_RefAttr& theConnectedPoint,
263  double theEndX, double theEndY,
264  bool theInversed,
265  bool theTransversal = false);
266 
268  SKETCHAPI_EXPORT
269  std::shared_ptr<SketchAPI_MacroArc> addArc(
270  const ModelHighAPI_RefAttr& theConnectedPoint,
271  const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
272  bool theInversed,
273  bool theTransversal = false);
274 
276  SKETCHAPI_EXPORT
277  std::shared_ptr<SketchAPI_Arc> addArc(const ModelHighAPI_Selection & theExternal);
278 
280  SKETCHAPI_EXPORT
281  std::shared_ptr<SketchAPI_Arc> addArc(const std::wstring & theExternalName);
282 
284  SKETCHAPI_EXPORT
285  std::shared_ptr<SketchAPI_Ellipse> addEllipse(
286  double theCenterX, double theCenterY,
287  double theFocusX, double theFocusY,
288  double theMinorRadius);
290  SKETCHAPI_EXPORT
291  std::shared_ptr<SketchAPI_Ellipse> addEllipse(
292  const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
293  const std::shared_ptr<GeomAPI_Pnt2d>& theFocus,
294  double theRadius);
296  SKETCHAPI_EXPORT
297  std::shared_ptr<SketchAPI_MacroEllipse> addEllipse(
298  double thePoint1X, double thePoint1Y,
299  double thePoint2X, double thePoint2Y,
300  double thePassedX, double thePassedY,
301  bool isPoint1Center = true);
303  SKETCHAPI_EXPORT
304  std::shared_ptr<SketchAPI_MacroEllipse> addEllipse(
305  const PointOrReference& thePoint1,
306  const PointOrReference& thePoint2,
307  const PointOrReference& thePassedPoint,
308  bool isPoint1Center = true);
310  SKETCHAPI_EXPORT
311  std::shared_ptr<SketchAPI_Ellipse> addEllipse(const ModelHighAPI_Selection & theExternal);
313  SKETCHAPI_EXPORT
314  std::shared_ptr<SketchAPI_Ellipse> addEllipse(const std::wstring & theExternalName);
315 
317  SKETCHAPI_EXPORT
318  std::shared_ptr<SketchAPI_EllipticArc> addEllipticArc(
319  double theCenterX, double theCenterY,
320  double theFocusX, double theFocusY,
321  double theStartX, double theStartY,
322  double theEndX, double theEndY,
323  bool theInversed = false);
325  SKETCHAPI_EXPORT
327  const PointOrReference& theCenter,
328  const PointOrReference& theMajorAxisPoint,
329  const PointOrReference& theStartPoint,
330  const PointOrReference& theEndPoint,
331  bool theInversed = false);
333  SKETCHAPI_EXPORT
334  std::shared_ptr<SketchAPI_EllipticArc> addEllipticArc(const ModelHighAPI_Selection & theExternal);
336  SKETCHAPI_EXPORT
337  std::shared_ptr<SketchAPI_EllipticArc> addEllipticArc(const std::wstring & theExternalName);
338 
340  SKETCHAPI_EXPORT
341  std::shared_ptr<SketchAPI_BSpline> addSpline(
343  const int degree = -1,
344  const std::list<PointOrReference>& poles = std::list<PointOrReference>(),
345  const std::list<ModelHighAPI_Double>& weights = std::list<ModelHighAPI_Double>(),
346  const std::list<ModelHighAPI_Double>& knots = std::list<ModelHighAPI_Double>(),
347  const std::list<ModelHighAPI_Integer>& multiplicities = std::list<ModelHighAPI_Integer>(),
348  const bool periodic = false);
349 
351  SKETCHAPI_EXPORT
352  std::shared_ptr<SketchAPI_BSpline> addInterpolation(
353  const std::list<ModelHighAPI_RefAttr>& points,
354  const bool periodic = false,
355  const bool closed = false);
356 
358  SKETCHAPI_EXPORT
359  std::shared_ptr<SketchAPI_BSpline> addApproximation(
360  const std::list<ModelHighAPI_RefAttr>& points,
361  const ModelHighAPI_Double& precision = ModelHighAPI_Double(1.e-3),
362  const bool periodic = false,
363  const bool closed = false);
364 
366  SKETCHAPI_EXPORT
367  std::shared_ptr<SketchAPI_Projection> addProjection(
368  const ModelHighAPI_Selection & theExternalFeature,
369  bool keepResult = false,
370  bool keepRefToOriginal = true);
371 
373  SKETCHAPI_EXPORT
374  std::shared_ptr<SketchAPI_Mirror> addMirror(
375  const ModelHighAPI_RefAttr & theMirrorLine,
376  const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects);
377 
379  SKETCHAPI_EXPORT
380  std::shared_ptr<SketchAPI_Offset> addOffset(
381  const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects,
382  const ModelHighAPI_Double & theValue,
383  const bool theReversed = false,
384  const std::string & theJointType = SketchPlugin_Offset::JOINT_KEEP_DISTANCE(),
385  const bool theApprox = false);
386 
388  SKETCHAPI_EXPORT
389  std::shared_ptr<SketchAPI_Translation> addTranslation(
390  const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects,
391  const ModelHighAPI_RefAttr & thePoint1,
392  const ModelHighAPI_RefAttr & thePoint2,
393  const ModelHighAPI_Integer & theNumberOfObjects,
394  bool theFullValue = false);
395 
397  SKETCHAPI_EXPORT
398  std::shared_ptr<SketchAPI_Rotation> addRotation(
399  const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects,
400  const ModelHighAPI_RefAttr & theCenter,
401  const ModelHighAPI_Double & theAngle,
402  const ModelHighAPI_Integer & theNumberOfObjects,
403  bool theFullValue = false,
404  bool theReversed = false);
405 
407  SKETCHAPI_EXPORT
408  std::shared_ptr<ModelHighAPI_Interface> addSplit(
409  const ModelHighAPI_Reference& theFeature,
410  const std::shared_ptr<GeomAPI_Pnt2d>& thePositionPoint);
411 
413  SKETCHAPI_EXPORT
414  std::shared_ptr<ModelHighAPI_Interface> addTrim(
415  const ModelHighAPI_Reference& theFeature,
416  const std::shared_ptr<GeomAPI_Pnt2d>& thePositionPoint);
417 
419  SKETCHAPI_EXPORT
420  std::shared_ptr<ModelHighAPI_Interface> setAngle(
421  const ModelHighAPI_RefAttr & theLine1,
422  const ModelHighAPI_RefAttr & theLine2,
423  const ModelHighAPI_Double & theValue,
424  const std::string& type = std::string());
425 
427  SKETCHAPI_EXPORT
429  const ModelHighAPI_RefAttr & theLine1,
430  const ModelHighAPI_RefAttr & theLine2,
431  const ModelHighAPI_Double & theValue);
432 
434  SKETCHAPI_EXPORT
435  std::shared_ptr<ModelHighAPI_Interface> setAngleBackward(
436  const ModelHighAPI_RefAttr & theLine1,
437  const ModelHighAPI_RefAttr & theLine2,
438  const ModelHighAPI_Double & theValue);
439 
441  SKETCHAPI_EXPORT
442  std::shared_ptr<ModelHighAPI_Interface> setCoincident(
443  const ModelHighAPI_RefAttr & thePoint1,
444  const ModelHighAPI_RefAttr & thePoint2);
445 
447  SKETCHAPI_EXPORT
448  std::shared_ptr<ModelHighAPI_Interface> setCollinear(
449  const ModelHighAPI_RefAttr & theLine1,
450  const ModelHighAPI_RefAttr & theLine2);
451 
453  SKETCHAPI_EXPORT
454  std::shared_ptr<ModelHighAPI_Interface> setDistance(
455  const ModelHighAPI_RefAttr & thePoint,
456  const ModelHighAPI_RefAttr & thePointOrLine,
457  const ModelHighAPI_Double & theValue,
458  bool isSigned = false);
459 
461  SKETCHAPI_EXPORT
462  std::shared_ptr<ModelHighAPI_Interface> setSignedDistance(
463  const ModelHighAPI_RefAttr & thePoint,
464  const ModelHighAPI_RefAttr & thePointOrLine,
465  const ModelHighAPI_Double & theValue);
466 
468  SKETCHAPI_EXPORT
470  const ModelHighAPI_RefAttr & thePoint,
471  const ModelHighAPI_RefAttr & thePointOrLine,
472  const ModelHighAPI_Double & theValue);
473 
475  SKETCHAPI_EXPORT
477  const ModelHighAPI_RefAttr & thePoint1,
478  const ModelHighAPI_RefAttr & thePoint2,
479  const ModelHighAPI_Double & theValue);
480 
482  SKETCHAPI_EXPORT
484  const ModelHighAPI_RefAttr & thePoint1,
485  const ModelHighAPI_RefAttr & thePoint2,
486  const ModelHighAPI_Double & theValue);
487 
489  SKETCHAPI_EXPORT
490  std::shared_ptr<ModelHighAPI_Interface> setEqual(
491  const ModelHighAPI_RefAttr & theObject1,
492  const ModelHighAPI_RefAttr & theObject2);
493 
495  SKETCHAPI_EXPORT
496  std::shared_ptr<ModelHighAPI_Interface> setFillet(
497  const ModelHighAPI_RefAttr & thePoint);
498 
500  SKETCHAPI_EXPORT
502  const ModelHighAPI_RefAttr & thePoint,
503  const ModelHighAPI_Double & theRadius);
504 
506  SKETCHAPI_EXPORT
507  std::shared_ptr<ModelHighAPI_Interface> setFixed(
508  const ModelHighAPI_RefAttr & theObject);
509 
511  SKETCHAPI_EXPORT
512  std::shared_ptr<ModelHighAPI_Interface> setHorizontal(
513  const ModelHighAPI_RefAttr & theLine);
514 
516  SKETCHAPI_EXPORT
517  std::shared_ptr<ModelHighAPI_Interface> setLength(
518  const ModelHighAPI_RefAttr & theLine,
519  const ModelHighAPI_Double & theValue);
520 
522  SKETCHAPI_EXPORT
523  std::shared_ptr<ModelHighAPI_Interface> setMiddlePoint(
524  const ModelHighAPI_RefAttr & thePoint,
525  const ModelHighAPI_RefAttr & theLine);
526 
528  SKETCHAPI_EXPORT
530  const ModelHighAPI_RefAttr& theLine);
531 
533  SKETCHAPI_EXPORT
534  std::shared_ptr<ModelHighAPI_Interface> setParallel(
535  const ModelHighAPI_RefAttr & theLine1,
536  const ModelHighAPI_RefAttr & theLine2);
537 
539  SKETCHAPI_EXPORT
540  std::shared_ptr<ModelHighAPI_Interface> setPerpendicular(
541  const ModelHighAPI_RefAttr & theLine1,
542  const ModelHighAPI_RefAttr & theLine2);
543 
545  SKETCHAPI_EXPORT
546  std::shared_ptr<ModelHighAPI_Interface> setRadius(
547  const ModelHighAPI_RefAttr & theCircleOrArc,
548  const ModelHighAPI_Double & theValue);
549 
551  SKETCHAPI_EXPORT
552  std::shared_ptr<ModelHighAPI_Interface> setTangent(
553  const ModelHighAPI_RefAttr & theLine,
554  const ModelHighAPI_RefAttr & theCircle);
555 
557  SKETCHAPI_EXPORT
558  std::shared_ptr<ModelHighAPI_Interface> setVertical(
559  const ModelHighAPI_RefAttr & theLine);
560 
562  SKETCHAPI_EXPORT
563  void setValue(
564  const std::shared_ptr<ModelHighAPI_Interface> & theConstraint,
565  const ModelHighAPI_Double & theValue);
566 
568  SKETCHAPI_EXPORT
569  void move(const ModelHighAPI_RefAttr& theMovedEntity,
570  const std::shared_ptr<GeomAPI_Pnt2d>& theTargetPoint);
571 
573  SKETCHAPI_EXPORT
574  void move(const ModelHighAPI_RefAttr& theMovedEntity,
575  double theTargetX, double theTargetY);
576 
577  SKETCHAPI_EXPORT
578  std::shared_ptr<GeomAPI_Pnt2d> to2D(const std::shared_ptr<GeomAPI_Pnt>& thePoint);
579 
580  // TODO(spo): rename to selectFaces() or faces() (or add faces() -> list to SWIG)
582  SKETCHAPI_EXPORT
583  std::list<ModelHighAPI_Selection> selectFace() const;
584 
586  SKETCHAPI_EXPORT
587  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
588 
589 protected:
590  std::shared_ptr<ModelAPI_CompositeFeature> compositeFeature() const;
591 
592 };
593 
595 typedef std::shared_ptr<SketchAPI_Sketch> SketchPtr;
596 
597 //--------------------------------------------------------------------------------------
598 
602 SKETCHAPI_EXPORT
603 SketchPtr addSketch(const std::shared_ptr<ModelAPI_Document> & thePart,
604  const std::shared_ptr<GeomAPI_Ax3> & thePlane);
605 
609 SKETCHAPI_EXPORT
610 SketchPtr addSketch(const std::shared_ptr<ModelAPI_Document> & thePart,
611  const ModelHighAPI_Selection & theExternal);
612 
616 SKETCHAPI_EXPORT
617 SketchPtr addSketch(const std::shared_ptr<ModelAPI_Document> & thePart,
618  const std::wstring & theExternalName);
619 
623 SKETCHAPI_EXPORT
624 SketchPtr addSketch(const std::shared_ptr<ModelAPI_Document> & thePart,
625  std::shared_ptr<ModelAPI_Object> thePlaneObject);
626 
627 //--------------------------------------------------------------------------------------
628 
632 SKETCHAPI_EXPORT
633 SketchPtr copySketch(const std::shared_ptr<ModelAPI_Document> & thePart,
634  const SketchPtr & theSketch);
635 
636 //--------------------------------------------------------------------------------------
637 #endif /* SRC_SKETCHAPI_SKETCHAPI_SKETCH_H_ */
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:52
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:42
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:36
Interface for Rotation feature.
Definition: SketchAPI_Rotation.h:44
Interface for Sketch feature.
Definition: SketchAPI_Sketch.h:70
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 > setAngleBackward(const ModelHighAPI_RefAttr &theLine1, const ModelHighAPI_RefAttr &theLine2, const ModelHighAPI_Double &theValue)
Set backward angle (= 360 - angle)
Definition: SketchAPI_Sketch.cpp:1188
std::shared_ptr< ModelHighAPI_Interface > setCoincident(const ModelHighAPI_RefAttr &thePoint1, const ModelHighAPI_RefAttr &thePoint2)
Set coincident.
Definition: SketchAPI_Sketch.cpp:1206
SketchAPI_Sketch(const std::shared_ptr< ModelAPI_Feature > &theFeature)
Constructor without values.
Definition: SketchAPI_Sketch.cpp:209
virtual std::shared_ptr< ModelAPI_AttributeSelection > external() const
External.
Definition: SketchAPI_Sketch.h:106
std::shared_ptr< SketchAPI_Circle > addCircle(double theCenterX, double theCenterY, double theRadius)
Add circle.
Definition: SketchAPI_Sketch.cpp:593
std::list< std::shared_ptr< SketchAPI_Point > > getFreePoints()
List points not connected by constraints with other sketch entitites.
Definition: SketchAPI_Sketch.cpp:380
std::shared_ptr< ModelHighAPI_Interface > setUnsignedDistance(const ModelHighAPI_RefAttr &thePoint, const ModelHighAPI_RefAttr &thePointOrLine, const ModelHighAPI_Double &theValue)
Set unsigned distance.
Definition: SketchAPI_Sketch.cpp:1254
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:106
std::shared_ptr< SketchAPI_Point > addPoint(double theX, double theY)
Add point.
Definition: SketchAPI_Sketch.cpp:452
std::shared_ptr< ModelHighAPI_Interface > setMiddlePoint(const ModelHighAPI_RefAttr &thePoint, const ModelHighAPI_RefAttr &theLine)
Set middle.
Definition: SketchAPI_Sketch.cpp:1364
std::shared_ptr< ModelHighAPI_Interface > setParallel(const ModelHighAPI_RefAttr &theLine1, const ModelHighAPI_RefAttr &theLine2)
Set parallel.
Definition: SketchAPI_Sketch.cpp:1393
virtual void dump(ModelHighAPI_Dumper &theDumper) const
Dump wrapped feature.
Definition: SketchAPI_Sketch.cpp:1591
std::shared_ptr< ModelHighAPI_Interface > setHorizontal(const ModelHighAPI_RefAttr &theLine)
Set horizontal.
Definition: SketchAPI_Sketch.cpp:1342
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:889
std::shared_ptr< SketchAPI_Ellipse > addEllipse(double theCenterX, double theCenterY, double theFocusX, double theFocusY, double theMinorRadius)
Add ellipse.
Definition: SketchAPI_Sketch.cpp:762
std::shared_ptr< ModelHighAPI_Interface > setRadius(const ModelHighAPI_RefAttr &theCircleOrArc, const ModelHighAPI_Double &theValue)
Set radius.
Definition: SketchAPI_Sketch.cpp:1417
std::shared_ptr< ModelHighAPI_Interface > setTangent(const ModelHighAPI_RefAttr &theLine, const ModelHighAPI_RefAttr &theCircle)
Set tangent.
Definition: SketchAPI_Sketch.cpp:1429
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:1051
std::shared_ptr< ModelHighAPI_Interface > setDistance(const ModelHighAPI_RefAttr &thePoint, const ModelHighAPI_RefAttr &thePointOrLine, const ModelHighAPI_Double &theValue, bool isSigned=false)
Set distance.
Definition: SketchAPI_Sketch.cpp:1230
std::shared_ptr< ModelHighAPI_Interface > setVertical(const ModelHighAPI_RefAttr &theLine)
Set vertical.
Definition: SketchAPI_Sketch.cpp:1441
virtual std::shared_ptr< ModelAPI_AttributeString > solverDOF() const
Solver DOF.
Definition: SketchAPI_Sketch.h:106
virtual std::shared_ptr< ModelAPI_AttributeRefList > features() const
Features.
Definition: SketchAPI_Sketch.h:106
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:1011
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 > setAngleComplementary(const ModelHighAPI_RefAttr &theLine1, const ModelHighAPI_RefAttr &theLine2, const ModelHighAPI_Double &theValue)
Set complementary angle.
Definition: SketchAPI_Sketch.cpp:1170
virtual ~SketchAPI_Sketch()
Destructor.
Definition: SketchAPI_Sketch.cpp:246
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:837
std::shared_ptr< ModelHighAPI_Interface > setEqual(const ModelHighAPI_RefAttr &theObject1, const ModelHighAPI_RefAttr &theObject2)
Set equal.
Definition: SketchAPI_Sketch.cpp:1292
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:106
virtual std::shared_ptr< ModelAPI_AttributeString > solverError() const
Solver error.
Definition: SketchAPI_Sketch.h:106
std::shared_ptr< ModelHighAPI_Interface > setSignedDistance(const ModelHighAPI_RefAttr &thePoint, const ModelHighAPI_RefAttr &thePointOrLine, const ModelHighAPI_Double &theValue)
Set signed distance.
Definition: SketchAPI_Sketch.cpp:1246
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:1078
std::shared_ptr< ModelHighAPI_Interface > setFixed(const ModelHighAPI_RefAttr &theObject)
Set fixed.
Definition: SketchAPI_Sketch.cpp:1332
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:1064
std::shared_ptr< ModelHighAPI_Interface > setPerpendicular(const ModelHighAPI_RefAttr &theLine1, const ModelHighAPI_RefAttr &theLine2)
Set perpendicular.
Definition: SketchAPI_Sketch.cpp:1405
std::shared_ptr< ModelHighAPI_Interface > setFilletWithRadius(const ModelHighAPI_RefAttr &thePoint, const ModelHighAPI_Double &theRadius)
Set fillet with additional radius constraint.
Definition: SketchAPI_Sketch.cpp:1314
void setExternal(const ModelHighAPI_Selection &theExternal)
Set external.
Definition: SketchAPI_Sketch.cpp:286
std::shared_ptr< SketchAPI_Rectangle > 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:569
virtual std::shared_ptr< GeomDataAPI_Dir > dirX() const
Direction of X.
Definition: SketchAPI_Sketch.h:106
std::shared_ptr< SketchAPI_Projection > addProjection(const ModelHighAPI_Selection &theExternalFeature, bool keepResult=false, bool keepRefToOriginal=true)
Add projection.
Definition: SketchAPI_Sketch.cpp:1026
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:1041
std::shared_ptr< ModelHighAPI_Interface > setVerticalDistance(const ModelHighAPI_RefAttr &thePoint1, const ModelHighAPI_RefAttr &thePoint2, const ModelHighAPI_Double &theValue)
Set vertical distance.
Definition: SketchAPI_Sketch.cpp:1277
std::shared_ptr< ModelHighAPI_Interface > setFillet(const ModelHighAPI_RefAttr &thePoint)
Set fillet.
Definition: SketchAPI_Sketch.cpp:1304
void move(const ModelHighAPI_RefAttr &theMovedEntity, const std::shared_ptr< GeomAPI_Pnt2d > &theTargetPoint)
Move point or sketch feature.
Definition: SketchAPI_Sketch.cpp:1453
std::shared_ptr< ModelHighAPI_Interface > setAngle(const ModelHighAPI_RefAttr &theLine1, const ModelHighAPI_RefAttr &theLine2, const ModelHighAPI_Double &theValue, const std::string &type=std::string())
Set angle.
Definition: SketchAPI_Sketch.cpp:1130
std::shared_ptr< ModelHighAPI_Interface > setLength(const ModelHighAPI_RefAttr &theLine, const ModelHighAPI_Double &theValue)
Set length.
Definition: SketchAPI_Sketch.cpp:1352
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:668
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:1112
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:999
std::shared_ptr< ModelHighAPI_Interface > setHorizontalDistance(const ModelHighAPI_RefAttr &thePoint1, const ModelHighAPI_RefAttr &thePoint2, const ModelHighAPI_Double &theValue)
Set horizontal distance.
Definition: SketchAPI_Sketch.cpp:1262
std::shared_ptr< ModelHighAPI_Interface > setCollinear(const ModelHighAPI_RefAttr &theLine1, const ModelHighAPI_RefAttr &theLine2)
Set collinear.
Definition: SketchAPI_Sketch.cpp:1218
std::shared_ptr< ModelHighAPI_Interface > addSplit(const ModelHighAPI_Reference &theFeature, const std::shared_ptr< GeomAPI_Pnt2d > &thePositionPoint)
Add split.
Definition: SketchAPI_Sketch.cpp:1094
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:87
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:80
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:74
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