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