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