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