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