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