+ myCurve->addPoints( aCoords, aSection, anInsertPos );
+ mySectionView->pointsAdded( aSection, myCurve->getNbPoints( aSection ) );
+
+ finishCurveModification( aSelPoints );
+
+ setSelectedPonts( 0 );
+ updateUndoRedo();
+}
+
+void CurveCreator_Widget::moveSelectedPoints( const int theXPosition,
+ const int theYPosition )
+{
+ OCCViewer_Viewer* aViewer = getOCCViewer();
+ if ( !aViewer )
+ return;
+
+ QList<int> 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();
+
+ int aSectionId = 0;
+ int aPointId;
+ std::deque<float> aChangedPos;
+ for ( int i = 0, aNb = myDragPoints.size(); i < aNb; i++ ) {
+ aPointId = myDragPoints[i];
+ aChangedPos = myCurve->getPoint( aSectionId, aPointId );
+ if ( aChangedPos.size() < 2 )
+ continue;
+ aChangedPos[0] = aChangedPos[0] - aXDelta;
+ aChangedPos[1] = aChangedPos[1] - anYDelta;
+ myCurve->setPoint( aSectionId, aPointId, aChangedPos );