From: apo Date: Thu, 1 Dec 2005 11:23:01 +0000 (+0000) Subject: Adjust to HEAD modifications X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=cced5d27a91ce9bbe3bc9f451533fedb51f2da74;p=modules%2Fgeom.git Adjust to HEAD modifications --- diff --git a/src/DisplayGUI/DisplayGUI.cxx b/src/DisplayGUI/DisplayGUI.cxx index 1d7aa473c..61dc6bfca 100644 --- a/src/DisplayGUI/DisplayGUI.cxx +++ b/src/DisplayGUI/DisplayGUI.cxx @@ -30,28 +30,29 @@ #include "GeometryGUI.h" #include "GEOM_Displayer.h" -#include "SUIT_Desktop.h" -#include "SUIT_Session.h" -#include "SUIT_ViewWindow.h" -#include "SUIT_OverrideCursor.h" +#include +#include +#include +#include -#include "VTKViewer_ViewWindow.h" -#include "OCCViewer_ViewManager.h" -#include "OCCViewer_ViewModel.h" -#include "OCCViewer_ViewWindow.h" +#include +#include +#include -#include "SALOME_ListIteratorOfListIO.hxx" +#include -#include "SVTK_ViewWindow.h" -#include "SVTK_View.h" -#include "SVTK_ViewModel.h" -#include "SOCC_ViewModel.h" -#include "SVTK_Prs.h" -#include "SOCC_Prs.h" +#include +#include +#include +#include +#include +#include -#include "SalomeApp_Application.h" -#include "SalomeApp_SelectionMgr.h" -#include "SalomeApp_Study.h" +#include + +#include +#include +#include #include @@ -98,23 +99,30 @@ DisplayGUI::~DisplayGUI() bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent) { DisplayGUI* myDisplayGUI = GetDisplayGUI( getGeometryGUI() ); + LightApp_SelectionMgr *Sel = getGeometryGUI()->getApp()->selectionMgr(); + SALOME_ListIO selected; + Sel->selectedObjects( selected ); switch (theCommandID) { case 211: // MENU VIEW - WIREFRAME/SHADING { myDisplayGUI->InvertDisplayMode(); int newMode = myDisplayGUI->GetDisplayMode(); - SUIT_Session::session()->activeApplication()->desktop()->menuBar()-> - changeItem( 211, newMode == 1 ? tr( "GEOM_MEN_WIREFRAME" ) : tr("GEOM_MEN_SHADING") ); + getGeometryGUI()->action( 211 )->setMenuText( newMode == 1 ? tr( "GEOM_MEN_WIREFRAME" ) : tr("GEOM_MEN_SHADING") ); + getGeometryGUI()->menuMgr()->update(); +// SUIT_Session::session()->activeApplication()->desktop()->menuBar()-> +// changeItem( 211, newMode == 1 ? tr( "GEOM_MEN_WIREFRAME" ) : tr("GEOM_MEN_SHADING") ); break; } case 212: // MENU VIEW - DISPLAY ALL { + getGeometryGUI()->EmitSignalDeactivateDialog(); myDisplayGUI->DisplayAll(); break; } case 213: // MENU VIEW - DISPLAY ONLY { + getGeometryGUI()->EmitSignalDeactivateDialog(); myDisplayGUI->DisplayOnly(); break; } @@ -130,6 +138,7 @@ bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent) } case 216: // MENU VIEW - DISPLAY { + getGeometryGUI()->EmitSignalDeactivateDialog(); myDisplayGUI->Display(); break; } @@ -149,6 +158,7 @@ bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent) break; } } + Sel->setSelectedObjects( selected ); return true; } @@ -198,7 +208,7 @@ void DisplayGUI::EraseAll() SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ); SUIT_ViewManager* vman = vw->getViewManager(); if ( vman->getType() == OCCViewer_Viewer::Type() || - vman->getType() == VTKViewer_Viewer::Type() ) { + vman->getType() == SVTK_Viewer::Type() ) { GEOM_Displayer( appStudy ).EraseAll(); } } @@ -230,7 +240,7 @@ void DisplayGUI::Display() if ( !anActiveStudy ) return; //get SalomeApp selection manager - SalomeApp_SelectionMgr* aSelMgr = app->selectionMgr(); + LightApp_SelectionMgr* aSelMgr = app->selectionMgr(); if ( !aSelMgr ) return; SALOME_ListIO aList; @@ -286,7 +296,7 @@ void DisplayGUI::Erase() if ( !anActiveStudy ) return; //get SalomeApp selection manager - SalomeApp_SelectionMgr* aSelMgr = app->selectionMgr(); + LightApp_SelectionMgr* aSelMgr = app->selectionMgr(); if ( !aSelMgr ) return; SALOME_ListIO aList; @@ -337,7 +347,7 @@ void DisplayGUI::SetDisplayMode( const int mode, SUIT_ViewWindow* viewWindow ) if ( !viewWindow ) viewWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow(); - if ( viewWindow->getViewManager()->getType() == VTKViewer_Viewer::Type() ) { + if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) { SVTK_View* aView = ((SVTK_ViewWindow*)viewWindow)->getView(); aView->SetDisplayMode( mode ); } @@ -373,7 +383,7 @@ int DisplayGUI::GetDisplayMode( SUIT_ViewWindow* viewWindow ) int dispMode = 0; if ( !viewWindow ) viewWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow(); - if ( viewWindow->getViewManager()->getType() == VTKViewer_Viewer::Type() ) { + if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) { SVTK_View* aView = ((SVTK_ViewWindow*)viewWindow)->getView(); dispMode = aView->GetDisplayMode(); } @@ -409,14 +419,14 @@ void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); if ( !app ) return; - SalomeApp_SelectionMgr* aSelMgr = app->selectionMgr(); + LightApp_SelectionMgr* aSelMgr = app->selectionMgr(); if ( !aSelMgr ) return; SUIT_OverrideCursor(); SALOME_ListIO aList; - if ( viewWindow->getViewManager()->getType() == VTKViewer_Viewer::Type() ) { + if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) { SVTK_ViewWindow* vw = dynamic_cast( viewWindow ); SVTK_View* aView = vw->getView(); @@ -424,8 +434,8 @@ void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow SALOME_ListIteratorOfListIO It( aList ); for( ;It.More(); It.Next() ) { - SVTK_Viewer* stvkViewer = (SVTK_Viewer*)(vw->getViewManager()->getViewModel()); - SVTK_Prs* vtkPrs = dynamic_cast( stvkViewer->CreatePrs( It.Value()->getEntry() ) ); + SVTK_Viewer* stvkViewer = dynamic_cast(vw->getViewManager()->getViewModel()); + SVTK_Prs* vtkPrs = stvkViewer ? dynamic_cast( stvkViewer->CreatePrs( It.Value()->getEntry() ) ) : 0; if ( vtkPrs && !vtkPrs->IsNull() ) { if ( mode == 0 ) aView->ChangeRepresentationToWireframe( vtkPrs->GetObjects() ); diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx index 6afcf7a4b..1d1c12a38 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx @@ -41,25 +41,25 @@ #include "SALOME_ListIO.hxx" #include "SALOME_ListIteratorOfListIO.hxx" -#include "VTKViewer_ViewModel.h" -#include "OCCViewer_ViewModel.h" -#include "OCCViewer_ViewWindow.h" - -#include "SVTK_ViewWindow.h" -#include "SVTK_View.h" - -#include "SUIT_ViewManager.h" -#include "SUIT_Application.h" -#include "SUIT_Desktop.h" -#include "SUIT_ResourceMgr.h" -#include "SUIT_Session.h" -#include "SUIT_OverrideCursor.h" -#include "SUIT_MessageBox.h" - -#include "SalomeApp_Application.h" -#include "SalomeApp_SelectionMgr.h" -#include "SalomeApp_Study.h" -#include "SalomeApp_Module.h" +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include #include "SALOMEDSClient.hxx" @@ -100,7 +100,7 @@ void GEOMToolsGUI::OnSettingsColor() if( aDialogColor.isValid() ) { QString type = desk->activeWindow()->getViewManager()->getType(); - if( type != OCCViewer_Viewer::Type() && type != VTKViewer_Viewer::Type() ) + if( type != OCCViewer_Viewer::Type() && type != SVTK_Viewer::Type() ) MESSAGE("Settings Color is not supported for current Viewer"); resMgr->setValue( "Geometry", "SettingsShadingColor", aDialogColor ); @@ -170,7 +170,7 @@ void GEOMToolsGUI::OnRename() SALOME_ListIO selected; SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); if ( app ) { - SalomeApp_SelectionMgr* aSelMgr = app->selectionMgr(); + LightApp_SelectionMgr* aSelMgr = app->selectionMgr(); SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ); if ( aSelMgr && appStudy ) { aSelMgr->selectedObjects( selected ); @@ -225,13 +225,13 @@ void GEOMToolsGUI::OnColor() SALOME_ListIO selected; SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); if ( app ) { - SalomeApp_SelectionMgr* aSelMgr = app->selectionMgr(); + LightApp_SelectionMgr* aSelMgr = app->selectionMgr(); if ( aSelMgr ) { aSelMgr->selectedObjects( selected ); if ( !selected.IsEmpty() ) { SUIT_ViewWindow* window = app->desktop()->activeWindow(); bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() ); - bool isVTK = ( window && window->getViewManager()->getType() == VTKViewer_Viewer::Type() ); + bool isVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() ); if ( isVTK ) { SVTK_ViewWindow* vtkVW = dynamic_cast( window ); if ( !vtkVW ) diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx index e7e255183..0984dd88c 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx @@ -33,22 +33,22 @@ #include "SALOME_ListIO.hxx" #include "SALOME_ListIteratorOfListIO.hxx" -#include "VTKViewer_ViewModel.h" -#include "OCCViewer_ViewModel.h" -#include "OCCViewer_ViewWindow.h" +#include +#include +#include -#include "SVTK_ViewWindow.h" -#include "SVTK_View.h" +#include +#include -#include "SUIT_ViewManager.h" -#include "SUIT_Application.h" -#include "SUIT_Desktop.h" -#include "SUIT_ResourceMgr.h" -#include "SUIT_Session.h" -#include "SUIT_OverrideCursor.h" +#include +#include +#include +#include +#include +#include -#include "SalomeApp_Application.h" -#include "SalomeApp_SelectionMgr.h" +#include +#include #include #include @@ -185,7 +185,7 @@ void GEOMToolsGUI_TransparencyDlg::ValueHasChanged( int newValue ) SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); if ( !app ) return; - SalomeApp_SelectionMgr* aSelMgr = app->selectionMgr(); + LightApp_SelectionMgr* aSelMgr = app->selectionMgr(); if ( !aSelMgr ) return; SALOME_ListIO selected; @@ -199,7 +199,7 @@ void GEOMToolsGUI_TransparencyDlg::ValueHasChanged( int newValue ) SUIT_ViewWindow* window = app->desktop()->activeWindow(); bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() ); - bool isVTK = ( window && window->getViewManager()->getType() == VTKViewer_Viewer::Type() ); + bool isVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() ); if ( isVTK ) { SVTK_ViewWindow* vtkVW = dynamic_cast( window );