Salome HOME
Merge branch 'csgroup_IS2'
[modules/shaper.git] / src / SketchAPI / SketchAPI_Sketch.h
1 // Copyright (C) 2014-2021  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
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_Rectangle> addRectangleCentered(
185       const std::pair<std::shared_ptr<GeomAPI_Pnt2d>, ModelHighAPI_RefAttr> & theCenter,
186       const std::pair<std::shared_ptr<GeomAPI_Pnt2d>, ModelHighAPI_RefAttr> & theCorner);
187
188   /// Add circle
189   SKETCHAPI_EXPORT
190   std::shared_ptr<SketchAPI_Circle> addCircle(
191       double theCenterX, double theCenterY,
192       double theRadius);
193   /// Add circle
194   SKETCHAPI_EXPORT
195   std::shared_ptr<SketchAPI_Circle> addCircle(
196       const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
197       double theRadius);
198   /// Add circle
199   SKETCHAPI_EXPORT
200   std::shared_ptr<SketchAPI_MacroCircle> addCircle(
201       double theCenterX, double theCenterY,
202       double thePassedX, double thePassedY);
203   /// Add circle
204   SKETCHAPI_EXPORT
205   std::shared_ptr<SketchAPI_MacroCircle> addCircle(
206       const std::shared_ptr<GeomAPI_Pnt2d>& theCenterPoint,
207       const std::shared_ptr<GeomAPI_Pnt2d>& thePassedPoint);
208   /// Add circle
209   SKETCHAPI_EXPORT
210   std::shared_ptr<SketchAPI_MacroCircle> addCircle(
211       double theX1, double theY1,
212       double theX2, double theY2,
213       double theX3, double theY3);
214   /// Add circle
215   SKETCHAPI_EXPORT
216   std::shared_ptr<SketchAPI_MacroCircle> addCircle(
217       const std::shared_ptr<GeomAPI_Pnt2d>& thePoint1,
218       const std::shared_ptr<GeomAPI_Pnt2d>& thePoint2,
219       const std::shared_ptr<GeomAPI_Pnt2d>& thePoint3);
220   /// Add circle
221   SKETCHAPI_EXPORT
222   std::shared_ptr<SketchAPI_Circle> addCircle(const ModelHighAPI_Selection & theExternal);
223   /// Add circle
224   SKETCHAPI_EXPORT
225   std::shared_ptr<SketchAPI_Circle> addCircle(const std::wstring & theExternalName);
226
227   /// Add arc
228   SKETCHAPI_EXPORT
229   std::shared_ptr<SketchAPI_Arc> addArc(
230       double theCenterX, double theCenterY,
231       double theStartX, double theStartY,
232       double theEndX, double theEndY,
233       bool theInversed);
234
235   /// Add arc
236   SKETCHAPI_EXPORT
237   std::shared_ptr<SketchAPI_Arc> addArc(
238       const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
239       const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
240       const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
241       bool theInversed);
242
243   /// Add arc
244   SKETCHAPI_EXPORT
245   std::shared_ptr<SketchAPI_MacroArc> addArc(
246       double theStartX, double theStartY,
247       double theEndX, double theEndY,
248       double thePassedX, double thePassedY);
249
250   /// Add arc
251   SKETCHAPI_EXPORT
252   std::shared_ptr<SketchAPI_MacroArc> addArc(
253       const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
254       const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
255       const std::shared_ptr<GeomAPI_Pnt2d>& thePassed);
256
257   /// Add transversal/tangent arc
258   SKETCHAPI_EXPORT
259   std::shared_ptr<SketchAPI_MacroArc> addArc(
260       const ModelHighAPI_RefAttr& theConnectedPoint,
261       double theEndX, double theEndY,
262       bool theInversed,
263       bool theTransversal = false);
264
265   /// Add transversal/tangent arc
266   SKETCHAPI_EXPORT
267   std::shared_ptr<SketchAPI_MacroArc> addArc(
268       const ModelHighAPI_RefAttr& theConnectedPoint,
269       const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
270       bool theInversed,
271       bool theTransversal = false);
272
273   /// Add arc
274   SKETCHAPI_EXPORT
275   std::shared_ptr<SketchAPI_Arc> addArc(const ModelHighAPI_Selection & theExternal);
276
277   /// Add arc
278   SKETCHAPI_EXPORT
279   std::shared_ptr<SketchAPI_Arc> addArc(const std::wstring & theExternalName);
280
281   /// Add ellipse
282   SKETCHAPI_EXPORT
283   std::shared_ptr<SketchAPI_Ellipse> addEllipse(
284       double theCenterX, double theCenterY,
285       double theFocusX, double theFocusY,
286       double theMinorRadius);
287   /// Add ellipse
288   SKETCHAPI_EXPORT
289   std::shared_ptr<SketchAPI_Ellipse> addEllipse(
290       const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
291       const std::shared_ptr<GeomAPI_Pnt2d>& theFocus,
292       double theRadius);
293   /// Add ellipse
294   SKETCHAPI_EXPORT
295   std::shared_ptr<SketchAPI_MacroEllipse> addEllipse(
296       double thePoint1X, double thePoint1Y,
297       double thePoint2X, double thePoint2Y,
298       double thePassedX, double thePassedY,
299       bool isPoint1Center = true);
300   /// Add ellipse
301   SKETCHAPI_EXPORT
302   std::shared_ptr<SketchAPI_MacroEllipse> addEllipse(
303       const PointOrReference& thePoint1,
304       const PointOrReference& thePoint2,
305       const PointOrReference& thePassedPoint,
306       bool isPoint1Center = true);
307   /// Add ellipse
308   SKETCHAPI_EXPORT
309   std::shared_ptr<SketchAPI_Ellipse> addEllipse(const ModelHighAPI_Selection & theExternal);
310   /// Add ellipse
311   SKETCHAPI_EXPORT
312   std::shared_ptr<SketchAPI_Ellipse> addEllipse(const std::wstring & theExternalName);
313
314   /// Add elliptic arc
315   SKETCHAPI_EXPORT
316   std::shared_ptr<SketchAPI_EllipticArc> addEllipticArc(
317       double theCenterX, double theCenterY,
318       double theFocusX, double theFocusY,
319       double theStartX, double theStartY,
320       double theEndX, double theEndY,
321       bool theInversed = false);
322   /// Add elliptic arc
323   SKETCHAPI_EXPORT
324   std::shared_ptr<SketchAPI_MacroEllipticArc> addEllipticArc(
325       const PointOrReference& theCenter,
326       const PointOrReference& theMajorAxisPoint,
327       const PointOrReference& theStartPoint,
328       const PointOrReference& theEndPoint,
329       bool theInversed = false);
330   /// Add elliptic arc
331   SKETCHAPI_EXPORT
332   std::shared_ptr<SketchAPI_EllipticArc> addEllipticArc(const ModelHighAPI_Selection & theExternal);
333   /// Add elliptic arc
334   SKETCHAPI_EXPORT
335   std::shared_ptr<SketchAPI_EllipticArc> addEllipticArc(const std::wstring & theExternalName);
336
337   /// Add B-spline
338   SKETCHAPI_EXPORT
339   std::shared_ptr<SketchAPI_BSpline> addSpline(
340       const ModelHighAPI_Selection & external = ModelHighAPI_Selection(),
341       const int degree = -1,
342       const std::list<PointOrReference>& poles = std::list<PointOrReference>(),
343       const std::list<ModelHighAPI_Double>& weights = std::list<ModelHighAPI_Double>(),
344       const std::list<ModelHighAPI_Double>& knots = std::list<ModelHighAPI_Double>(),
345       const std::list<ModelHighAPI_Integer>& multiplicities = std::list<ModelHighAPI_Integer>(),
346       const bool periodic = false);
347
348   /// Add interpolation feature
349   SKETCHAPI_EXPORT
350   std::shared_ptr<SketchAPI_BSpline> addInterpolation(
351       const std::list<ModelHighAPI_RefAttr>& points,
352       const bool periodic = false,
353       const bool closed = false);
354
355   /// Add approximation feature
356   SKETCHAPI_EXPORT
357   std::shared_ptr<SketchAPI_BSpline> addApproximation(
358       const std::list<ModelHighAPI_RefAttr>& points,
359       const ModelHighAPI_Double& precision = ModelHighAPI_Double(1.e-3),
360       const bool periodic = false,
361       const bool closed = false);
362
363   /// Add projection
364   SKETCHAPI_EXPORT
365   std::shared_ptr<SketchAPI_Projection> addProjection(
366       const ModelHighAPI_Selection & theExternalFeature,
367       bool keepResult = false,
368       bool keepRefToOriginal = true);
369
370   /// Add mirror
371   SKETCHAPI_EXPORT
372   std::shared_ptr<SketchAPI_Mirror> addMirror(
373       const ModelHighAPI_RefAttr & theMirrorLine,
374       const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects);
375
376   /// Add offset
377   SKETCHAPI_EXPORT
378   std::shared_ptr<SketchAPI_Offset> addOffset(
379       const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects,
380       const ModelHighAPI_Double & theValue,
381       const bool theReversed);
382
383   /// Add translation
384   SKETCHAPI_EXPORT
385   std::shared_ptr<SketchAPI_Translation> addTranslation(
386       const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects,
387       const ModelHighAPI_RefAttr & thePoint1,
388       const ModelHighAPI_RefAttr & thePoint2,
389       const ModelHighAPI_Integer & theNumberOfObjects,
390       bool theFullValue = false);
391
392   /// Add rotation
393   SKETCHAPI_EXPORT
394   std::shared_ptr<SketchAPI_Rotation> addRotation(
395       const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects,
396       const ModelHighAPI_RefAttr & theCenter,
397       const ModelHighAPI_Double & theAngle,
398       const ModelHighAPI_Integer & theNumberOfObjects,
399       bool theFullValue = false,
400       bool theReversed  = false);
401
402   /// Add split
403   SKETCHAPI_EXPORT
404   std::shared_ptr<ModelHighAPI_Interface> addSplit(
405       const ModelHighAPI_Reference& theFeature,
406       const std::shared_ptr<GeomAPI_Pnt2d>& thePositionPoint);
407
408   /// Add trim
409   SKETCHAPI_EXPORT
410   std::shared_ptr<ModelHighAPI_Interface> addTrim(
411       const ModelHighAPI_Reference& theFeature,
412       const std::shared_ptr<GeomAPI_Pnt2d>& thePositionPoint);
413
414   /// Set angle
415   SKETCHAPI_EXPORT
416   std::shared_ptr<ModelHighAPI_Interface> setAngle(
417       const ModelHighAPI_RefAttr & theLine1,
418       const ModelHighAPI_RefAttr & theLine2,
419       const ModelHighAPI_Double & theValue,
420       const std::string& type = std::string());
421
422   /// Set complementary angle
423   SKETCHAPI_EXPORT
424   std::shared_ptr<ModelHighAPI_Interface> setAngleComplementary(
425       const ModelHighAPI_RefAttr & theLine1,
426       const ModelHighAPI_RefAttr & theLine2,
427       const ModelHighAPI_Double & theValue);
428
429   /// Set backward angle (= 360 - angle)
430   SKETCHAPI_EXPORT
431   std::shared_ptr<ModelHighAPI_Interface> setAngleBackward(
432       const ModelHighAPI_RefAttr & theLine1,
433       const ModelHighAPI_RefAttr & theLine2,
434       const ModelHighAPI_Double & theValue);
435
436   /// Set coincident
437   SKETCHAPI_EXPORT
438   std::shared_ptr<ModelHighAPI_Interface> setCoincident(
439       const ModelHighAPI_RefAttr & thePoint1,
440       const ModelHighAPI_RefAttr & thePoint2);
441
442   /// Set collinear
443   SKETCHAPI_EXPORT
444   std::shared_ptr<ModelHighAPI_Interface> setCollinear(
445       const ModelHighAPI_RefAttr & theLine1,
446       const ModelHighAPI_RefAttr & theLine2);
447
448   /// Set distance
449   SKETCHAPI_EXPORT
450   std::shared_ptr<ModelHighAPI_Interface> setDistance(
451       const ModelHighAPI_RefAttr & thePoint,
452       const ModelHighAPI_RefAttr & thePointOrLine,
453       const ModelHighAPI_Double & theValue,
454       bool isSigned = false);
455
456   /// Set signed distance
457   SKETCHAPI_EXPORT
458   std::shared_ptr<ModelHighAPI_Interface> setSignedDistance(
459       const ModelHighAPI_RefAttr & thePoint,
460       const ModelHighAPI_RefAttr & thePointOrLine,
461       const ModelHighAPI_Double & theValue);
462
463   /// Set unsigned distance
464   SKETCHAPI_EXPORT
465   std::shared_ptr<ModelHighAPI_Interface> setUnsignedDistance(
466       const ModelHighAPI_RefAttr & thePoint,
467       const ModelHighAPI_RefAttr & thePointOrLine,
468       const ModelHighAPI_Double & theValue);
469
470   /// Set horizontal distance
471   SKETCHAPI_EXPORT
472   std::shared_ptr<ModelHighAPI_Interface> setHorizontalDistance(
473       const ModelHighAPI_RefAttr & thePoint1,
474       const ModelHighAPI_RefAttr & thePoint2,
475       const ModelHighAPI_Double & theValue);
476
477   /// Set vertical distance
478   SKETCHAPI_EXPORT
479   std::shared_ptr<ModelHighAPI_Interface> setVerticalDistance(
480       const ModelHighAPI_RefAttr & thePoint1,
481       const ModelHighAPI_RefAttr & thePoint2,
482       const ModelHighAPI_Double & theValue);
483
484   /// Set equal
485   SKETCHAPI_EXPORT
486   std::shared_ptr<ModelHighAPI_Interface> setEqual(
487       const ModelHighAPI_RefAttr & theObject1,
488       const ModelHighAPI_RefAttr & theObject2);
489
490   /// Set fillet
491   SKETCHAPI_EXPORT
492   std::shared_ptr<ModelHighAPI_Interface> setFillet(
493       const ModelHighAPI_RefAttr & thePoint);
494
495   /// Set fillet with additional radius constraint
496   SKETCHAPI_EXPORT
497   std::shared_ptr<ModelHighAPI_Interface> setFilletWithRadius(
498       const ModelHighAPI_RefAttr & thePoint,
499       const ModelHighAPI_Double & theRadius);
500
501   /// Set fixed
502   SKETCHAPI_EXPORT
503   std::shared_ptr<ModelHighAPI_Interface> setFixed(
504       const ModelHighAPI_RefAttr & theObject);
505
506   /// Set horizontal
507   SKETCHAPI_EXPORT
508   std::shared_ptr<ModelHighAPI_Interface> setHorizontal(
509       const ModelHighAPI_RefAttr & theLine);
510
511   /// Set length
512   SKETCHAPI_EXPORT
513   std::shared_ptr<ModelHighAPI_Interface> setLength(
514       const ModelHighAPI_RefAttr & theLine,
515       const ModelHighAPI_Double & theValue);
516
517   /// Set middle
518   SKETCHAPI_EXPORT
519   std::shared_ptr<ModelHighAPI_Interface> setMiddlePoint(
520       const ModelHighAPI_RefAttr & thePoint,
521       const ModelHighAPI_RefAttr & theLine);
522
523   /// Set parallel
524   SKETCHAPI_EXPORT
525   std::shared_ptr<ModelHighAPI_Interface> setParallel(
526       const ModelHighAPI_RefAttr & theLine1,
527       const ModelHighAPI_RefAttr & theLine2);
528
529   /// Set perpendicular
530   SKETCHAPI_EXPORT
531   std::shared_ptr<ModelHighAPI_Interface> setPerpendicular(
532       const ModelHighAPI_RefAttr & theLine1,
533       const ModelHighAPI_RefAttr & theLine2);
534
535   /// Set radius
536   SKETCHAPI_EXPORT
537   std::shared_ptr<ModelHighAPI_Interface> setRadius(
538       const ModelHighAPI_RefAttr & theCircleOrArc,
539       const ModelHighAPI_Double & theValue);
540
541   /// Set tangent
542   SKETCHAPI_EXPORT
543   std::shared_ptr<ModelHighAPI_Interface> setTangent(
544       const ModelHighAPI_RefAttr & theLine,
545       const ModelHighAPI_RefAttr & theCircle);
546
547   /// Set vertical
548   SKETCHAPI_EXPORT
549   std::shared_ptr<ModelHighAPI_Interface> setVertical(
550       const ModelHighAPI_RefAttr & theLine);
551
552   /// Set constraint value
553   SKETCHAPI_EXPORT
554   void setValue(
555       const std::shared_ptr<ModelHighAPI_Interface> & theConstraint,
556       const ModelHighAPI_Double & theValue);
557
558   /// Move point or sketch feature
559   SKETCHAPI_EXPORT
560   void move(const ModelHighAPI_RefAttr& theMovedEntity,
561             const std::shared_ptr<GeomAPI_Pnt2d>& theTargetPoint);
562
563   /// Move point or sketch feature
564   SKETCHAPI_EXPORT
565   void move(const ModelHighAPI_RefAttr& theMovedEntity,
566             double theTargetX, double theTargetY);
567
568   SKETCHAPI_EXPORT
569   std::shared_ptr<GeomAPI_Pnt2d> to2D(const std::shared_ptr<GeomAPI_Pnt>& thePoint);
570
571   // TODO(spo): rename to selectFaces() or faces() (or add faces() -> list to SWIG)
572   /// Select face
573   SKETCHAPI_EXPORT
574   std::list<ModelHighAPI_Selection> selectFace() const;
575
576   /// Dump wrapped feature
577   SKETCHAPI_EXPORT
578   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
579
580 protected:
581   std::shared_ptr<ModelAPI_CompositeFeature> compositeFeature() const;
582
583 };
584
585 //! Pointer on Sketch object
586 typedef std::shared_ptr<SketchAPI_Sketch> SketchPtr;
587
588 //--------------------------------------------------------------------------------------
589
590 /**\ingroup CPPHighAPI
591  * \brief Create Sketch feature
592  */
593 SKETCHAPI_EXPORT
594 SketchPtr addSketch(const std::shared_ptr<ModelAPI_Document> & thePart,
595                     const std::shared_ptr<GeomAPI_Ax3> & thePlane);
596
597 /**\ingroup CPPHighAPI
598  * \brief Create Sketch feature
599  */
600 SKETCHAPI_EXPORT
601 SketchPtr addSketch(const std::shared_ptr<ModelAPI_Document> & thePart,
602                     const ModelHighAPI_Selection & theExternal);
603
604 /**\ingroup CPPHighAPI
605  * \brief Create Sketch feature
606  */
607 SKETCHAPI_EXPORT
608 SketchPtr addSketch(const std::shared_ptr<ModelAPI_Document> & thePart,
609                     const std::wstring & theExternalName);
610
611 /**\ingroup CPPHighAPI
612  * \brief Create Sketch feature
613  */
614 SKETCHAPI_EXPORT
615 SketchPtr addSketch(const std::shared_ptr<ModelAPI_Document> & thePart,
616                     std::shared_ptr<ModelAPI_Object> thePlaneObject);
617
618 //--------------------------------------------------------------------------------------
619
620 /** \ingroup CPPHighAPI
621  *  \brief Copy sketch with all its sub-features
622  */
623 SKETCHAPI_EXPORT
624 SketchPtr copySketch(const std::shared_ptr<ModelAPI_Document> & thePart,
625                      const SketchPtr & theSketch);
626
627 //--------------------------------------------------------------------------------------
628 #endif /* SRC_SKETCHAPI_SKETCHAPI_SKETCH_H_ */