Salome HOME
Sketcher Offset: API
[modules/shaper.git] / src / SketchAPI / SketchAPI_Sketch.h
1 // Copyright (C) 2014-2019  CEA/DEN, EDF R&D
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
31 #include <ModelHighAPI_Double.h>
32 #include <ModelHighAPI_Interface.h>
33 #include <ModelHighAPI_Macro.h>
34 #include <ModelHighAPI_Selection.h>
35 //--------------------------------------------------------------------------------------
36 class ModelAPI_CompositeFeature;
37 class ModelAPI_Object;
38 class ModelHighAPI_Integer;
39 class ModelHighAPI_RefAttr;
40 class ModelHighAPI_Reference;
41 class SketchAPI_Arc;
42 class SketchAPI_MacroArc;
43 class SketchAPI_Circle;
44 class SketchAPI_MacroCircle;
45 class SketchAPI_Ellipse;
46 class SketchAPI_MacroEllipse;
47 class SketchAPI_EllipticArc;
48 class SketchAPI_MacroEllipticArc;
49 class SketchAPI_BSpline;
50 class SketchAPI_IntersectionPoint;
51 class SketchAPI_Line;
52 class SketchAPI_Mirror;
53 class SketchAPI_Offset;
54 class SketchAPI_Point;
55 class SketchAPI_Projection;
56 class SketchAPI_Rectangle;
57 class SketchAPI_Rotation;
58 class SketchAPI_Translation;
59 //--------------------------------------------------------------------------------------
60 typedef std::pair<std::shared_ptr<GeomAPI_Pnt2d>, ModelHighAPI_RefAttr> PointOrReference;
61 //--------------------------------------------------------------------------------------
62 /**\class SketchAPI_Sketch
63  * \ingroup CPPHighAPI
64  * \brief Interface for Sketch feature
65  */
66 class SketchAPI_Sketch : public ModelHighAPI_Interface
67 {
68 public:
69   /// Constructor without values
70   SKETCHAPI_EXPORT
71   explicit SketchAPI_Sketch(const std::shared_ptr<ModelAPI_Feature> & theFeature);
72   /// Constructor with values
73   SKETCHAPI_EXPORT
74   SketchAPI_Sketch(const std::shared_ptr<ModelAPI_Feature> & theFeature,
75                    const std::shared_ptr<GeomAPI_Ax3> & thePlane);
76   /// Constructor with values
77   SKETCHAPI_EXPORT
78   SketchAPI_Sketch(const std::shared_ptr<ModelAPI_Feature> & theFeature,
79                    const ModelHighAPI_Selection & theExternal);
80   /// Constructor with values
81   SKETCHAPI_EXPORT
82   SketchAPI_Sketch(const std::shared_ptr<ModelAPI_Feature> & theFeature,
83                    std::shared_ptr<ModelAPI_Object> thePlaneObject);
84   /// Destructor
85   SKETCHAPI_EXPORT
86   virtual ~SketchAPI_Sketch();
87
88   INTERFACE_7(SketchPlugin_Sketch::ID(),
89               origin, SketchPlugin_Sketch::ORIGIN_ID(),
90               GeomDataAPI_Point, /** Origin point */,
91               dirX, SketchPlugin_Sketch::DIRX_ID(),
92               GeomDataAPI_Dir, /** Direction of X */,
93               normal, SketchPlugin_Sketch::NORM_ID(),
94               GeomDataAPI_Dir, /** Normal */,
95               features, SketchPlugin_Sketch::FEATURES_ID(),
96               ModelAPI_AttributeRefList, /** Features */,
97               external, SketchPlugin_SketchEntity::EXTERNAL_ID(),
98               ModelAPI_AttributeSelection, /** External */,
99               solverError, SketchPlugin_Sketch::SOLVER_ERROR(),
100               ModelAPI_AttributeString, /** Solver error */,
101               solverDOF, SketchPlugin_Sketch::SOLVER_DOF(),
102               ModelAPI_AttributeString, /** Solver DOF */
103   )
104
105   /// Set plane
106   SKETCHAPI_EXPORT
107   void setPlane(const std::shared_ptr<GeomAPI_Ax3> & thePlane);
108
109   /// Change sketch plane
110   SKETCHAPI_EXPORT
111   void setPlane(const ModelHighAPI_Selection & thePlane,
112                 bool theRemoveExternalDependency = false);
113
114   /// Set external
115   SKETCHAPI_EXPORT
116   void setExternal(const ModelHighAPI_Selection & theExternal);
117
118   /// Set external
119   SKETCHAPI_EXPORT
120   void setExternal(std::shared_ptr<ModelAPI_Object> thePlaneObject);
121
122   /// Change order of sketch results (faces)
123   SKETCHAPI_EXPORT
124   void changeFacesOrder(const std::list<std::list<ModelHighAPI_Selection> >& theFaces);
125
126   /// List points not connected by constraints with other sketch entitites
127   SKETCHAPI_EXPORT
128   std::list< std::shared_ptr<SketchAPI_Point> > getFreePoints();
129
130   /// Add point
131   SKETCHAPI_EXPORT
132   std::shared_ptr<SketchAPI_Point> addPoint(
133       double theX, double theY);
134   /// Add point
135   SKETCHAPI_EXPORT
136   std::shared_ptr<SketchAPI_Point> addPoint(
137       const std::shared_ptr<GeomAPI_Pnt2d> & thePoint);
138   /// Add point
139   SKETCHAPI_EXPORT
140   std::shared_ptr<SketchAPI_Point> addPoint(const ModelHighAPI_Selection & theExternal);
141   /// Add point
142   SKETCHAPI_EXPORT
143   std::shared_ptr<SketchAPI_Point> addPoint(const std::string & theExternalName);
144
145   /// Add intersection point
146   SKETCHAPI_EXPORT
147   std::shared_ptr<SketchAPI_IntersectionPoint>
148     addIntersectionPoint(const ModelHighAPI_Selection & theExternal,
149                          bool theKeepResult = false);
150   /// Add point
151   SKETCHAPI_EXPORT
152   std::shared_ptr<SketchAPI_IntersectionPoint>
153     addIntersectionPoint(const std::string & theExternalName,
154                          bool theKeepResult = false);
155
156   /// Add line
157   SKETCHAPI_EXPORT
158   std::shared_ptr<SketchAPI_Line> addLine(
159       double theX1, double theY1, double theX2, double theY2);
160   /// Add line
161   SKETCHAPI_EXPORT
162   std::shared_ptr<SketchAPI_Line> addLine(
163       const std::shared_ptr<GeomAPI_Pnt2d> & theStartPoint,
164       const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint);
165   /// Add line
166   SKETCHAPI_EXPORT
167   std::shared_ptr<SketchAPI_Line> addLine(const ModelHighAPI_Selection & theExternal);
168   /// Add line
169   SKETCHAPI_EXPORT
170   std::shared_ptr<SketchAPI_Line> addLine(const std::string & theExternalName);
171
172   /// Add rectangle
173   SKETCHAPI_EXPORT
174   std::shared_ptr<SketchAPI_Rectangle> addRectangle(
175       double theX1, double theY1, double theX2, double theY2);
176   /// Add rectangle
177   SKETCHAPI_EXPORT
178   std::shared_ptr<SketchAPI_Rectangle> addRectangle(
179       const std::shared_ptr<GeomAPI_Pnt2d> & theStartPoint,
180       const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint);
181
182   /// Add circle
183   SKETCHAPI_EXPORT
184   std::shared_ptr<SketchAPI_Circle> addCircle(
185       double theCenterX, double theCenterY,
186       double theRadius);
187   /// Add circle
188   SKETCHAPI_EXPORT
189   std::shared_ptr<SketchAPI_Circle> addCircle(
190       const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
191       double theRadius);
192   /// Add circle
193   SKETCHAPI_EXPORT
194   std::shared_ptr<SketchAPI_MacroCircle> addCircle(
195       double theCenterX, double theCenterY,
196       double thePassedX, double thePassedY);
197   /// Add circle
198   SKETCHAPI_EXPORT
199   std::shared_ptr<SketchAPI_MacroCircle> addCircle(
200       const std::shared_ptr<GeomAPI_Pnt2d>& theCenterPoint,
201       const std::shared_ptr<GeomAPI_Pnt2d>& thePassedPoint);
202   /// Add circle
203   SKETCHAPI_EXPORT
204   std::shared_ptr<SketchAPI_MacroCircle> addCircle(
205       double theX1, double theY1,
206       double theX2, double theY2,
207       double theX3, double theY3);
208   /// Add circle
209   SKETCHAPI_EXPORT
210   std::shared_ptr<SketchAPI_MacroCircle> addCircle(
211       const std::shared_ptr<GeomAPI_Pnt2d>& thePoint1,
212       const std::shared_ptr<GeomAPI_Pnt2d>& thePoint2,
213       const std::shared_ptr<GeomAPI_Pnt2d>& thePoint3);
214   /// Add circle
215   SKETCHAPI_EXPORT
216   std::shared_ptr<SketchAPI_Circle> addCircle(const ModelHighAPI_Selection & theExternal);
217   /// Add circle
218   SKETCHAPI_EXPORT
219   std::shared_ptr<SketchAPI_Circle> addCircle(const std::string & theExternalName);
220
221   /// Add arc
222   SKETCHAPI_EXPORT
223   std::shared_ptr<SketchAPI_Arc> addArc(
224       double theCenterX, double theCenterY,
225       double theStartX, double theStartY,
226       double theEndX, double theEndY,
227       bool theInversed);
228
229   /// Add arc
230   SKETCHAPI_EXPORT
231   std::shared_ptr<SketchAPI_Arc> addArc(
232       const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
233       const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
234       const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
235       bool theInversed);
236
237   /// Add arc
238   SKETCHAPI_EXPORT
239   std::shared_ptr<SketchAPI_MacroArc> addArc(
240       double theStartX, double theStartY,
241       double theEndX, double theEndY,
242       double thePassedX, double thePassedY);
243
244   /// Add arc
245   SKETCHAPI_EXPORT
246   std::shared_ptr<SketchAPI_MacroArc> addArc(
247       const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
248       const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
249       const std::shared_ptr<GeomAPI_Pnt2d>& thePassed);
250
251   /// Add transversal/tangent arc
252   SKETCHAPI_EXPORT
253   std::shared_ptr<SketchAPI_MacroArc> addArc(
254       const ModelHighAPI_RefAttr& theConnectedPoint,
255       double theEndX, double theEndY,
256       bool theInversed,
257       bool theTransversal = false);
258
259   /// Add transversal/tangent arc
260   SKETCHAPI_EXPORT
261   std::shared_ptr<SketchAPI_MacroArc> addArc(
262       const ModelHighAPI_RefAttr& theConnectedPoint,
263       const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
264       bool theInversed,
265       bool theTransversal = false);
266
267   /// Add arc
268   SKETCHAPI_EXPORT
269   std::shared_ptr<SketchAPI_Arc> addArc(const ModelHighAPI_Selection & theExternal);
270
271   /// Add arc
272   SKETCHAPI_EXPORT
273   std::shared_ptr<SketchAPI_Arc> addArc(const std::string & theExternalName);
274
275   /// Add ellipse
276   SKETCHAPI_EXPORT
277   std::shared_ptr<SketchAPI_Ellipse> addEllipse(
278       double theCenterX, double theCenterY,
279       double theFocusX, double theFocusY,
280       double theMinorRadius);
281   /// Add ellipse
282   SKETCHAPI_EXPORT
283   std::shared_ptr<SketchAPI_Ellipse> addEllipse(
284       const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
285       const std::shared_ptr<GeomAPI_Pnt2d>& theFocus,
286       double theRadius);
287   /// Add ellipse
288   SKETCHAPI_EXPORT
289   std::shared_ptr<SketchAPI_MacroEllipse> addEllipse(
290       double thePoint1X, double thePoint1Y,
291       double thePoint2X, double thePoint2Y,
292       double thePassedX, double thePassedY,
293       bool isPoint1Center = true);
294   /// Add ellipse
295   SKETCHAPI_EXPORT
296   std::shared_ptr<SketchAPI_MacroEllipse> addEllipse(
297       const PointOrReference& thePoint1,
298       const PointOrReference& thePoint2,
299       const PointOrReference& thePassedPoint,
300       bool isPoint1Center = true);
301   /// Add ellipse
302   SKETCHAPI_EXPORT
303   std::shared_ptr<SketchAPI_Ellipse> addEllipse(const ModelHighAPI_Selection & theExternal);
304   /// Add ellipse
305   SKETCHAPI_EXPORT
306   std::shared_ptr<SketchAPI_Ellipse> addEllipse(const std::string & theExternalName);
307
308   /// Add elliptic arc
309   SKETCHAPI_EXPORT
310   std::shared_ptr<SketchAPI_EllipticArc> addEllipticArc(
311       double theCenterX, double theCenterY,
312       double theFocusX, double theFocusY,
313       double theStartX, double theStartY,
314       double theEndX, double theEndY,
315       bool theInversed = false);
316   /// Add elliptic arc
317   SKETCHAPI_EXPORT
318   std::shared_ptr<SketchAPI_MacroEllipticArc> addEllipticArc(
319       const PointOrReference& theCenter,
320       const PointOrReference& theMajorAxisPoint,
321       const PointOrReference& theStartPoint,
322       const PointOrReference& theEndPoint,
323       bool theInversed = false);
324   /// Add elliptic arc
325   SKETCHAPI_EXPORT
326   std::shared_ptr<SketchAPI_EllipticArc> addEllipticArc(const ModelHighAPI_Selection & theExternal);
327   /// Add elliptic arc
328   SKETCHAPI_EXPORT
329   std::shared_ptr<SketchAPI_EllipticArc> addEllipticArc(const std::string & theExternalName);
330
331   /// Add B-spline
332   SKETCHAPI_EXPORT
333   std::shared_ptr<SketchAPI_BSpline> addSpline(
334       const ModelHighAPI_Selection & external = ModelHighAPI_Selection(),
335       const int degree = -1,
336       const std::list<PointOrReference>& poles = std::list<PointOrReference>(),
337       const std::list<ModelHighAPI_Double>& weights = std::list<ModelHighAPI_Double>(),
338       const std::list<ModelHighAPI_Double>& knots = std::list<ModelHighAPI_Double>(),
339       const std::list<ModelHighAPI_Integer>& multiplicities = std::list<ModelHighAPI_Integer>(),
340       const bool periodic = false);
341
342   /// Add interpolation feature
343   SKETCHAPI_EXPORT
344   std::shared_ptr<SketchAPI_BSpline> addInterpolation(
345       const std::list<ModelHighAPI_RefAttr>& points,
346       const bool periodic = false,
347       const bool closed = false);
348
349   /// Add approximation feature
350   SKETCHAPI_EXPORT
351   std::shared_ptr<SketchAPI_BSpline> addApproximation(
352       const std::list<ModelHighAPI_RefAttr>& points,
353       const ModelHighAPI_Double& precision = ModelHighAPI_Double(1.e-3),
354       const bool periodic = false,
355       const bool closed = false);
356
357   /// Add projection
358   SKETCHAPI_EXPORT
359   std::shared_ptr<SketchAPI_Projection> addProjection(
360       const ModelHighAPI_Selection & theExternalFeature,
361       bool theKeepResult = false);
362
363   /// Add projection
364   SKETCHAPI_EXPORT
365   std::shared_ptr<SketchAPI_Projection> addProjection(const std::string & theExternalName,
366                                                       bool theKeepResult = false);
367
368   /// Add mirror
369   SKETCHAPI_EXPORT
370   std::shared_ptr<SketchAPI_Mirror> addMirror(
371       const ModelHighAPI_RefAttr & theMirrorLine,
372       const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects);
373
374   /// Add offset
375   SKETCHAPI_EXPORT
376   std::shared_ptr<SketchAPI_Offset> addOffset(
377       const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects,
378       const ModelHighAPI_Double & theValue,
379       const bool theReversed,
380       const bool theAuxiliary);
381
382   /// Add translation
383   SKETCHAPI_EXPORT
384   std::shared_ptr<SketchAPI_Translation> addTranslation(
385       const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects,
386       const ModelHighAPI_RefAttr & thePoint1,
387       const ModelHighAPI_RefAttr & thePoint2,
388       const ModelHighAPI_Integer & theNumberOfObjects,
389       bool theFullValue = false);
390
391   /// Add rotation
392   SKETCHAPI_EXPORT
393   std::shared_ptr<SketchAPI_Rotation> addRotation(
394       const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects,
395       const ModelHighAPI_RefAttr & theCenter,
396       const ModelHighAPI_Double & theAngle,
397       const ModelHighAPI_Integer & theNumberOfObjects,
398       bool theFullValue = false,
399       bool theReversed  = false);
400
401   /// Add split
402   SKETCHAPI_EXPORT
403   std::shared_ptr<ModelHighAPI_Interface> addSplit(
404       const ModelHighAPI_Reference& theFeature,
405       const std::shared_ptr<GeomAPI_Pnt2d>& thePositionPoint);
406
407   /// Add trim
408   SKETCHAPI_EXPORT
409   std::shared_ptr<ModelHighAPI_Interface> addTrim(
410       const ModelHighAPI_Reference& theFeature,
411       const std::shared_ptr<GeomAPI_Pnt2d>& thePositionPoint);
412
413   /// Set angle
414   SKETCHAPI_EXPORT
415   std::shared_ptr<ModelHighAPI_Interface> setAngle(
416       const ModelHighAPI_RefAttr & theLine1,
417       const ModelHighAPI_RefAttr & theLine2,
418       const ModelHighAPI_Double & theValue,
419       const std::string& type = std::string());
420
421   /// Set complementary angle
422   SKETCHAPI_EXPORT
423   std::shared_ptr<ModelHighAPI_Interface> setAngleComplementary(
424       const ModelHighAPI_RefAttr & theLine1,
425       const ModelHighAPI_RefAttr & theLine2,
426       const ModelHighAPI_Double & theValue);
427
428   /// Set backward angle (= 360 - angle)
429   SKETCHAPI_EXPORT
430   std::shared_ptr<ModelHighAPI_Interface> setAngleBackward(
431       const ModelHighAPI_RefAttr & theLine1,
432       const ModelHighAPI_RefAttr & theLine2,
433       const ModelHighAPI_Double & theValue);
434
435   /// Set coincident
436   SKETCHAPI_EXPORT
437   std::shared_ptr<ModelHighAPI_Interface> setCoincident(
438       const ModelHighAPI_RefAttr & thePoint1,
439       const ModelHighAPI_RefAttr & thePoint2);
440
441   /// Set collinear
442   SKETCHAPI_EXPORT
443   std::shared_ptr<ModelHighAPI_Interface> setCollinear(
444       const ModelHighAPI_RefAttr & theLine1,
445       const ModelHighAPI_RefAttr & theLine2);
446
447   /// Set distance
448   SKETCHAPI_EXPORT
449   std::shared_ptr<ModelHighAPI_Interface> setDistance(
450       const ModelHighAPI_RefAttr & thePoint,
451       const ModelHighAPI_RefAttr & thePointOrLine,
452       const ModelHighAPI_Double & theValue,
453       bool isSigned = false);
454
455   /// Set signed distance
456   SKETCHAPI_EXPORT
457   std::shared_ptr<ModelHighAPI_Interface> setSignedDistance(
458       const ModelHighAPI_RefAttr & thePoint,
459       const ModelHighAPI_RefAttr & thePointOrLine,
460       const ModelHighAPI_Double & theValue);
461
462   /// Set unsigned distance
463   SKETCHAPI_EXPORT
464   std::shared_ptr<ModelHighAPI_Interface> setUnsignedDistance(
465       const ModelHighAPI_RefAttr & thePoint,
466       const ModelHighAPI_RefAttr & thePointOrLine,
467       const ModelHighAPI_Double & theValue);
468
469   /// Set horizontal distance
470   SKETCHAPI_EXPORT
471   std::shared_ptr<ModelHighAPI_Interface> setHorizontalDistance(
472       const ModelHighAPI_RefAttr & thePoint1,
473       const ModelHighAPI_RefAttr & thePoint2,
474       const ModelHighAPI_Double & theValue);
475
476   /// Set vertical distance
477   SKETCHAPI_EXPORT
478   std::shared_ptr<ModelHighAPI_Interface> setVerticalDistance(
479       const ModelHighAPI_RefAttr & thePoint1,
480       const ModelHighAPI_RefAttr & thePoint2,
481       const ModelHighAPI_Double & theValue);
482
483   /// Set equal
484   SKETCHAPI_EXPORT
485   std::shared_ptr<ModelHighAPI_Interface> setEqual(
486       const ModelHighAPI_RefAttr & theObject1,
487       const ModelHighAPI_RefAttr & theObject2);
488
489   /// Set fillet
490   SKETCHAPI_EXPORT
491   std::shared_ptr<ModelHighAPI_Interface> setFillet(
492       const ModelHighAPI_RefAttr & thePoint);
493
494   /// Set fillet with additional radius constraint
495   SKETCHAPI_EXPORT
496   std::shared_ptr<ModelHighAPI_Interface> setFilletWithRadius(
497       const ModelHighAPI_RefAttr & thePoint,
498       const ModelHighAPI_Double & theRadius);
499
500   /// Set fixed
501   SKETCHAPI_EXPORT
502   std::shared_ptr<ModelHighAPI_Interface> setFixed(
503       const ModelHighAPI_RefAttr & theObject);
504
505   /// Set horizontal
506   SKETCHAPI_EXPORT
507   std::shared_ptr<ModelHighAPI_Interface> setHorizontal(
508       const ModelHighAPI_RefAttr & theLine);
509
510   /// Set length
511   SKETCHAPI_EXPORT
512   std::shared_ptr<ModelHighAPI_Interface> setLength(
513       const ModelHighAPI_RefAttr & theLine,
514       const ModelHighAPI_Double & theValue);
515
516   /// Set middle
517   SKETCHAPI_EXPORT
518   std::shared_ptr<ModelHighAPI_Interface> setMiddlePoint(
519       const ModelHighAPI_RefAttr & thePoint,
520       const ModelHighAPI_RefAttr & theLine);
521
522   /// Set parallel
523   SKETCHAPI_EXPORT
524   std::shared_ptr<ModelHighAPI_Interface> setParallel(
525       const ModelHighAPI_RefAttr & theLine1,
526       const ModelHighAPI_RefAttr & theLine2);
527
528   /// Set perpendicular
529   SKETCHAPI_EXPORT
530   std::shared_ptr<ModelHighAPI_Interface> setPerpendicular(
531       const ModelHighAPI_RefAttr & theLine1,
532       const ModelHighAPI_RefAttr & theLine2);
533
534   /// Set radius
535   SKETCHAPI_EXPORT
536   std::shared_ptr<ModelHighAPI_Interface> setRadius(
537       const ModelHighAPI_RefAttr & theCircleOrArc,
538       const ModelHighAPI_Double & theValue);
539
540   /// Set tangent
541   SKETCHAPI_EXPORT
542   std::shared_ptr<ModelHighAPI_Interface> setTangent(
543       const ModelHighAPI_RefAttr & theLine,
544       const ModelHighAPI_RefAttr & theCircle);
545
546   /// Set vertical
547   SKETCHAPI_EXPORT
548   std::shared_ptr<ModelHighAPI_Interface> setVertical(
549       const ModelHighAPI_RefAttr & theLine);
550
551   /// Set constraint value
552   SKETCHAPI_EXPORT
553   void setValue(
554       const std::shared_ptr<ModelHighAPI_Interface> & theConstraint,
555       const ModelHighAPI_Double & theValue);
556
557   /// Move point or sketch feature
558   SKETCHAPI_EXPORT
559   void move(const ModelHighAPI_RefAttr& theMovedEntity,
560             const std::shared_ptr<GeomAPI_Pnt2d>& theTargetPoint);
561
562   /// Move point or sketch feature
563   SKETCHAPI_EXPORT
564   void move(const ModelHighAPI_RefAttr& theMovedEntity,
565             double theTargetX, double theTargetY);
566
567   SKETCHAPI_EXPORT
568   std::shared_ptr<GeomAPI_Pnt2d> to2D(const std::shared_ptr<GeomAPI_Pnt>& thePoint);
569
570   // TODO(spo): rename to selectFaces() or faces() (or add faces() -> list to SWIG)
571   /// Select face
572   SKETCHAPI_EXPORT
573   std::list<ModelHighAPI_Selection> selectFace() const;
574
575   /// Dump wrapped feature
576   SKETCHAPI_EXPORT
577   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
578
579 protected:
580   std::shared_ptr<ModelAPI_CompositeFeature> compositeFeature() const;
581
582 };
583
584 //! Pointer on Sketch object
585 typedef std::shared_ptr<SketchAPI_Sketch> SketchPtr;
586
587 //--------------------------------------------------------------------------------------
588
589 /**\ingroup CPPHighAPI
590  * \brief Create Sketch feature
591  */
592 SKETCHAPI_EXPORT
593 SketchPtr addSketch(const std::shared_ptr<ModelAPI_Document> & thePart,
594                     const std::shared_ptr<GeomAPI_Ax3> & thePlane);
595
596 /**\ingroup CPPHighAPI
597  * \brief Create Sketch feature
598  */
599 SKETCHAPI_EXPORT
600 SketchPtr addSketch(const std::shared_ptr<ModelAPI_Document> & thePart,
601                     const ModelHighAPI_Selection & theExternal);
602
603 /**\ingroup CPPHighAPI
604  * \brief Create Sketch feature
605  */
606 SKETCHAPI_EXPORT
607 SketchPtr addSketch(const std::shared_ptr<ModelAPI_Document> & thePart,
608                     const std::string & theExternalName);
609
610 /**\ingroup CPPHighAPI
611  * \brief Create Sketch feature
612  */
613 SKETCHAPI_EXPORT
614 SketchPtr addSketch(const std::shared_ptr<ModelAPI_Document> & thePart,
615                     std::shared_ptr<ModelAPI_Object> thePlaneObject);
616
617 //--------------------------------------------------------------------------------------
618
619 /** \ingroup CPPHighAPI
620  *  \brief Copy sketch with all its sub-features
621  */
622 SKETCHAPI_EXPORT
623 SketchPtr copySketch(const std::shared_ptr<ModelAPI_Document> & thePart,
624                      const SketchPtr & theSketch);
625
626 //--------------------------------------------------------------------------------------
627 #endif /* SRC_SKETCHAPI_SKETCHAPI_SKETCH_H_ */