From c832083dc42c0c489271ce585a670afafa172ddb Mon Sep 17 00:00:00 2001 From: nds Date: Wed, 20 Nov 2013 09:50:16 +0000 Subject: [PATCH] A correction is necessary to the presentation doesn't disappear after Undo/Redo actions. --- src/HYDROCurveCreator/CurveCreator_Widget.cxx | 15 +++++++++++++-- src/HYDROCurveCreator/CurveCreator_Widget.h | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) 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 ); -- 2.39.2