+ myCurve->addPoints( aCoords, aSectionId, anInsertPos );
+ mySectionView->pointsAdded( aSectionId, myCurve->getNbPoints( aSectionId ) );
+
+ finishCurveModification( aSelPoints );
+
+ setSelectedPonts();
+}
+
+void CurveCreator_Widget::moveSelectedPoints( const int theXPosition,
+ const int theYPosition )
+{
+ OCCViewer_Viewer* aViewer = getOCCViewer();
+ if ( !aViewer )
+ return;
+
+ SectionToPointList aPoints;
+ startCurveModification( aPoints, false );
+
+ OCCViewer_ViewWindow* aWindow =
+ (OCCViewer_ViewWindow*)aViewer->getViewManager()->getActiveView();
+ gp_Pnt aStartPnt = CurveCreator_Utils::ConvertClickToPoint( myDragStartPosition.x(),
+ myDragStartPosition.y(),
+ aWindow->getViewPort()->getView() );
+ gp_Pnt anEndPnt = CurveCreator_Utils::ConvertClickToPoint( theXPosition, theYPosition,
+ aWindow->getViewPort()->getView() );
+ double aXDelta = aStartPnt.X() - anEndPnt.X();
+ double anYDelta = aStartPnt.Y() - anEndPnt.Y();
+
+ CurveCreator_ICurve::SectionToPointCoordsList aCoordList;
+ std::deque<float> aChangedPos;
+ SectionToPointList::const_iterator anIt = myDragPoints.begin(), aLast = myDragPoints.end();
+ for ( ; anIt != aLast; anIt++ ) {
+ int aSectionId = anIt->first;
+ int aPointId = anIt->second;
+ aChangedPos = myCurve->getPoint( aSectionId, aPointId );
+ if ( aChangedPos.size() < 2 )
+ continue;
+ aChangedPos[0] = aChangedPos[0] - aXDelta;
+ aChangedPos[1] = aChangedPos[1] - anYDelta;
+
+ aCoordList.push_back(
+ std::make_pair(std::make_pair( aSectionId, aPointId ),
+ aChangedPos ));