From 42b3fb231006f2fe057d9eb16904ff56a8473506 Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 24 Sep 2010 08:46:39 +0000 Subject: [PATCH] Issue 21000: EDF 1534 GEOM: Save operation unavailable after color changed --- src/DisplayGUI/DisplayGUI.cxx | 6 ++++++ src/GEOMGUI/GeometryGUI.cxx | 11 +++++++++++ src/GEOMGUI/GeometryGUI.h | 2 ++ src/GEOMToolsGUI/GEOMToolsGUI_1.cxx | 8 ++++++++ src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx | 2 ++ 5 files changed, 29 insertions(+) diff --git a/src/DisplayGUI/DisplayGUI.cxx b/src/DisplayGUI/DisplayGUI.cxx index 7d131f0eb..d77481e8f 100644 --- a/src/DisplayGUI/DisplayGUI.cxx +++ b/src/DisplayGUI/DisplayGUI.cxx @@ -342,6 +342,7 @@ void DisplayGUI::SetDisplayMode( const int mode, SUIT_ViewWindow* viewWindow ) if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) { SVTK_View* aView = ((SVTK_ViewWindow*)viewWindow)->getView(); aView->SetDisplayMode( mode ); + GeometryGUI::Modified(); } else if ( viewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() ) { OCCViewer_Viewer* v3d = ((OCCViewer_ViewManager*)(viewWindow->getViewManager()))->getOCCViewer(); @@ -363,6 +364,7 @@ void DisplayGUI::SetDisplayMode( const int mode, SUIT_ViewWindow* viewWindow ) } ic->SetDisplayMode( newmode, Standard_False ); + GeometryGUI::Modified(); } } @@ -413,6 +415,7 @@ void DisplayGUI::SetVectorMode( const bool mode, SUIT_ViewWindow* viewWindow ) } } } + GeometryGUI::Modified(); } else if ( viewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() ) { viewWindow->setCustomData( "VectorsMode", QVariant( mode ) ); @@ -433,6 +436,7 @@ void DisplayGUI::SetVectorMode( const bool mode, SUIT_ViewWindow* viewWindow ) } ite.Next(); } + GeometryGUI::Modified(); } } @@ -504,6 +508,7 @@ void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow } } aView->Repaint(); + GeometryGUI::Modified(); } else if ( viewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() ) { OCCViewer_Viewer* v3d = ((OCCViewer_ViewManager*)(viewWindow->getViewManager()))->getOCCViewer(); @@ -534,6 +539,7 @@ void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow } } ic->UpdateCurrentViewer(); + GeometryGUI::Modified(); } } diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index 4cde5395f..740792c7b 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -151,6 +151,17 @@ SALOMEDS::Study_var GeometryGUI::ClientStudyToStudy (_PTR(Study) theStudy) return aDSStudy._retn(); } +void GeometryGUI::Modified( bool theIsUpdateActions ) +{ + if( SalomeApp_Application* app = dynamic_cast( SUIT_Session::session()->activeApplication() ) ) { + if( SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ) ) { + appStudy->Modified(); + if( theIsUpdateActions ) + app->updateActions(); + } + } +} + //======================================================================= // function : GeometryGUI::GeometryGUI() // purpose : Constructor diff --git a/src/GEOMGUI/GeometryGUI.h b/src/GEOMGUI/GeometryGUI.h index 23aabc8c6..4e4dd3921 100644 --- a/src/GEOMGUI/GeometryGUI.h +++ b/src/GEOMGUI/GeometryGUI.h @@ -87,6 +87,8 @@ public: static CORBA::Object_var ClientSObjectToObject (_PTR(SObject) theSObject); static SALOMEDS::Study_var ClientStudyToStudy (_PTR(Study) theStudy); + static void Modified( bool = true ); + GEOM_Client& GetShapeReader() { return myShapeReader; } // Get active dialog box diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx index ae395b43a..7706ab3c9 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx @@ -325,6 +325,7 @@ void GEOMToolsGUI::OnColor() for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) { aView->SetColor( It.Value(), c ); } + GeometryGUI::Modified(); } } // if ( isVTK ) else if ( isOCC ) { @@ -382,6 +383,7 @@ void GEOMToolsGUI::OnColor() anObject->SetColor( aSColor ); anObject->SetAutoColor( false ); } + GeometryGUI::Modified(); } } // if c.isValid() } // first IO is not null @@ -444,6 +446,7 @@ void GEOMToolsGUI::OnChangeTransparency( bool increase ) aView->SetTransparency( It.Value(), transp ); } aView->Repaint(); + GeometryGUI::Modified(); } // if ( isVTK ) else if ( isOCC ) { @@ -475,6 +478,7 @@ void GEOMToolsGUI::OnChangeTransparency( bool increase ) } } // for... ic->UpdateCurrentViewer(); + GeometryGUI::Modified(); } // if ( isOCC ) } @@ -538,6 +542,7 @@ void GEOMToolsGUI::OnNbIsos( ActionType actionType ) ic->Redisplay(CurObject); } } + GeometryGUI::Modified(); } else if(isVTK){ // if is VTKViewer // @@ -627,6 +632,7 @@ void GEOMToolsGUI::OnNbIsos( ActionType actionType ) anAct = aCollection->GetNextActor(); } view->Repaint(); + GeometryGUI::Modified(); } // end vtkviewer } @@ -673,6 +679,7 @@ void GEOMToolsGUI::OnDeflection() } } } + GeometryGUI::Modified(); } else if (isVTK) { // if is VTKViewer SalomeApp_Application* app = dynamic_cast @@ -737,6 +744,7 @@ void GEOMToolsGUI::OnDeflection() anAct = aCollection->GetNextActor(); } } + GeometryGUI::Modified(); } // end vtkviewer } diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx index 5856aa4e6..33940d0a0 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx @@ -269,6 +269,7 @@ void GEOMToolsGUI_TransparencyDlg::SetTransparency() for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) { aView->SetTransparency( It.Value(), newValue ); } + GeometryGUI::Modified(); aView->Repaint(); } // if ( isVTK ) @@ -300,6 +301,7 @@ void GEOMToolsGUI_TransparencyDlg::SetTransparency() } } // for... ic->UpdateCurrentViewer(); + GeometryGUI::Modified(); } // if ( isOCC ) ValueHasChanged();