From: nds Date: Wed, 20 Nov 2013 09:50:16 +0000 (+0000) Subject: A correction is necessary to the presentation doesn't disappear after Undo/Redo actions. X-Git-Tag: BR_hydro_v_0_3_1~39 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c832083dc42c0c489271ce585a670afafa172ddb;p=modules%2Fhydro.git A correction is necessary to the presentation doesn't disappear after Undo/Redo actions. --- diff --git a/src/HYDROCurveCreator/CurveCreator_Widget.cxx b/src/HYDROCurveCreator/CurveCreator_Widget.cxx index bfd8c809..fed3c501 100644 --- a/src/HYDROCurveCreator/CurveCreator_Widget.cxx +++ b/src/HYDROCurveCreator/CurveCreator_Widget.cxx @@ -732,7 +732,11 @@ void CurveCreator_Widget::onUndo() { if( !myCurve ) return; + + CurveCreator_Widget::SectionToPointList aPoints; + startCurveModification( aPoints, false ); myCurve->undo(); + finishCurveModification(); mySectionView->reset(); updateUndoRedo(); } @@ -741,7 +745,10 @@ void CurveCreator_Widget::onRedo() { if( !myCurve ) return; + CurveCreator_Widget::SectionToPointList aPoints; + startCurveModification( aPoints, false ); myCurve->redo(); + finishCurveModification(); mySectionView->reset(); updateUndoRedo(); } @@ -1134,6 +1141,7 @@ void CurveCreator_Widget::updateLocalPointView() bool isBlocked = myLocalPointView->blockSignals(true); gp_Pnt aPnt; myLocalPointView->setRowCount( 0 ); + int anInitialCount = myLocalPointView->rowCount(); for ( aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected() ) { TopoDS_Vertex aVertex; TopoDS_Shape aShape = aContext->SelectedShape(); @@ -1168,6 +1176,9 @@ void CurveCreator_Widget::updateLocalPointView() addLocalPointToTable( aPnt.X(), aPnt.Y() ); } } + int aFinalCount = myLocalPointView->rowCount(); + if ( anInitialCount == aFinalCount ) + int aValue = 9; myLocalPointView->blockSignals(isBlocked); } @@ -1384,8 +1395,8 @@ void CurveCreator_Widget::startCurveModification( void CurveCreator_Widget::finishCurveModification( const CurveCreator_Widget::SectionToPointList& thePoints ) { - setLocalPointContext( true ); - int aSectionId = 0; + if ( getActionMode() == ModificationMode ) + setLocalPointContext( true ); setSelectedPonts( thePoints ); } diff --git a/src/HYDROCurveCreator/CurveCreator_Widget.h b/src/HYDROCurveCreator/CurveCreator_Widget.h index 2ca9f1d6..d0559c50 100644 --- a/src/HYDROCurveCreator/CurveCreator_Widget.h +++ b/src/HYDROCurveCreator/CurveCreator_Widget.h @@ -157,7 +157,7 @@ private: void startCurveModification( SectionToPointList& thePoints, const bool theFillPoints = true ); - void finishCurveModification( const SectionToPointList& thePoints ); + void finishCurveModification( const SectionToPointList& thePoints = SectionToPointList() ); // curve algorithm int findLocalPointIndex( int theSectionId, float theX, float theY );