]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
A correction is necessary to the presentation doesn't disappear after Undo/Redo actions.
authornds <nds@opencascade.com>
Wed, 20 Nov 2013 09:50:16 +0000 (09:50 +0000)
committernds <nds@opencascade.com>
Wed, 20 Nov 2013 09:50:16 +0000 (09:50 +0000)
src/HYDROCurveCreator/CurveCreator_Widget.cxx
src/HYDROCurveCreator/CurveCreator_Widget.h

index bfd8c809073aebfd304e4fe38b603e2bbea2106c..fed3c5013b2fb983f1a251199b4b914ebb6567a9 100644 (file)
@@ -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 );
 }
 
index 2ca9f1d6190832091d02603068ad1821a67ac67a..d0559c50b67cc7bc586b97a7e93f585cab502b47 100644 (file)
@@ -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 );