From 60f2747aec855ddc70e204435130c2c8fe8da9e5 Mon Sep 17 00:00:00 2001 From: nds Date: Wed, 20 Nov 2013 12:11:02 +0000 Subject: [PATCH] Using stl container instead of Qt. --- src/HYDROCurveCreator/CurveCreator_Widget.cxx | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/HYDROCurveCreator/CurveCreator_Widget.cxx b/src/HYDROCurveCreator/CurveCreator_Widget.cxx index f55d43d4..73ffd42b 100644 --- a/src/HYDROCurveCreator/CurveCreator_Widget.cxx +++ b/src/HYDROCurveCreator/CurveCreator_Widget.cxx @@ -75,6 +75,8 @@ const int POINT_INDEX_COLUMN_WIDTH = 40; const int SCENE_PIXEL_TOLERANCE = 10; +//#define USE_SEVERAL_POINTS + CurveCreator_Widget::CurveCreator_Widget(QWidget* parent, CurveCreator_ICurve *theCurve, Qt::WindowFlags fl) @@ -1001,6 +1003,9 @@ void CurveCreator_Widget::removePoint() SectionToPointList aSelPoints; startCurveModification( aSelPoints, false ); +#ifdef USE_SEVERAL_POINTS + myCurve->removeSeveralPoints( aPoints ); +#else // the points should be removed in a decreased order QMap > aConvPoints; convert( aPoints, aConvPoints ); @@ -1017,7 +1022,7 @@ void CurveCreator_Widget::removePoint() mySectionView->pointsRemoved( aSectionId, aPntIndx ); } } - +#endif finishCurveModification( SectionToPointList() ); } @@ -1113,20 +1118,23 @@ void CurveCreator_Widget::moveSelectedPoints( const int theXPosition, double aXDelta = aStartPnt.X() - anEndPnt.X(); double anYDelta = aStartPnt.Y() - anEndPnt.Y(); - int aSectionId; - int aPointId; + CurveCreator_ICurve::SectionToPointCoordsList aCoordList; std::deque 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 ); } -- 2.39.2