Salome HOME
Improve code coverage for AttributeRefAttrList.
[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 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 projection
342   SKETCHAPI_EXPORT
343   std::shared_ptr<SketchAPI_Projection> addProjection(
344       const ModelHighAPI_Selection & theExternalFeature,
345       bool theKeepResult = false);
346
347   /// Add projection
348   SKETCHAPI_EXPORT
349   std::shared_ptr<SketchAPI_Projection> addProjection(const std::string & theExternalName,
350                                                       bool theKeepResult = false);
351
352   /// Add mirror
353   SKETCHAPI_EXPORT
354   std::shared_ptr<SketchAPI_Mirror> addMirror(
355       const ModelHighAPI_RefAttr & theMirrorLine,
356       const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects);
357
358   /// Add translation
359   SKETCHAPI_EXPORT
360   std::shared_ptr<SketchAPI_Translation> addTranslation(
361       const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects,
362       const ModelHighAPI_RefAttr & thePoint1,
363       const ModelHighAPI_RefAttr & thePoint2,
364       const ModelHighAPI_Integer & theNumberOfObjects,
365       bool theFullValue = false);
366
367   /// Add rotation
368   SKETCHAPI_EXPORT
369   std::shared_ptr<SketchAPI_Rotation> addRotation(
370       const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects,
371       const ModelHighAPI_RefAttr & theCenter,
372       const ModelHighAPI_Double & theAngle,
373       const ModelHighAPI_Integer & theNumberOfObjects,
374       bool theFullValue = false,
375       bool theReversed  = false);
376
377   /// Add split
378   SKETCHAPI_EXPORT
379   std::shared_ptr<ModelHighAPI_Interface> addSplit(
380       const ModelHighAPI_Reference& theFeature,
381       const std::shared_ptr<GeomAPI_Pnt2d>& thePositionPoint);
382
383   /// Add trim
384   SKETCHAPI_EXPORT
385   std::shared_ptr<ModelHighAPI_Interface> addTrim(
386       const ModelHighAPI_Reference& theFeature,
387       const std::shared_ptr<GeomAPI_Pnt2d>& thePositionPoint);
388
389   /// Set angle
390   SKETCHAPI_EXPORT
391   std::shared_ptr<ModelHighAPI_Interface> setAngle(
392       const ModelHighAPI_RefAttr & theLine1,
393       const ModelHighAPI_RefAttr & theLine2,
394       const ModelHighAPI_Double & theValue,
395       const std::string& type = std::string());
396
397   /// Set complementary angle
398   SKETCHAPI_EXPORT
399   std::shared_ptr<ModelHighAPI_Interface> setAngleComplementary(
400       const ModelHighAPI_RefAttr & theLine1,
401       const ModelHighAPI_RefAttr & theLine2,
402       const ModelHighAPI_Double & theValue);
403
404   /// Set backward angle (= 360 - angle)
405   SKETCHAPI_EXPORT
406   std::shared_ptr<ModelHighAPI_Interface> setAngleBackward(
407       const ModelHighAPI_RefAttr & theLine1,
408       const ModelHighAPI_RefAttr & theLine2,
409       const ModelHighAPI_Double & theValue);
410
411   /// Set coincident
412   SKETCHAPI_EXPORT
413   std::shared_ptr<ModelHighAPI_Interface> setCoincident(
414       const ModelHighAPI_RefAttr & thePoint1,
415       const ModelHighAPI_RefAttr & thePoint2);
416
417   /// Set collinear
418   SKETCHAPI_EXPORT
419   std::shared_ptr<ModelHighAPI_Interface> setCollinear(
420       const ModelHighAPI_RefAttr & theLine1,
421       const ModelHighAPI_RefAttr & theLine2);
422
423   /// Set distance
424   SKETCHAPI_EXPORT
425   std::shared_ptr<ModelHighAPI_Interface> setDistance(
426       const ModelHighAPI_RefAttr & thePoint,
427       const ModelHighAPI_RefAttr & thePointOrLine,
428       const ModelHighAPI_Double & theValue,
429       bool isSigned = false);
430
431   /// Set signed distance
432   SKETCHAPI_EXPORT
433   std::shared_ptr<ModelHighAPI_Interface> setSignedDistance(
434       const ModelHighAPI_RefAttr & thePoint,
435       const ModelHighAPI_RefAttr & thePointOrLine,
436       const ModelHighAPI_Double & theValue);
437
438   /// Set unsigned distance
439   SKETCHAPI_EXPORT
440   std::shared_ptr<ModelHighAPI_Interface> setUnsignedDistance(
441       const ModelHighAPI_RefAttr & thePoint,
442       const ModelHighAPI_RefAttr & thePointOrLine,
443       const ModelHighAPI_Double & theValue);
444
445   /// Set horizontal distance
446   SKETCHAPI_EXPORT
447   std::shared_ptr<ModelHighAPI_Interface> setHorizontalDistance(
448       const ModelHighAPI_RefAttr & thePoint1,
449       const ModelHighAPI_RefAttr & thePoint2,
450       const ModelHighAPI_Double & theValue);
451
452   /// Set vertical distance
453   SKETCHAPI_EXPORT
454   std::shared_ptr<ModelHighAPI_Interface> setVerticalDistance(
455       const ModelHighAPI_RefAttr & thePoint1,
456       const ModelHighAPI_RefAttr & thePoint2,
457       const ModelHighAPI_Double & theValue);
458
459   /// Set equal
460   SKETCHAPI_EXPORT
461   std::shared_ptr<ModelHighAPI_Interface> setEqual(
462       const ModelHighAPI_RefAttr & theObject1,
463       const ModelHighAPI_RefAttr & theObject2);
464
465   /// Set fillet
466   SKETCHAPI_EXPORT
467   std::shared_ptr<ModelHighAPI_Interface> setFillet(
468       const ModelHighAPI_RefAttr & thePoint);
469
470   /// Set fillet with additional radius constraint
471   SKETCHAPI_EXPORT
472   std::shared_ptr<ModelHighAPI_Interface> setFilletWithRadius(
473       const ModelHighAPI_RefAttr & thePoint,
474       const ModelHighAPI_Double & theRadius);
475
476   /// Set fixed
477   SKETCHAPI_EXPORT
478   std::shared_ptr<ModelHighAPI_Interface> setFixed(
479       const ModelHighAPI_RefAttr & theObject);
480
481   /// Set horizontal
482   SKETCHAPI_EXPORT
483   std::shared_ptr<ModelHighAPI_Interface> setHorizontal(
484       const ModelHighAPI_RefAttr & theLine);
485
486   /// Set length
487   SKETCHAPI_EXPORT
488   std::shared_ptr<ModelHighAPI_Interface> setLength(
489       const ModelHighAPI_RefAttr & theLine,
490       const ModelHighAPI_Double & theValue);
491
492   /// Set middle
493   SKETCHAPI_EXPORT
494   std::shared_ptr<ModelHighAPI_Interface> setMiddlePoint(
495       const ModelHighAPI_RefAttr & thePoint,
496       const ModelHighAPI_RefAttr & theLine);
497
498   /// Set parallel
499   SKETCHAPI_EXPORT
500   std::shared_ptr<ModelHighAPI_Interface> setParallel(
501       const ModelHighAPI_RefAttr & theLine1,
502       const ModelHighAPI_RefAttr & theLine2);
503
504   /// Set perpendicular
505   SKETCHAPI_EXPORT
506   std::shared_ptr<ModelHighAPI_Interface> setPerpendicular(
507       const ModelHighAPI_RefAttr & theLine1,
508       const ModelHighAPI_RefAttr & theLine2);
509
510   /// Set radius
511   SKETCHAPI_EXPORT
512   std::shared_ptr<ModelHighAPI_Interface> setRadius(
513       const ModelHighAPI_RefAttr & theCircleOrArc,
514       const ModelHighAPI_Double & theValue);
515
516   /// Set tangent
517   SKETCHAPI_EXPORT
518   std::shared_ptr<ModelHighAPI_Interface> setTangent(
519       const ModelHighAPI_RefAttr & theLine,
520       const ModelHighAPI_RefAttr & theCircle);
521
522   /// Set vertical
523   SKETCHAPI_EXPORT
524   std::shared_ptr<ModelHighAPI_Interface> setVertical(
525       const ModelHighAPI_RefAttr & theLine);
526
527   /// Set constraint value
528   SKETCHAPI_EXPORT
529   void setValue(
530       const std::shared_ptr<ModelHighAPI_Interface> & theConstraint,
531       const ModelHighAPI_Double & theValue);
532
533   /// Move point or sketch feature
534   SKETCHAPI_EXPORT
535   void move(const ModelHighAPI_RefAttr& theMovedEntity,
536             const std::shared_ptr<GeomAPI_Pnt2d>& theTargetPoint);
537
538   /// Move point or sketch feature
539   SKETCHAPI_EXPORT
540   void move(const ModelHighAPI_RefAttr& theMovedEntity,
541             double theTargetX, double theTargetY);
542
543   SKETCHAPI_EXPORT
544   std::shared_ptr<GeomAPI_Pnt2d> to2D(const std::shared_ptr<GeomAPI_Pnt>& thePoint);
545
546   // TODO(spo): rename to selectFaces() or faces() (or add faces() -> list to SWIG)
547   /// Select face
548   SKETCHAPI_EXPORT
549   std::list<ModelHighAPI_Selection> selectFace() const;
550
551   /// Dump wrapped feature
552   SKETCHAPI_EXPORT
553   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
554
555 protected:
556   std::shared_ptr<ModelAPI_CompositeFeature> compositeFeature() const;
557
558 };
559
560 //! Pointer on Sketch object
561 typedef std::shared_ptr<SketchAPI_Sketch> SketchPtr;
562
563 /**\ingroup CPPHighAPI
564  * \brief Create Sketch feature
565  */
566 SKETCHAPI_EXPORT
567 SketchPtr addSketch(const std::shared_ptr<ModelAPI_Document> & thePart,
568                     const std::shared_ptr<GeomAPI_Ax3> & thePlane);
569
570 /**\ingroup CPPHighAPI
571  * \brief Create Sketch feature
572  */
573 SKETCHAPI_EXPORT
574 SketchPtr addSketch(const std::shared_ptr<ModelAPI_Document> & thePart,
575                     const ModelHighAPI_Selection & theExternal);
576
577 /**\ingroup CPPHighAPI
578  * \brief Create Sketch feature
579  */
580 SKETCHAPI_EXPORT
581 SketchPtr addSketch(const std::shared_ptr<ModelAPI_Document> & thePart,
582                     const std::string & theExternalName);
583
584 /**\ingroup CPPHighAPI
585  * \brief Create Sketch feature
586  */
587 SKETCHAPI_EXPORT
588 SketchPtr addSketch(const std::shared_ptr<ModelAPI_Document> & thePart,
589                     std::shared_ptr<ModelAPI_Object> thePlaneObject);
590
591 //--------------------------------------------------------------------------------------
592 //--------------------------------------------------------------------------------------
593 #endif /* SRC_SKETCHAPI_SKETCHAPI_SKETCH_H_ */