const int SCENE_PIXEL_TOLERANCE = 10;
+//#define USE_SEVERAL_POINTS
+
CurveCreator_Widget::CurveCreator_Widget(QWidget* parent,
CurveCreator_ICurve *theCurve,
Qt::WindowFlags fl)
SectionToPointList aSelPoints;
startCurveModification( aSelPoints, false );
+#ifdef USE_SEVERAL_POINTS
+ myCurve->removeSeveralPoints( aPoints );
+#else
// the points should be removed in a decreased order
QMap<int, QList<int> > aConvPoints;
convert( aPoints, aConvPoints );
mySectionView->pointsRemoved( aSectionId, aPntIndx );
}
}
-
+#endif
finishCurveModification( SectionToPointList() );
}
double aXDelta = aStartPnt.X() - anEndPnt.X();
double anYDelta = aStartPnt.Y() - anEndPnt.Y();
- int aSectionId;
- int aPointId;
+ CurveCreator_ICurve::SectionToPointCoordsList aCoordList;
std::deque<float> aChangedPos;
SectionToPointList::const_iterator anIt = myDragPoints.begin(), aLast = myDragPoints.end();
for ( ; anIt != aLast; anIt++ ) {
- aSectionId = anIt->first;
- aPointId = anIt->second;
- aChangedPos = myCurve->getPoint( aSectionId, aPointId );
+ aChangedPos = myCurve->getPoint( anIt->first, anIt->second );
if ( aChangedPos.size() < 2 )
continue;
aChangedPos[0] = aChangedPos[0] - aXDelta;
aChangedPos[1] = aChangedPos[1] - anYDelta;
- myCurve->setPoint( aSectionId, aPointId, aChangedPos );
+#ifndef USE_SEVERAL_POINTS
+ myCurve->setPoint( anIt->first, anIt->second, aChangedPos );
+#endif
}
+#ifdef USE_SEVERAL_POINTS
+ myCurve->setSeveralPoints( aCoordList );
+#endif
+
myDragged = true;
finishCurveModification( myDragPoints );
}