Salome HOME
Task #3230: Sketcher: create a curve passing through selected points or vertices...
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_MacroBSpline.cpp
index 48158f1a826c86f48da608976153abbee07f3261..3d3ab4c53e7c92616bb209c0ab0b0085f1fe84c9 100644 (file)
@@ -84,7 +84,7 @@ void SketchPlugin_MacroBSpline::execute()
 
   if (boolean(CONTROL_POLYGON_ID())->value()) {
     std::list<FeaturePtr> aControlPoles;
-    createControlPolygon(aBSpline, aControlPoles);
+    createControlPolygon(aBSpline, myIsPeriodic, aControlPoles);
     constraintsForPoles(aControlPoles);
   }
 }
@@ -147,6 +147,7 @@ FeaturePtr SketchPlugin_MacroBSpline::createBSplineFeature()
 }
 
 void SketchPlugin_MacroBSpline::createControlPolygon(FeaturePtr theBSpline,
+                                                     bool thePeriodic,
                                                      std::list<FeaturePtr>& thePoles)
 {
   AttributePoint2DArrayPtr aPoles = std::dynamic_pointer_cast<GeomDataAPI_Point2DArray>(
@@ -158,7 +159,7 @@ void SketchPlugin_MacroBSpline::createControlPolygon(FeaturePtr theBSpline,
   // segments
   for (int index = 1; index < aSize; ++index)
     createAuxiliarySegment(aPoles, index - 1, index);
-  if (myIsPeriodic) {
+  if (thePeriodic) {
     // additional segment to close the control polygon
     createAuxiliarySegment(aPoles, aSize - 1, 0);
   }