1 // Name : SketchAPI_Sketch.cpp
5 // 07/06/16 - Sergey POKHODENKO - Creation of the file
7 //--------------------------------------------------------------------------------------
8 #include "SketchAPI_Sketch.h"
9 //--------------------------------------------------------------------------------------
10 #include <SketchPlugin_Constraint.h>
11 #include <SketchPlugin_ConstraintAngle.h>
12 #include <SketchPlugin_ConstraintCoincidence.h>
13 #include <SketchPlugin_ConstraintCollinear.h>
14 #include <SketchPlugin_ConstraintDistance.h>
15 #include <SketchPlugin_ConstraintEqual.h>
16 #include <SketchPlugin_ConstraintFillet.h>
17 #include <SketchPlugin_ConstraintHorizontal.h>
18 #include <SketchPlugin_ConstraintLength.h>
19 #include <SketchPlugin_ConstraintMiddle.h>
20 #include <SketchPlugin_ConstraintMirror.h>
21 #include <SketchPlugin_ConstraintParallel.h>
22 #include <SketchPlugin_ConstraintPerpendicular.h>
23 #include <SketchPlugin_ConstraintRadius.h>
24 #include <SketchPlugin_ConstraintRigid.h>
25 #include <SketchPlugin_ConstraintTangent.h>
26 #include <SketchPlugin_ConstraintVertical.h>
27 //--------------------------------------------------------------------------------------
28 #include <ModelAPI_CompositeFeature.h>
29 #include <ModelAPI_ResultConstruction.h>
30 #include <ModelHighAPI_RefAttr.h>
31 #include <ModelHighAPI_Selection.h>
32 #include <ModelHighAPI_Tools.h>
33 //--------------------------------------------------------------------------------------
34 #include "SketchAPI_Arc.h"
35 #include "SketchAPI_Circle.h"
36 #include "SketchAPI_Line.h"
37 #include "SketchAPI_Mirror.h"
38 #include "SketchAPI_Point.h"
39 #include "SketchAPI_Translation.h"
40 //--------------------------------------------------------------------------------------
41 SketchAPI_Sketch::SketchAPI_Sketch(
42 const std::shared_ptr<ModelAPI_Feature> & theFeature)
43 : ModelHighAPI_Interface(theFeature)
48 SketchAPI_Sketch::SketchAPI_Sketch(
49 const std::shared_ptr<ModelAPI_Feature> & theFeature,
50 const std::shared_ptr<GeomAPI_Ax3> & thePlane)
51 : ModelHighAPI_Interface(theFeature)
58 SketchAPI_Sketch::SketchAPI_Sketch(
59 const std::shared_ptr<ModelAPI_Feature> & theFeature,
60 const ModelHighAPI_Selection & theExternal)
61 : ModelHighAPI_Interface(theFeature)
64 setExternal(theExternal);
68 SketchAPI_Sketch::~SketchAPI_Sketch()
73 //--------------------------------------------------------------------------------------
74 std::shared_ptr<ModelAPI_CompositeFeature> SketchAPI_Sketch::compositeFeature() const
76 return std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(feature());
79 //--------------------------------------------------------------------------------------
80 void SketchAPI_Sketch::setPlane(const std::shared_ptr<GeomAPI_Ax3> & thePlane)
82 fillAttribute(thePlane->origin(), myorigin);
83 fillAttribute(thePlane->dirX(), mydirX);
84 fillAttribute(thePlane->normal(), mynormal);
89 void SketchAPI_Sketch::setExternal(const ModelHighAPI_Selection & theExternal)
91 fillAttribute(theExternal, myexternal);
96 //--------------------------------------------------------------------------------------
97 void SketchAPI_Sketch::setValue(
98 const std::shared_ptr<ModelAPI_Feature> & theConstraint,
99 const ModelHighAPI_Double & theValue)
101 // TODO(spo): check somehow that the feature is a constraint or eliminate crash if the feature have no real attribute VALUE
102 fillAttribute(theValue, theConstraint->real(SketchPlugin_Constraint::VALUE()));
104 // theConstraint->execute();
107 //--------------------------------------------------------------------------------------
108 std::list<ModelHighAPI_Selection> SketchAPI_Sketch::selectFace() const
110 const_cast<SketchAPI_Sketch*>(this)->execute();
112 std::list<ModelHighAPI_Selection> aSelectionList;
114 ResultConstructionPtr aResultConstruction =
115 std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(feature()->firstResult());
116 if (aResultConstruction.get() == NULL)
117 return aSelectionList;
119 for (int anIndex = 0; anIndex < aResultConstruction->facesNum(); ++anIndex) {
120 aSelectionList.push_back(
121 ModelHighAPI_Selection(aResultConstruction,
122 aResultConstruction->face(anIndex)));
125 return aSelectionList;
128 //--------------------------------------------------------------------------------------
129 SketchPtr addSketch(const std::shared_ptr<ModelAPI_Document> & thePart,
130 const std::shared_ptr<GeomAPI_Ax3> & thePlane)
132 // TODO(spo): check that thePart is not empty
133 std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(SketchAPI_Sketch::ID());
134 return SketchPtr(new SketchAPI_Sketch(aFeature, thePlane));
137 SketchPtr addSketch(const std::shared_ptr<ModelAPI_Document> & thePart,
138 const ModelHighAPI_Selection & theExternal)
140 // TODO(spo): check that thePart is not empty
141 std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(SketchAPI_Sketch::ID());
142 return SketchPtr(new SketchAPI_Sketch(aFeature, theExternal));
145 SketchPtr addSketch(const std::shared_ptr<ModelAPI_Document> & thePart,
146 const std::string & theExternalName)
148 // TODO(spo): check that thePart is not empty
149 std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(SketchAPI_Sketch::ID());
150 return SketchPtr(new SketchAPI_Sketch(aFeature, ModelHighAPI_Selection("FACE", theExternalName)));
153 //--------------------------------------------------------------------------------------
154 std::shared_ptr<SketchAPI_Point> SketchAPI_Sketch::addPoint(
155 double theX, double theY)
157 std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Point::ID());
158 return PointPtr(new SketchAPI_Point(aFeature, theX, theY));
160 std::shared_ptr<SketchAPI_Point> SketchAPI_Sketch::addPoint(
161 const std::shared_ptr<GeomAPI_Pnt2d> & thePoint)
163 std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Point::ID());
164 return PointPtr(new SketchAPI_Point(aFeature, thePoint));
166 std::shared_ptr<SketchAPI_Point> SketchAPI_Sketch::addPoint(const ModelHighAPI_Selection & theExternal)
168 std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Point::ID());
169 return PointPtr(new SketchAPI_Point(aFeature, theExternal));
171 std::shared_ptr<SketchAPI_Point> SketchAPI_Sketch::addPoint(const std::string & theExternalName)
173 std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Point::ID());
174 return PointPtr(new SketchAPI_Point(aFeature, theExternalName));
177 //--------------------------------------------------------------------------------------
178 std::shared_ptr<SketchAPI_Line> SketchAPI_Sketch::addLine(double theX1, double theY1, double theX2, double theY2)
180 std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Line::ID());
181 return LinePtr(new SketchAPI_Line(aFeature, theX1, theY1, theX2, theY2));
183 std::shared_ptr<SketchAPI_Line> SketchAPI_Sketch::addLine(
184 const std::shared_ptr<GeomAPI_Pnt2d> & theStartPoint,
185 const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint)
187 std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Line::ID());
188 return LinePtr(new SketchAPI_Line(aFeature, theStartPoint, theEndPoint));
190 std::shared_ptr<SketchAPI_Line> SketchAPI_Sketch::addLine(const ModelHighAPI_Selection & theExternal)
192 std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Line::ID());
193 return LinePtr(new SketchAPI_Line(aFeature, theExternal));
195 std::shared_ptr<SketchAPI_Line> SketchAPI_Sketch::addLine(const std::string & theExternalName)
197 // TODO(spo): Add constraint SketchConstraintRigid like in PythonAPI. Is it necessary?
198 std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Line::ID());
199 return LinePtr(new SketchAPI_Line(aFeature, theExternalName));
202 //--------------------------------------------------------------------------------------
203 std::shared_ptr<SketchAPI_Circle> SketchAPI_Sketch::addCircle(double theCenterX,
207 std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Circle::ID());
208 return CirclePtr(new SketchAPI_Circle(aFeature, theCenterX, theCenterY, theRadius));
211 std::shared_ptr<SketchAPI_Circle> SketchAPI_Sketch::addCircle(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
214 std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Circle::ID());
215 return CirclePtr(new SketchAPI_Circle(aFeature, theCenter, theRadius));
218 std::shared_ptr<SketchAPI_Circle> SketchAPI_Sketch::addCircle(double theX1, double theY1,
219 double theX2, double theY2,
220 double theX3, double theY3)
222 std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Circle::ID());
223 return CirclePtr(new SketchAPI_Circle(aFeature, theX1, theY1, theX2, theY2, theX3, theY3));
226 std::shared_ptr<SketchAPI_Circle> SketchAPI_Sketch::addCircle(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint1,
227 const std::shared_ptr<GeomAPI_Pnt2d>& thePoint2,
228 const std::shared_ptr<GeomAPI_Pnt2d>& thePoint3)
230 std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Circle::ID());
231 return CirclePtr(new SketchAPI_Circle(aFeature, thePoint1, thePoint2, thePoint3));
234 std::shared_ptr<SketchAPI_Circle> SketchAPI_Sketch::addCircle(const ModelHighAPI_Selection & theExternal)
236 std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Circle::ID());
237 return CirclePtr(new SketchAPI_Circle(aFeature, theExternal));
240 std::shared_ptr<SketchAPI_Circle> SketchAPI_Sketch::addCircle(const std::string & theExternalName)
242 // TODO(spo): Add constraint SketchConstraintRigid like in PythonAPI. Is it necessary?
243 std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Circle::ID());
244 return CirclePtr(new SketchAPI_Circle(aFeature, theExternalName));
247 //--------------------------------------------------------------------------------------
248 std::shared_ptr<SketchAPI_Arc> SketchAPI_Sketch::addArc(double theCenterX, double theCenterY,
249 double theStartX, double theStartY,
250 double theEndX, double theEndY,
253 std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Arc::ID());
254 return ArcPtr(new SketchAPI_Arc(aFeature,
255 theCenterX, theCenterY,
256 theStartX, theStartY,
261 std::shared_ptr<SketchAPI_Arc> SketchAPI_Sketch::addArc(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
262 const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
263 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
266 std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Arc::ID());
267 return ArcPtr(new SketchAPI_Arc(aFeature, theCenter, theStart, theEnd, theInversed));
270 std::shared_ptr<SketchAPI_Arc> SketchAPI_Sketch::addArc(double theStartX, double theStartY,
271 double theEndX, double theEndY,
272 double thePassedX, double thePassedY)
274 std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Arc::ID());
275 return ArcPtr(new SketchAPI_Arc(aFeature,
276 theStartX, theStartY,
278 thePassedX, thePassedY));
281 std::shared_ptr<SketchAPI_Arc> SketchAPI_Sketch::addArc(const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
282 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
283 const std::shared_ptr<GeomAPI_Pnt2d>& thePassed)
285 std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Arc::ID());
286 return ArcPtr(new SketchAPI_Arc(aFeature, theStart, theEnd, thePassed));
289 std::shared_ptr<SketchAPI_Arc> SketchAPI_Sketch::addArc(const ModelHighAPI_RefAttr& theTangentPoint,
290 double theEndX, double theEndY,
293 std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Arc::ID());
294 return ArcPtr(new SketchAPI_Arc(aFeature, theTangentPoint, theEndX, theEndY, theInversed));
297 std::shared_ptr<SketchAPI_Arc> SketchAPI_Sketch::addArc(const ModelHighAPI_RefAttr& theTangentPoint,
298 const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
301 std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Arc::ID());
302 return ArcPtr(new SketchAPI_Arc(aFeature, theTangentPoint, theEnd, theInversed));
305 std::shared_ptr<SketchAPI_Arc> SketchAPI_Sketch::addArc(const ModelHighAPI_Selection & theExternal)
307 std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Arc::ID());
308 return ArcPtr(new SketchAPI_Arc(aFeature, theExternal));
311 std::shared_ptr<SketchAPI_Arc> SketchAPI_Sketch::addArc(const std::string & theExternalName)
313 // TODO(spo): Add constraint SketchConstraintRigid like in PythonAPI. Is it necessary?
314 std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Arc::ID());
315 return ArcPtr(new SketchAPI_Arc(aFeature, theExternalName));
318 //--------------------------------------------------------------------------------------
319 std::shared_ptr<SketchAPI_Mirror> SketchAPI_Sketch::addMirror(
320 const ModelHighAPI_RefAttr & theMirrorLine,
321 const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects)
323 std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_ConstraintMirror::ID());
324 return MirrorPtr(new SketchAPI_Mirror(aFeature, theMirrorLine, theObjects));
327 //--------------------------------------------------------------------------------------
328 std::shared_ptr<SketchAPI_Translation> SketchAPI_Sketch::addTranslation(
329 const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects,
330 const ModelHighAPI_RefAttr & thePoint1,
331 const ModelHighAPI_RefAttr & thePoint2,
332 const ModelHighAPI_Integer & theNumberOfObjects,
335 std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_MultiTranslation::ID());
336 return TranslationPtr(new SketchAPI_Translation(aFeature, theObjects, thePoint1, thePoint2, theNumberOfObjects, theFullValue));
339 //--------------------------------------------------------------------------------------
340 std::shared_ptr<ModelAPI_Feature> SketchAPI_Sketch::setAngle(
341 const ModelHighAPI_RefAttr & theLine1,
342 const ModelHighAPI_RefAttr & theLine2,
343 const ModelHighAPI_Double & theValue)
345 // TODO(spo): is support of angle type necessary?
346 std::shared_ptr<ModelAPI_Feature> aFeature =
347 compositeFeature()->addFeature(SketchPlugin_ConstraintAngle::ID());
348 fillAttribute(theLine1, aFeature->refattr(SketchPlugin_Constraint::ENTITY_A()));
349 fillAttribute(theLine2, aFeature->refattr(SketchPlugin_Constraint::ENTITY_B()));
350 fillAttribute(theValue, aFeature->real(SketchPlugin_Constraint::VALUE()));
355 std::shared_ptr<ModelAPI_Feature> SketchAPI_Sketch::setCoincident(
356 const ModelHighAPI_RefAttr & thePoint1,
357 const ModelHighAPI_RefAttr & thePoint2)
359 std::shared_ptr<ModelAPI_Feature> aFeature =
360 compositeFeature()->addFeature(SketchPlugin_ConstraintCoincidence::ID());
361 fillAttribute(thePoint1, aFeature->refattr(SketchPlugin_Constraint::ENTITY_A()));
362 fillAttribute(thePoint2, aFeature->refattr(SketchPlugin_Constraint::ENTITY_B()));
367 std::shared_ptr<ModelAPI_Feature> SketchAPI_Sketch::setCollinear(
368 const ModelHighAPI_RefAttr & theLine1,
369 const ModelHighAPI_RefAttr & theLine2)
371 std::shared_ptr<ModelAPI_Feature> aFeature =
372 compositeFeature()->addFeature(SketchPlugin_ConstraintCollinear::ID());
373 fillAttribute(theLine1, aFeature->refattr(SketchPlugin_Constraint::ENTITY_A()));
374 fillAttribute(theLine2, aFeature->refattr(SketchPlugin_Constraint::ENTITY_B()));
379 std::shared_ptr<ModelAPI_Feature> SketchAPI_Sketch::setDistance(
380 const ModelHighAPI_RefAttr & thePoint,
381 const ModelHighAPI_RefAttr & thePointOrLine,
382 const ModelHighAPI_Double & theValue)
384 std::shared_ptr<ModelAPI_Feature> aFeature =
385 compositeFeature()->addFeature(SketchPlugin_ConstraintDistance::ID());
386 fillAttribute(thePoint, aFeature->refattr(SketchPlugin_Constraint::ENTITY_A()));
387 fillAttribute(thePointOrLine, aFeature->refattr(SketchPlugin_Constraint::ENTITY_B()));
388 fillAttribute(theValue, aFeature->real(SketchPlugin_Constraint::VALUE()));
393 std::shared_ptr<ModelAPI_Feature> SketchAPI_Sketch::setEqual(
394 const ModelHighAPI_RefAttr & theObject1,
395 const ModelHighAPI_RefAttr & theObject2)
397 std::shared_ptr<ModelAPI_Feature> aFeature =
398 compositeFeature()->addFeature(SketchPlugin_ConstraintEqual::ID());
399 fillAttribute(theObject1, aFeature->refattr(SketchPlugin_Constraint::ENTITY_A()));
400 fillAttribute(theObject2, aFeature->refattr(SketchPlugin_Constraint::ENTITY_B()));
405 std::shared_ptr<ModelAPI_Feature> SketchAPI_Sketch::setFillet(
406 const std::list<ModelHighAPI_RefAttr> & thePoints,
407 const ModelHighAPI_Double & theRadius)
409 std::shared_ptr<ModelAPI_Feature> aFeature =
410 compositeFeature()->addFeature(SketchPlugin_ConstraintFillet::ID());
411 fillAttribute(thePoints, aFeature->data()->refattrlist(SketchPlugin_Constraint::ENTITY_A()));
412 fillAttribute(theRadius, aFeature->real(SketchPlugin_Constraint::VALUE()));
417 std::shared_ptr<ModelAPI_Feature> SketchAPI_Sketch::setHorizontal(
418 const ModelHighAPI_RefAttr & theLine)
420 std::shared_ptr<ModelAPI_Feature> aFeature =
421 compositeFeature()->addFeature(SketchPlugin_ConstraintHorizontal::ID());
422 fillAttribute(theLine, aFeature->refattr(SketchPlugin_Constraint::ENTITY_A()));
427 std::shared_ptr<ModelAPI_Feature> SketchAPI_Sketch::setLength(
428 const ModelHighAPI_RefAttr & theLine,
429 const ModelHighAPI_Double & theValue)
431 std::shared_ptr<ModelAPI_Feature> aFeature =
432 compositeFeature()->addFeature(SketchPlugin_ConstraintLength::ID());
433 fillAttribute(theLine, aFeature->refattr(SketchPlugin_Constraint::ENTITY_A()));
434 fillAttribute(theValue, aFeature->real(SketchPlugin_Constraint::VALUE()));
439 std::shared_ptr<ModelAPI_Feature> SketchAPI_Sketch::setMiddlePoint(
440 const ModelHighAPI_RefAttr & thePoint,
441 const ModelHighAPI_RefAttr & theLine)
443 std::shared_ptr<ModelAPI_Feature> aFeature =
444 compositeFeature()->addFeature(SketchPlugin_ConstraintMiddle::ID());
445 fillAttribute(thePoint, aFeature->refattr(SketchPlugin_Constraint::ENTITY_A()));
446 fillAttribute(theLine, aFeature->refattr(SketchPlugin_Constraint::ENTITY_B()));
451 std::shared_ptr<ModelAPI_Feature> SketchAPI_Sketch::setParallel(
452 const ModelHighAPI_RefAttr & theLine1,
453 const ModelHighAPI_RefAttr & theLine2)
455 std::shared_ptr<ModelAPI_Feature> aFeature =
456 compositeFeature()->addFeature(SketchPlugin_ConstraintParallel::ID());
457 fillAttribute(theLine1, aFeature->refattr(SketchPlugin_Constraint::ENTITY_A()));
458 fillAttribute(theLine2, aFeature->refattr(SketchPlugin_Constraint::ENTITY_B()));
463 std::shared_ptr<ModelAPI_Feature> SketchAPI_Sketch::setPerpendicular(
464 const ModelHighAPI_RefAttr & theLine1,
465 const ModelHighAPI_RefAttr & theLine2)
467 std::shared_ptr<ModelAPI_Feature> aFeature =
468 compositeFeature()->addFeature(SketchPlugin_ConstraintPerpendicular::ID());
469 fillAttribute(theLine1, aFeature->refattr(SketchPlugin_Constraint::ENTITY_A()));
470 fillAttribute(theLine2, aFeature->refattr(SketchPlugin_Constraint::ENTITY_B()));
475 std::shared_ptr<ModelAPI_Feature> SketchAPI_Sketch::setRadius(
476 const ModelHighAPI_RefAttr & theCircleOrArc,
477 const ModelHighAPI_Double & theValue)
479 std::shared_ptr<ModelAPI_Feature> aFeature =
480 compositeFeature()->addFeature(SketchPlugin_ConstraintRadius::ID());
481 fillAttribute(theCircleOrArc, aFeature->refattr(SketchPlugin_Constraint::ENTITY_A()));
482 fillAttribute(theValue, aFeature->real(SketchPlugin_Constraint::VALUE()));
487 std::shared_ptr<ModelAPI_Feature> SketchAPI_Sketch::setRigid(
488 const ModelHighAPI_RefAttr & theObject)
490 // TODO(spo): should it be renamed to Fixed?
491 std::shared_ptr<ModelAPI_Feature> aFeature =
492 compositeFeature()->addFeature(SketchPlugin_ConstraintRigid::ID());
493 fillAttribute(theObject, aFeature->refattr(SketchPlugin_Constraint::ENTITY_A()));
498 std::shared_ptr<ModelAPI_Feature> SketchAPI_Sketch::setTangent(
499 const ModelHighAPI_RefAttr & theLine,
500 const ModelHighAPI_RefAttr & theCircle)
502 std::shared_ptr<ModelAPI_Feature> aFeature =
503 compositeFeature()->addFeature(SketchPlugin_ConstraintTangent::ID());
504 fillAttribute(theLine, aFeature->refattr(SketchPlugin_Constraint::ENTITY_A()));
505 fillAttribute(theCircle, aFeature->refattr(SketchPlugin_Constraint::ENTITY_B()));
510 std::shared_ptr<ModelAPI_Feature> SketchAPI_Sketch::setVertical(
511 const ModelHighAPI_RefAttr & theLine)
513 std::shared_ptr<ModelAPI_Feature> aFeature =
514 compositeFeature()->addFeature(SketchPlugin_ConstraintVertical::ID());
515 fillAttribute(theLine, aFeature->refattr(SketchPlugin_Constraint::ENTITY_A()));
520 //--------------------------------------------------------------------------------------