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