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