Salome HOME
Updated copyright comment
[modules/shaper.git] / src / SketchAPI / SketchAPI_Sketch.h
1 // Copyright (C) 2014-2024  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 //--------------------------------------------------------------------------------------
37 class ModelAPI_CompositeFeature;
38 class ModelAPI_Object;
39 class ModelHighAPI_Integer;
40 class ModelHighAPI_RefAttr;
41 class ModelHighAPI_Reference;
42 class SketchAPI_Arc;
43 class SketchAPI_MacroArc;
44 class SketchAPI_Circle;
45 class SketchAPI_MacroCircle;
46 class SketchAPI_Ellipse;
47 class SketchAPI_MacroEllipse;
48 class SketchAPI_EllipticArc;
49 class SketchAPI_MacroEllipticArc;
50 class SketchAPI_BSpline;
51 class SketchAPI_IntersectionPoint;
52 class SketchAPI_Line;
53 class SketchAPI_Mirror;
54 class SketchAPI_Offset;
55 class SketchAPI_Point;
56 class SketchAPI_Projection;
57 class SketchAPI_Rectangle;
58 class SketchAPI_Rotation;
59 class SketchAPI_Translation;
60 class SketchAPI_MacroMiddlePoint;
61
62 //--------------------------------------------------------------------------------------
63 typedef std::pair<std::shared_ptr<GeomAPI_Pnt2d>, ModelHighAPI_RefAttr> PointOrReference;
64 //--------------------------------------------------------------------------------------
65 /**\class SketchAPI_Sketch
66  * \ingroup CPPHighAPI
67  * \brief Interface for Sketch feature
68  */
69 class SketchAPI_Sketch : public ModelHighAPI_Interface
70 {
71 public:
72   /// Constructor without values
73   SKETCHAPI_EXPORT
74   explicit SketchAPI_Sketch(const std::shared_ptr<ModelAPI_Feature> & theFeature);
75   /// Constructor with values
76   SKETCHAPI_EXPORT
77   SketchAPI_Sketch(const std::shared_ptr<ModelAPI_Feature> & theFeature,
78                    const std::shared_ptr<GeomAPI_Ax3> & thePlane);
79   /// Constructor with values
80   SKETCHAPI_EXPORT
81   SketchAPI_Sketch(const std::shared_ptr<ModelAPI_Feature> & theFeature,
82                    const ModelHighAPI_Selection & theExternal);
83   /// Constructor with values
84   SKETCHAPI_EXPORT
85   SketchAPI_Sketch(const std::shared_ptr<ModelAPI_Feature> & theFeature,
86                    std::shared_ptr<ModelAPI_Object> thePlaneObject);
87   /// Destructor
88   SKETCHAPI_EXPORT
89   virtual ~SketchAPI_Sketch();
90
91   INTERFACE_7(SketchPlugin_Sketch::ID(),
92               origin, SketchPlugin_Sketch::ORIGIN_ID(),
93               GeomDataAPI_Point, /** Origin point */,
94               dirX, SketchPlugin_Sketch::DIRX_ID(),
95               GeomDataAPI_Dir, /** Direction of X */,
96               normal, SketchPlugin_Sketch::NORM_ID(),
97               GeomDataAPI_Dir, /** Normal */,
98               features, SketchPlugin_Sketch::FEATURES_ID(),
99               ModelAPI_AttributeRefList, /** Features */,
100               external, SketchPlugin_SketchEntity::EXTERNAL_ID(),
101               ModelAPI_AttributeSelection, /** External */,
102               solverError, SketchPlugin_Sketch::SOLVER_ERROR(),
103               ModelAPI_AttributeString, /** Solver error */,
104               solverDOF, SketchPlugin_Sketch::SOLVER_DOF(),
105               ModelAPI_AttributeString, /** Solver DOF */
106   )
107
108   /// Set plane
109   SKETCHAPI_EXPORT
110   void setPlane(const std::shared_ptr<GeomAPI_Ax3> & thePlane);
111
112   /// Change sketch plane
113   SKETCHAPI_EXPORT
114   void setPlane(const ModelHighAPI_Selection & thePlane,
115                 bool theRemoveExternalDependency = false);
116
117   /// Set external
118   SKETCHAPI_EXPORT
119   void setExternal(const ModelHighAPI_Selection & theExternal);
120
121   /// Set external
122   SKETCHAPI_EXPORT
123   void setExternal(std::shared_ptr<ModelAPI_Object> thePlaneObject);
124
125   /// Change order of sketch results (faces)
126   SKETCHAPI_EXPORT
127   void changeFacesOrder(const std::list<std::list<ModelHighAPI_Selection> >& theFaces);
128
129   /// List points not connected by constraints with other sketch entitites
130   SKETCHAPI_EXPORT
131   std::list< std::shared_ptr<SketchAPI_Point> > getFreePoints();
132
133   /// Add point
134   SKETCHAPI_EXPORT
135   std::shared_ptr<SketchAPI_Point> addPoint(
136       double theX, double theY);
137   /// Add point
138   SKETCHAPI_EXPORT
139   std::shared_ptr<SketchAPI_Point> addPoint(
140       const std::shared_ptr<GeomAPI_Pnt2d> & thePoint);
141   /// Add point
142   SKETCHAPI_EXPORT
143   std::shared_ptr<SketchAPI_Point> addPoint(const ModelHighAPI_Selection & theExternal);
144   /// Add point
145   SKETCHAPI_EXPORT
146   std::shared_ptr<SketchAPI_Point> addPoint(const std::wstring & theExternalName);
147
148   /// Add intersection point
149   SKETCHAPI_EXPORT
150   std::shared_ptr<SketchAPI_IntersectionPoint>
151     addIntersectionPoint(const ModelHighAPI_Selection & theExternal,
152                          bool theKeepResult = false);
153   /// Add point
154   SKETCHAPI_EXPORT
155   std::shared_ptr<SketchAPI_IntersectionPoint>
156     addIntersectionPoint(const std::wstring & theExternalName,
157                          bool theKeepResult = false);
158
159   /// Add line
160   SKETCHAPI_EXPORT
161   std::shared_ptr<SketchAPI_Line> addLine(
162       double theX1, double theY1, double theX2, double theY2);
163   /// Add line
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);
168   /// Add line
169   SKETCHAPI_EXPORT
170   std::shared_ptr<SketchAPI_Line> addLine(const ModelHighAPI_Selection & theExternal);
171   /// Add line
172   SKETCHAPI_EXPORT
173   std::shared_ptr<SketchAPI_Line> addLine(const std::wstring & theExternalName);
174
175   /// Add rectangle
176   SKETCHAPI_EXPORT
177   std::shared_ptr<SketchAPI_Rectangle> addRectangle(
178       double theX1, double theY1, double theX2, double theY2);
179   /// Add rectangle
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);
184   /// Add rectangle
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
190   /// Add circle
191   SKETCHAPI_EXPORT
192   std::shared_ptr<SketchAPI_Circle> addCircle(
193       double theCenterX, double theCenterY,
194       double theRadius);
195   /// Add circle
196   SKETCHAPI_EXPORT
197   std::shared_ptr<SketchAPI_Circle> addCircle(
198       const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
199       double theRadius);
200   /// Add circle
201   SKETCHAPI_EXPORT
202   std::shared_ptr<SketchAPI_MacroCircle> addCircle(
203       double theCenterX, double theCenterY,
204       double thePassedX, double thePassedY);
205   /// Add circle
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);
210   /// Add circle
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);
216   /// Add circle
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);
222   /// Add circle
223   SKETCHAPI_EXPORT
224   std::shared_ptr<SketchAPI_Circle> addCircle(const ModelHighAPI_Selection & theExternal);
225   /// Add circle
226   SKETCHAPI_EXPORT
227   std::shared_ptr<SketchAPI_Circle> addCircle(const std::wstring & theExternalName);
228
229   /// Add arc
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
237   /// Add arc
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
245   /// Add arc
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
252   /// Add arc
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
259   /// Add transversal/tangent arc
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
267   /// Add transversal/tangent arc
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
275   /// Add arc
276   SKETCHAPI_EXPORT
277   std::shared_ptr<SketchAPI_Arc> addArc(const ModelHighAPI_Selection & theExternal);
278
279   /// Add arc
280   SKETCHAPI_EXPORT
281   std::shared_ptr<SketchAPI_Arc> addArc(const std::wstring & theExternalName);
282
283   /// Add ellipse
284   SKETCHAPI_EXPORT
285   std::shared_ptr<SketchAPI_Ellipse> addEllipse(
286       double theCenterX, double theCenterY,
287       double theFocusX, double theFocusY,
288       double theMinorRadius);
289   /// Add ellipse
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);
295   /// Add ellipse
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);
302   /// Add ellipse
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);
309   /// Add ellipse
310   SKETCHAPI_EXPORT
311   std::shared_ptr<SketchAPI_Ellipse> addEllipse(const ModelHighAPI_Selection & theExternal);
312   /// Add ellipse
313   SKETCHAPI_EXPORT
314   std::shared_ptr<SketchAPI_Ellipse> addEllipse(const std::wstring & theExternalName);
315
316   /// Add elliptic arc
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);
324   /// Add elliptic arc
325   SKETCHAPI_EXPORT
326   std::shared_ptr<SketchAPI_MacroEllipticArc> addEllipticArc(
327       const PointOrReference& theCenter,
328       const PointOrReference& theMajorAxisPoint,
329       const PointOrReference& theStartPoint,
330       const PointOrReference& theEndPoint,
331       bool theInversed = false);
332   /// Add elliptic arc
333   SKETCHAPI_EXPORT
334   std::shared_ptr<SketchAPI_EllipticArc> addEllipticArc(const ModelHighAPI_Selection & theExternal);
335   /// Add elliptic arc
336   SKETCHAPI_EXPORT
337   std::shared_ptr<SketchAPI_EllipticArc> addEllipticArc(const std::wstring & theExternalName);
338
339   /// Add B-spline
340   SKETCHAPI_EXPORT
341   std::shared_ptr<SketchAPI_BSpline> addSpline(
342       const ModelHighAPI_Selection & external = ModelHighAPI_Selection(),
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
350   /// Add interpolation feature
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
357   /// Add approximation feature
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
365   /// Add projection
366   SKETCHAPI_EXPORT
367   std::shared_ptr<SketchAPI_Projection> addProjection(
368       const ModelHighAPI_Selection & theExternalFeature,
369       bool keepResult = false,
370       bool keepRefToOriginal = true);
371
372   /// Add mirror
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
378   /// Add offset
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
387   /// Add translation
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
396   /// Add rotation
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
406   /// Add split
407   SKETCHAPI_EXPORT
408   std::shared_ptr<ModelHighAPI_Interface> addSplit(
409       const ModelHighAPI_Reference& theFeature,
410       const std::shared_ptr<GeomAPI_Pnt2d>& thePositionPoint);
411
412   /// Add trim
413   SKETCHAPI_EXPORT
414   std::shared_ptr<ModelHighAPI_Interface> addTrim(
415       const ModelHighAPI_Reference& theFeature,
416       const std::shared_ptr<GeomAPI_Pnt2d>& thePositionPoint);
417
418   /// Set angle
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
426   /// Set complementary angle
427   SKETCHAPI_EXPORT
428   std::shared_ptr<ModelHighAPI_Interface> setAngleComplementary(
429       const ModelHighAPI_RefAttr & theLine1,
430       const ModelHighAPI_RefAttr & theLine2,
431       const ModelHighAPI_Double & theValue);
432
433   /// Set backward angle (= 360 - angle)
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
440   /// Set coincident
441   SKETCHAPI_EXPORT
442   std::shared_ptr<ModelHighAPI_Interface> setCoincident(
443       const ModelHighAPI_RefAttr & thePoint1,
444       const ModelHighAPI_RefAttr & thePoint2);
445
446   /// Set collinear
447   SKETCHAPI_EXPORT
448   std::shared_ptr<ModelHighAPI_Interface> setCollinear(
449       const ModelHighAPI_RefAttr & theLine1,
450       const ModelHighAPI_RefAttr & theLine2);
451
452   /// Set distance
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
460   /// Set signed distance
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
467   /// Set unsigned distance
468   SKETCHAPI_EXPORT
469   std::shared_ptr<ModelHighAPI_Interface> setUnsignedDistance(
470       const ModelHighAPI_RefAttr & thePoint,
471       const ModelHighAPI_RefAttr & thePointOrLine,
472       const ModelHighAPI_Double & theValue);
473
474   /// Set horizontal distance
475   SKETCHAPI_EXPORT
476   std::shared_ptr<ModelHighAPI_Interface> setHorizontalDistance(
477       const ModelHighAPI_RefAttr & thePoint1,
478       const ModelHighAPI_RefAttr & thePoint2,
479       const ModelHighAPI_Double & theValue);
480
481   /// Set vertical distance
482   SKETCHAPI_EXPORT
483   std::shared_ptr<ModelHighAPI_Interface> setVerticalDistance(
484       const ModelHighAPI_RefAttr & thePoint1,
485       const ModelHighAPI_RefAttr & thePoint2,
486       const ModelHighAPI_Double & theValue);
487
488   /// Set equal
489   SKETCHAPI_EXPORT
490   std::shared_ptr<ModelHighAPI_Interface> setEqual(
491       const ModelHighAPI_RefAttr & theObject1,
492       const ModelHighAPI_RefAttr & theObject2);
493
494   /// Set fillet
495   SKETCHAPI_EXPORT
496   std::shared_ptr<ModelHighAPI_Interface> setFillet(
497       const ModelHighAPI_RefAttr & thePoint);
498
499   /// Set fillet with additional radius constraint
500   SKETCHAPI_EXPORT
501   std::shared_ptr<ModelHighAPI_Interface> setFilletWithRadius(
502       const ModelHighAPI_RefAttr & thePoint,
503       const ModelHighAPI_Double & theRadius);
504
505   /// Set fixed
506   SKETCHAPI_EXPORT
507   std::shared_ptr<ModelHighAPI_Interface> setFixed(
508       const ModelHighAPI_RefAttr & theObject);
509
510   /// Set horizontal
511   SKETCHAPI_EXPORT
512   std::shared_ptr<ModelHighAPI_Interface> setHorizontal(
513       const ModelHighAPI_RefAttr & theLine);
514
515   /// Set length
516   SKETCHAPI_EXPORT
517   std::shared_ptr<ModelHighAPI_Interface> setLength(
518       const ModelHighAPI_RefAttr & theLine,
519       const ModelHighAPI_Double & theValue);
520
521   /// Set middle
522   SKETCHAPI_EXPORT
523   std::shared_ptr<ModelHighAPI_Interface> setMiddlePoint(
524       const ModelHighAPI_RefAttr & thePoint,
525       const ModelHighAPI_RefAttr & theLine);
526
527   /// Set middle
528   SKETCHAPI_EXPORT
529     std::shared_ptr<SketchAPI_MacroMiddlePoint> setMiddlePoint(
530       const ModelHighAPI_RefAttr& theLine);
531
532   /// Set parallel
533   SKETCHAPI_EXPORT
534   std::shared_ptr<ModelHighAPI_Interface> setParallel(
535       const ModelHighAPI_RefAttr & theLine1,
536       const ModelHighAPI_RefAttr & theLine2);
537
538   /// Set perpendicular
539   SKETCHAPI_EXPORT
540   std::shared_ptr<ModelHighAPI_Interface> setPerpendicular(
541       const ModelHighAPI_RefAttr & theLine1,
542       const ModelHighAPI_RefAttr & theLine2);
543
544   /// Set radius
545   SKETCHAPI_EXPORT
546   std::shared_ptr<ModelHighAPI_Interface> setRadius(
547       const ModelHighAPI_RefAttr & theCircleOrArc,
548       const ModelHighAPI_Double & theValue);
549
550   /// Set tangent
551   SKETCHAPI_EXPORT
552   std::shared_ptr<ModelHighAPI_Interface> setTangent(
553       const ModelHighAPI_RefAttr & theLine,
554       const ModelHighAPI_RefAttr & theCircle);
555
556   /// Set vertical
557   SKETCHAPI_EXPORT
558   std::shared_ptr<ModelHighAPI_Interface> setVertical(
559       const ModelHighAPI_RefAttr & theLine);
560
561   /// Set constraint value
562   SKETCHAPI_EXPORT
563   void setValue(
564       const std::shared_ptr<ModelHighAPI_Interface> & theConstraint,
565       const ModelHighAPI_Double & theValue);
566
567   /// Move point or sketch feature
568   SKETCHAPI_EXPORT
569   void move(const ModelHighAPI_RefAttr& theMovedEntity,
570             const std::shared_ptr<GeomAPI_Pnt2d>& theTargetPoint);
571
572   /// Move point or sketch feature
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)
581   /// Select face
582   SKETCHAPI_EXPORT
583   std::list<ModelHighAPI_Selection> selectFace() const;
584
585   /// Dump wrapped feature
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
594 //! Pointer on Sketch object
595 typedef std::shared_ptr<SketchAPI_Sketch> SketchPtr;
596
597 //--------------------------------------------------------------------------------------
598
599 /**\ingroup CPPHighAPI
600  * \brief Create Sketch feature
601  */
602 SKETCHAPI_EXPORT
603 SketchPtr addSketch(const std::shared_ptr<ModelAPI_Document> & thePart,
604                     const std::shared_ptr<GeomAPI_Ax3> & thePlane);
605
606 /**\ingroup CPPHighAPI
607  * \brief Create Sketch feature
608  */
609 SKETCHAPI_EXPORT
610 SketchPtr addSketch(const std::shared_ptr<ModelAPI_Document> & thePart,
611                     const ModelHighAPI_Selection & theExternal);
612
613 /**\ingroup CPPHighAPI
614  * \brief Create Sketch feature
615  */
616 SKETCHAPI_EXPORT
617 SketchPtr addSketch(const std::shared_ptr<ModelAPI_Document> & thePart,
618                     const std::wstring & theExternalName);
619
620 /**\ingroup CPPHighAPI
621  * \brief Create Sketch feature
622  */
623 SKETCHAPI_EXPORT
624 SketchPtr addSketch(const std::shared_ptr<ModelAPI_Document> & thePart,
625                     std::shared_ptr<ModelAPI_Object> thePlaneObject);
626
627 //--------------------------------------------------------------------------------------
628
629 /** \ingroup CPPHighAPI
630  *  \brief Copy sketch with all its sub-features
631  */
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_ */