+
+void ShowNPoints_Tools::JoinPoints()
+{
+ WidgetShowNPoints* wsp = bbGetInputWidgetShowNPoints();
+ wsp->StopAutoAddPoints();
+ wsp->StopTrackPoint();
+ if((wsp->GetLstModelShowNPointsSize()>=2)
+ && (wsp->GetModelShowNPoints()->GetLstPointsSize()>0))
+ {
+ int numberOfSplines = wsp->GetLstModelShowNPointsSize();
+ double x, y, z;
+ int sizeCurrentSpline, i;
+ wsp->GetModelShowNPoints()->GetIdPoint(0, &x, &y, &z);
+ std::vector<double> pointStart = {x, y, z};
+ sizeCurrentSpline = wsp->GetModelShowNPoints()->GetLstPointsX().size();
+ wsp->GetModelShowNPoints()->GetIdPoint(sizeCurrentSpline-1, &x, &y, &z);
+ std::vector<double> pointEnd = {x, y, z};
+ for(i = 0; i < numberOfSplines; i++){
+ sizeCurrentSpline = wsp->GetModelShowNPoints(i)->GetLstPointsX().size();
+ wsp->SetCollectionPoint(i, 0, pointStart);
+ wsp->SetCollectionPoint(i, sizeCurrentSpline-1, pointEnd);
+ }
+ wsp->SetOutputBox();
+ wsp->UndoRedo_SaveCollection();
+ }
+}