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