From: vsv Date: Thu, 24 Jul 2008 14:53:11 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: TG_VISU_2008_2008-08-22~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0f3df66aff29afef05e62c99e16ddade6d918848;p=modules%2Fvisu.git *** empty log message *** --- diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index c307b796..713ae9c2 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -150,7 +150,7 @@ #include "VisuGUI_Timer.h" -#include "VVTK_ViewModel.h" +//#include "VVTK_ViewModel.h" #include "VisuGUI_Slider.h" #include "VisuGUI_Sweep.h" @@ -2649,7 +2649,7 @@ VisuGUI mgr->setRule( action( VISU_RESTORE_VIEW_PARAMS ), "selcount=1 and type='VISU::TVIEW3D' and activeView='VTKViewer'" ); //mgr->setRule( action( VISU_DELETE_VIEW_PARAMS ), "selcount=1 and type='VISU::TVIEW3D'", true ); - mgr->setRule( action( VISU_ARRANGE_ACTORS ), "$client in {'VTKViewer' 'VVTK'} and selcount=0" ); + mgr->setRule( action( VISU_ARRANGE_ACTORS ), "$client in {'VTKViewer' 'SVTK'} and selcount=0" ); // 3D presentations commands QString aPrsType = " and $type in {'VISU::TMESH' 'VISU::TGAUSSPOINTS' " + aPrsAll + "}"; @@ -2744,13 +2744,13 @@ VisuGUI aRule = "client='ObjectBrowser' and selcount>0"; aRule += " and $type in {'VISU::TFIELD'}"; aRule += " and nbTimeStamps>1"; - aRule += " and activeView in {'VTKViewer' 'VVTK'}"; + aRule += " and activeView in {'VTKViewer' 'SVTK'}"; mgr->setRule( action( VISU_PARALLELANIMATION ), aRule ); aRule = "client='ObjectBrowser' and selcount>0"; aRule += " and $type in {'VISU::TFIELD'}"; aRule += " and nbTimeStamps>0"; - aRule += " and activeView in {'VTKViewer' 'VVTK'}"; + aRule += " and activeView in {'VTKViewer' 'SVTK'}"; mgr->setRule( action( VISU_SUCCCESSIVEANIMATION ), aRule ); aRule = "client='ObjectBrowser' and $type in {'VISU::TENTITY' 'VISU::TFAMILY' 'VISU::TGROUP'}"; @@ -2968,10 +2968,10 @@ VisuGUI { theList.clear(); // append SVTK viewer only if there is no opened VVTK - SUIT_ViewManager* vm = getApp()->getViewManager( VVTK_Viewer::Type(), false ); - if( vm && vm->getViewsCount()>0 ) - theList.append( VVTK_Viewer::Type() ); - else +// SUIT_ViewManager* vm = getApp()->getViewManager( VVTK_Viewer::Type(), false ); +// if( vm && vm->getViewsCount()>0 ) +// theList.append( VVTK_Viewer::Type() ); +// else theList.append( SVTK_Viewer::Type() ); } @@ -3637,7 +3637,7 @@ void VisuGUI::OnPlot3dFromCutPlane() _PTR(SObject) aTimeStampSObj = aSObject->GetFather(); if (SUIT_ViewManager* aViewManager = getApp()->activeViewManager()) { QString aViewType = aViewManager->getType(); - bool anIsVVTK = (aViewType == VVTK_Viewer::Type()); + //bool anIsVVTK = (aViewType == VVTK_Viewer::Type()); Storable::TRestoringMap aRestoringMap = Storable::GetStorableMap(aTimeStampSObj); VISU::VISUType aType = VISU::Storable::RestoringMap2Type( aRestoringMap ); @@ -3651,13 +3651,13 @@ void VisuGUI::OnPlot3dFromCutPlane() int aPos; SUIT_ViewWindow* aViewWindow = 0; - if (anIsVVTK) { - aViewWindow = GetViewWindow(this); - aPos = GetFreePositionOfDefaultScalarBar(this, dynamic_cast(aViewWindow)); - } else { +// if (anIsVVTK) { +// aViewWindow = GetViewWindow(this); +// aPos = GetFreePositionOfDefaultScalarBar(this, dynamic_cast(aViewWindow)); +// } else { aViewWindow = GetViewWindow(this); aPos = GetFreePositionOfDefaultScalarBar(this, dynamic_cast(GetViewWindow(this))); - } + // } GetResourceMgr()->setValue("VISU", "scalar_bar_position_num", aPos); VISU::Plot3D_i* aPrs3d = diff --git a/src/VISUGUI/VisuGUI_ClippingPanel.cxx b/src/VISUGUI/VisuGUI_ClippingPanel.cxx index 01e4e1fb..59984c11 100644 --- a/src/VISUGUI/VisuGUI_ClippingPanel.cxx +++ b/src/VISUGUI/VisuGUI_ClippingPanel.cxx @@ -406,10 +406,19 @@ void VisuGUI_ClippingPanel::fillPlanesList() void VisuGUI_ClippingPanel::init() { myViewWindow = VISU::GetViewWindow(myModule); + if (myViewWindow) + connect(myViewWindow, SIGNAL(destroyed(QObject*)), this, SLOT(onWindowDestroyed(QObject*))); fillPrsList(); fillPlanesList(); } +void VisuGUI_ClippingPanel::onWindowDestroyed(QObject* theWnd) +{ + if (theWnd == myViewWindow) { + myViewWindow = 0; + } +} + //************************************************************************* //void VisuGUI_ClippingPanel::showEvent(QShowEvent* event) //{ @@ -718,6 +727,8 @@ void VisuGUI_ClippingPanel::onWindowActivated(SUIT_ViewWindow* theWindow) { setPlanesVisible(false); myViewWindow = dynamic_cast(theWindow); + if (myViewWindow) + connect(myViewWindow, SIGNAL(destroyed(QObject*)), this, SLOT(onWindowDestroyed(QObject*))); setPlanesVisible(myShowPlanes->checkState() == Qt::Checked); } diff --git a/src/VISUGUI/VisuGUI_ClippingPanel.h b/src/VISUGUI/VisuGUI_ClippingPanel.h index 13e00e4c..27b977b8 100644 --- a/src/VISUGUI/VisuGUI_ClippingPanel.h +++ b/src/VISUGUI/VisuGUI_ClippingPanel.h @@ -140,6 +140,7 @@ private slots: void onCellChanged(int row, int col); void onObjectDelete(QString theEntry); void onPrsSelected(int thePrs); + void onWindowDestroyed(QObject* theWnd); private: void fillPrsList(); diff --git a/src/VISUGUI/VisuGUI_Displayer.cxx b/src/VISUGUI/VisuGUI_Displayer.cxx index 18c57ce8..dfbf7dff 100644 --- a/src/VISUGUI/VisuGUI_Displayer.cxx +++ b/src/VISUGUI/VisuGUI_Displayer.cxx @@ -32,7 +32,7 @@ #include "VISU_ViewManager_i.hh" #include "VISU_Actor.h" -#include "VVTK_ViewModel.h" +//#include "VVTK_ViewModel.h" #include #include @@ -80,9 +80,9 @@ SALOME_Prs* VisuGUI_Displayer::buildPresentation( const QString& theEntry, SALOM VISU::VISUType aType = aBase->GetType(); VISU::Prs3d_var aPrs3d = VISU::Prs3d::_narrow(aBase); if(!CORBA::is_nil(aPrs3d) || aType == VISU::TCOLOREDPRS3DHOLDER){ - SVTK_Viewer* aViewer = dynamic_cast( aView ); - if (!aViewer) - aViewer = dynamic_cast( aView ); + SVTK_Viewer* aViewer = dynamic_cast( aView ); + //if (!aViewer) + //aViewer = dynamic_cast( aView ); if( aViewer ){ SUIT_ViewManager* aViewManager = aViewer->getViewManager(); SUIT_ViewWindow* aWindow = aViewManager->getActiveView(); @@ -265,7 +265,7 @@ bool VisuGUI_Displayer::canBeDisplayed( const QString& entry, const QString& vie if( study->isComponent( entry ) ) return true; - if( viewer_type==SVTK_Viewer::Type() || viewer_type==VVTK_Viewer::Type()) + if( viewer_type==SVTK_Viewer::Type() /*|| viewer_type==VVTK_Viewer::Type()*/) { VISU::Base_i* aBase = dynamic_cast(VISU::GetServant(anObj).in()); diff --git a/src/VISUGUI/VisuGUI_Module.cxx b/src/VISUGUI/VisuGUI_Module.cxx index b0fd0951..7cb1ecb5 100644 --- a/src/VISUGUI/VisuGUI_Module.cxx +++ b/src/VISUGUI/VisuGUI_Module.cxx @@ -48,9 +48,9 @@ #include "SALOMEDSClient_ClientFactory.hxx" #include "SALOMEDSClient_IParameters.hxx" -#include "VVTK_ViewManager.h" -#include "VVTK_ViewWindow.h" -#include "VVTK_ViewModel.h" +//#include "VVTK_ViewManager.h" +//#include "VVTK_ViewWindow.h" +//#include "VVTK_ViewModel.h" #include "SVTK_ViewModel.h" #include "SVTK_ViewManager.h" @@ -79,7 +79,7 @@ #include "VISU_SphereWidget.hxx" #include "SalomeApp_Study.h" -#include "VVTK_MainWindow.h" +//#include "VVTK_MainWindow.h" #include "VISU_View_i.hh" #ifndef DISABLE_VTKVIEWER @@ -161,7 +161,8 @@ namespace VISU TViewVisibility theViewVisibility) { ViewManagerList l; - app->viewManagers( VVTK_Viewer::Type(), l ); + //app->viewManagers( VVTK_Viewer::Type(), l ); + app->viewManagers( SVTK_Viewer::Type(), l ); ViewManagerList::const_iterator anIt = l.begin(), aLast = l.end(); for( ; anIt!=aLast; anIt++ ) if( SUIT_ViewManager* aViewManager = *anIt ) @@ -205,7 +206,7 @@ void VisuGUI_Module::initialize( CAM_Application* theApp ) createMenu( SAVE_VISU_STATE, fileMenu, 9, -1 ); QPixmap aPixmap; - aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_GAUSS_NEW_VIEWER")); + /* aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_GAUSS_NEW_VIEWER")); createAction( GAUSS_NEW_VIEWER, tr("MEN_GAUSS_NEW_VIEWER"), aPixmap, @@ -219,12 +220,12 @@ void VisuGUI_Module::initialize( CAM_Application* theApp ) int windowMenu = createMenu( tr( "MEN_DESK_WINDOW" ), -1, 100 ); int newWinMenu = createMenu( tr( "MEN_DESK_NEWWINDOW" ), windowMenu, -1, 0 ); createMenu( action( GAUSS_NEW_VIEWER ), newWinMenu, -1 ); - + */ // Add actions to menus createMenu( tr( "MEN_GAUSS" ), -1, -1, 30 ); //createMenu( GAUSS_CREATE_PRS, aMenuId, 10 ); - QString aViewerType = VVTK_Viewer::Type(); + /* QString aViewerType = VVTK_Viewer::Type(); SUIT_Accel* accel = getApp()->accel(); accel->setActionKey( SUIT_Accel::PanLeft, Qt::Key_Left, aViewerType ); accel->setActionKey( SUIT_Accel::PanRight, Qt::Key_Right, aViewerType ); @@ -238,10 +239,10 @@ void VisuGUI_Module::initialize( CAM_Application* theApp ) accel->setActionKey( SUIT_Accel::RotateDown, Qt::CTRL+Qt::Key_Down, aViewerType ); accel->setActionKey( SVTK::PlusSpeedIncrementEvent, Qt::Key_Plus, aViewerType ); accel->setActionKey( SVTK::MinusSpeedIncrementEvent, Qt::Key_Minus, aViewerType ); - + connect( getApp(), SIGNAL( viewManagerAdded( SUIT_ViewManager* ) ), this, SLOT( OnViewManagerAdded (SUIT_ViewManager*) ) ); - + */ // Prepare popup menus QtxPopupMgr* mgr = popupMgr(); QString aRule; @@ -295,7 +296,7 @@ void VisuGUI_Module::initialize( CAM_Application* theApp ) #ifndef DISABLE_VTKVIEWER #ifndef DISABLE_SALOMEOBJECT viewers.append( SVTK_Viewer::Type() ); - viewers.append( VVTK_Viewer::Type() ); + //viewers.append( VVTK_Viewer::Type() ); #else viewers.append( VTKViewer_Viewer::Type() ); #endif @@ -352,14 +353,14 @@ void VisuGUI_Module::initialize( CAM_Application* theApp ) this, SLOT(OnSaveConfiguration())); mgr->insert( action( GAUSS_SAVE_CONFIGURATION ), -1, -1, -1 ); mgr->setRule( action( GAUSS_SAVE_CONFIGURATION ), - "selcount>=0 and client='VVTK' and activeView='VVTK'" ); + "selcount>=0 and client='SVTK' and activeView='SVTK'" ); createAction( GAUSS_OVERWRITE_CONFIGURATION, tr("MEN_OVERWRITE_CONFIGURATION"), QIcon(), tr("MEN_OVERWRITE_CONFIGURATION"), "", 0, this, false, this, SLOT(OnOverwriteConfiguration())); mgr->insert( action( GAUSS_OVERWRITE_CONFIGURATION ), -1, -1, -1 ); mgr->setRule( action( GAUSS_OVERWRITE_CONFIGURATION ), - "selcount>0 and type='VISU::TGAUSSVIEW' and activeView='VVTK'" ); + "selcount>0 and type='VISU::TGAUSSVIEW' and activeView='SVTK'" ); createAction( GAUSS_RESTORE_CONFIGURATION, tr("MEN_RESTORE_CONFIGURATION"), QIcon(), tr("MEN_RESTORE_CONFIGURATION"), "", 0, this, false, @@ -392,29 +393,29 @@ bool VisuGUI_Module::deactivateModule( SUIT_Study* theStudy ) //--------------------------------------------------------------- -SUIT_ViewManager* VisuGUI_Module::onCreateViewManager() -{ - SalomeApp_Application* anApp = getApp(); - SUIT_ResourceMgr* aResourceMgr = anApp->resourceMgr(); - VVTK_ViewManager* aViewManager = new VVTK_ViewManager( anApp->activeStudy(), anApp->desktop() ); - VVTK_Viewer* aViewer = (VVTK_Viewer*)aViewManager->getViewModel(); - aViewer->setBackgroundColor( aResourceMgr->colorValue( "VTKViewer", "background", aViewer->backgroundColor() ) ); - aViewer->setProjectionMode( aResourceMgr->integerValue( "VTKViewer", "projection_mode", aViewer->projectionMode() ) ); - aViewer->setTrihedronSize( aResourceMgr->integerValue( "VTKViewer", "trihedron_size", aViewer->trihedronSize() ), - aResourceMgr->booleanValue( "VTKViewer", "relative_size", aViewer->trihedronRelative() ) ); - aViewer->setIncrementalSpeed( aResourceMgr->integerValue( "VTKViewer", "speed_value", aViewer->incrementalSpeed() ), - aResourceMgr->integerValue( "VTKViewer", "speed_mode", aViewer->incrementalSpeedMode() ) ); - aViewer->setInteractionStyle( aResourceMgr->integerValue( "VTKViewer", "navigation_mode", aViewer->interactionStyle() ) ); - aViewer->setSpacemouseButtons( aResourceMgr->integerValue( "VTKViewer", "spacemouse_func1_btn", aViewer->spacemouseBtn(1) ), - aResourceMgr->integerValue( "VTKViewer", "spacemouse_func2_btn", aViewer->spacemouseBtn(1) ), - aResourceMgr->integerValue( "VTKViewer", "spacemouse_func5_btn", aViewer->spacemouseBtn(1) ) ); - - new LightApp_VTKSelector( aViewer, anApp->selectionMgr() ); - - anApp->addViewManager( aViewManager ); - - return aViewer->getViewManager(); -} +// SUIT_ViewManager* VisuGUI_Module::onCreateViewManager() +// { +// SalomeApp_Application* anApp = getApp(); +// SUIT_ResourceMgr* aResourceMgr = anApp->resourceMgr(); +// VVTK_ViewManager* aViewManager = new VVTK_ViewManager( anApp->activeStudy(), anApp->desktop() ); +// VVTK_Viewer* aViewer = (VVTK_Viewer*)aViewManager->getViewModel(); +// aViewer->setBackgroundColor( aResourceMgr->colorValue( "VTKViewer", "background", aViewer->backgroundColor() ) ); +// aViewer->setProjectionMode( aResourceMgr->integerValue( "VTKViewer", "projection_mode", aViewer->projectionMode() ) ); +// aViewer->setTrihedronSize( aResourceMgr->integerValue( "VTKViewer", "trihedron_size", aViewer->trihedronSize() ), +// aResourceMgr->booleanValue( "VTKViewer", "relative_size", aViewer->trihedronRelative() ) ); +// aViewer->setIncrementalSpeed( aResourceMgr->integerValue( "VTKViewer", "speed_value", aViewer->incrementalSpeed() ), +// aResourceMgr->integerValue( "VTKViewer", "speed_mode", aViewer->incrementalSpeedMode() ) ); +// aViewer->setInteractionStyle( aResourceMgr->integerValue( "VTKViewer", "navigation_mode", aViewer->interactionStyle() ) ); +// aViewer->setSpacemouseButtons( aResourceMgr->integerValue( "VTKViewer", "spacemouse_func1_btn", aViewer->spacemouseBtn(1) ), +// aResourceMgr->integerValue( "VTKViewer", "spacemouse_func2_btn", aViewer->spacemouseBtn(1) ), +// aResourceMgr->integerValue( "VTKViewer", "spacemouse_func5_btn", aViewer->spacemouseBtn(1) ) ); + +// new LightApp_VTKSelector( aViewer, anApp->selectionMgr() ); + +// anApp->addViewManager( aViewManager ); + +// return aViewer->getViewManager(); +// } //--------------------------------------------------------------- @@ -956,18 +957,20 @@ void VisuGUI_Module::OnCreateGaussPoints() { double initialTime = vtkTimerLog::GetCPUTime(); //CreatePrs3d(this, VVTK_Viewer::Type()); - CreatePrs3d(this, SVTK_Viewer::Type()); + Prs3d_i* aPrs = CreatePrs3d(this, SVTK_Viewer::Type()); + if (aPrs) + emit presentationCreated(aPrs); INFOS( "VisuGUI_Module::OnCreateGaussPoints() : Gauss Points created in " << vtkTimerLog::GetCPUTime() - initialTime << " seconds" ); } -void VisuGUI_Module::OnViewManagerAdded(SUIT_ViewManager* viewMgr) -{ - QString type = viewMgr->getViewModel()->getType(); - if ( type == VVTK_Viewer::Type() ) - connect( viewMgr, SIGNAL( viewCreated( SUIT_ViewWindow* ) ), - this, SLOT( OnViewCreated( SUIT_ViewWindow* ) ) ); -} +// void VisuGUI_Module::OnViewManagerAdded(SUIT_ViewManager* viewMgr) +// { +// QString type = viewMgr->getViewModel()->getType(); +// if ( type == VVTK_Viewer::Type() ) +// connect( viewMgr, SIGNAL( viewCreated( SUIT_ViewWindow* ) ), +// this, SLOT( OnViewCreated( SUIT_ViewWindow* ) ) ); +// } void VisuGUI_Module::OnViewCreated(SUIT_ViewWindow* view) { @@ -1030,15 +1033,15 @@ void VisuGUI_Module::preferencesChanged( const QString& group, const QString& pr { VisuGUI::preferencesChanged(group,pref); - if ( group == "VISU" && ( pref == "speed_increment" || pref == "spacemouse_func1_btn" || - pref == "spacemouse_func2_btn" || pref == "spacemouse_func3_btn" || - pref == "spacemouse_func4_btn" || pref == "spacemouse_func5_btn" ) ) { +// if ( group == "VISU" && ( pref == "speed_increment" || pref == "spacemouse_func1_btn" || +// pref == "spacemouse_func2_btn" || pref == "spacemouse_func3_btn" || +// pref == "spacemouse_func4_btn" || pref == "spacemouse_func5_btn" ) ) { - // update properties of VVTK view windows - SUIT_ViewManager* vm = getApp()->getViewManager( VVTK_Viewer::Type(), false ); - if ( vm ) - setProperty( dynamic_cast( vm ), pref ); - } +// // update properties of VVTK view windows +// SUIT_ViewManager* vm = getApp()->getViewManager( VVTK_Viewer::Type(), false ); +// if ( vm ) +// setProperty( dynamic_cast( vm ), pref ); +// } } @@ -1049,8 +1052,8 @@ SUIT_ViewManager* VisuGUI_Module::getViewManager(const QString& theType, if (SUIT_ViewManager* aViewManager = VisuGUI::getViewManager(theType,theIsCreate)) return aViewManager; - if (theIsCreate && theType == VVTK_Viewer::Type()) - return onCreateViewManager(); +// if (theIsCreate && theType == VVTK_Viewer::Type()) +// return onCreateViewManager(); return NULL; } @@ -1065,11 +1068,11 @@ void VisuGUI_Module::OnEditGaussPoints() VISU::TSelectionItem aSelectionItem = aSelectionInfo.front(); Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO; - if(VISU::Prs3d_i* aPrs3d = VISU::GetPrs3dToModify(this, aSelectionItem.myObjectInfo.myBase)){ + if(/*VISU::Prs3d_i* aPrs3d = */VISU::GetPrs3dToModify(this, aSelectionItem.myObjectInfo.myBase)){ // Create VVTK_ViewWindow, if it does not exist - if (VVTK_ViewWindow* aViewWindow = GetViewWindow(this)) { - EditPrs3d(this, anIO, aPrs3d, aViewWindow); - } +// if (VVTK_ViewWindow* aViewWindow = GetViewWindow(this)) { +// EditPrs3d(this, anIO, aPrs3d, aViewWindow); +// } } } @@ -1077,7 +1080,7 @@ void VisuGUI_Module::OnEditGaussPoints() //--------------------------------------------------------------- namespace { - void GetViewParams(VVTK_MainWindow* theViewWindow, + /* void GetViewParams(VVTK_MainWindow* theViewWindow, const char* theSuffix, std::ostringstream& theStr) { @@ -1116,9 +1119,9 @@ namespace Storable::DataToStream(theStr,(std::string("myScaleFactor") + theSuffix + "[1]").c_str(),aScaleFactor[1]); Storable::DataToStream(theStr,(std::string("myScaleFactor") + theSuffix + "[2]").c_str(),aScaleFactor[2]); } - + */ //--------------------------------------------------------------- - void SetViewParams(VVTK_MainWindow* theViewWindow, + /* void SetViewParams(VVTK_MainWindow* theViewWindow, const char* theSuffix, const Storable::TRestoringMap& theMap) { @@ -1157,9 +1160,9 @@ namespace aScaleFactor[2] = Storable::FindValue(theMap,std::string("myScaleFactor") + theSuffix + "[2]").toDouble(); theViewWindow->SetScale(aScaleFactor); } - + */ //--------------------------------------------------------------- - void GetViewParams(VVTK_MainWindow1* theViewWindow, + /* void GetViewParams(VVTK_MainWindow1* theViewWindow, std::ostringstream& theStr) { GetViewParams(theViewWindow,"1",theStr); @@ -1202,17 +1205,17 @@ namespace Storable::DataToStream(theStr,"mySegmentationMode",aSegmentationMode.c_str()); } } - + */ //--------------------------------------------------------------- - void SetViewParams(VVTK_MainWindow1* theViewWindow, + /*void SetViewParams(VVTK_MainWindow1* theViewWindow, const Storable::TRestoringMap& theMap) { SetViewParams(theViewWindow,"1",theMap); } - + */ //--------------------------------------------------------------- - void GetViewParams(VVTK_MainWindow2* theViewWindow, + /*void GetViewParams(VVTK_MainWindow2* theViewWindow, std::ostringstream& theStr) { GetViewParams(theViewWindow,"2",theStr); @@ -1223,10 +1226,10 @@ namespace { SetViewParams(theViewWindow,"2",theMap); } - + */ //--------------------------------------------------------------- - std::string GetViewParams(VVTK_ViewWindow* theViewWindow) + /*std::string GetViewParams(VVTK_ViewWindow* theViewWindow) { std::ostringstream aStream; @@ -1241,7 +1244,7 @@ namespace return aStream.str(); } - + */ //--------------------------------------------------------------- struct TSelection { @@ -1275,7 +1278,7 @@ namespace } }; - void GetGaussPointsSelection(VVTK_ViewWindow* theViewWindow, + /*void GetGaussPointsSelection(SVTK_ViewWindow* theViewWindow, TVisibleEntries& theVisibleEntries) { // First find all visible Gauss Points presentations @@ -1305,7 +1308,7 @@ namespace } } } - + */ //--------------------------------------------------------------- inline void CreateReference(_PTR(Study) theStudyDocument, @@ -1331,8 +1334,8 @@ namespace //--------------------------------------------------------------- - void SetGaussPointsSelection(VisuGUI* theModule, - VVTK_ViewWindow* theViewWindow, + /*void SetGaussPointsSelection(VisuGUI* theModule, + SVTK_ViewWindow* theViewWindow, _PTR(Study) theCStudy, _PTR(SObject) theSObject) { @@ -1349,7 +1352,7 @@ namespace PortableServer::ServantBase_var aServant = VISU::GetServant(anObject); if(VISU::Prs3d_i* aPrs3d = dynamic_cast(aServant.in())){ // To set visiblity - VISU::UpdateViewer(theModule, aPrs3d, /*disp_only = */anIsFirst, /*highlight = */false); + VISU::UpdateViewer(theModule, aPrs3d, anIsFirst, false); anIsFirst = false; // To update selection @@ -1373,10 +1376,10 @@ namespace aSelector->EndPickCallback(); // To invoke selection changed signal } - + */ //--------------------------------------------------------------- - void OnStoreConfiguration(SalomeApp_Module* theModule, + /*void OnStoreConfiguration(SalomeApp_Module* theModule, bool theIsNew) { _PTR(Study) aCStudy = GetCStudy(GetAppStudy(theModule)); @@ -1386,7 +1389,7 @@ namespace LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(theModule); SUIT_ViewManager* aViewManager = theModule->getApp()->activeViewManager(); - if(aViewManager->getType() == VVTK_Viewer::Type()){ + if(aViewManager->getType() == VVTK_Viewer::Type()){ SUIT_ViewWindow* aWindow = aViewManager->getActiveView(); VVTK_ViewWindow* aViewWindow = dynamic_cast(aWindow); @@ -1460,12 +1463,12 @@ namespace //UpdateObjBrowser(theModule,true,aSObject); UpdateObjBrowser(theModule,true); } - } - } + } + }*/ //--------------------------------------------------------------- - template +/* template void SetMainWindowParams(VisuGUI* theModule, _PTR(SObject) theSObject, VVTK_ViewWindow* theViewWindow, @@ -1476,26 +1479,26 @@ namespace Storable::TRestoringMap aMap = Storable::GetStorableMap(theSObject); if(!aMap.empty()) SetViewParams(theMainWindow, aMap); - } + }*/ } //--------------------------------------------------------------- -void VisuGUI_Module::OnSaveConfiguration() -{ - ::OnStoreConfiguration(this,true); -} +// void VisuGUI_Module::OnSaveConfiguration() +// { +// ::OnStoreConfiguration(this,true); +// } //--------------------------------------------------------------- -void VisuGUI_Module::OnOverwriteConfiguration() -{ - ::OnStoreConfiguration(this,false); -} +// void VisuGUI_Module::OnOverwriteConfiguration() +// { +// ::OnStoreConfiguration(this,false); +// } //--------------------------------------------------------------- -void VisuGUI_Module::OnRestoreConfiguration() +/*void VisuGUI_Module::OnRestoreConfiguration() { LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this); @@ -1513,6 +1516,7 @@ void VisuGUI_Module::OnRestoreConfiguration() if(!aMap.empty()){ SUIT_ViewWindow* aWindow = aViewManager->getActiveView(); VVTK_ViewWindow* aViewWindow = dynamic_cast(aWindow); + SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView(); Selection_Mode aSelectionMode = Storable::FindValue(aMap,"mySelectionMode").toInt(); SVTK_Selector* aSelector = aViewWindow->GetSelector(); @@ -1581,33 +1585,33 @@ void VisuGUI_Module::OnRestoreConfiguration() SetGaussPointsSelection(this,aViewWindow,aCStudy,aSObject); } } -} +}*/ //--------------------------------------------------------------- bool VisuGUI_Module::eventFilter( QObject * theWatched, QEvent * theEvent ) { bool aRet = VisuGUI::eventFilter(theWatched,theEvent); - if(theEvent->type() == QEvent::Show){ - if(SUIT_ViewManager* aViewManager = getViewManager(VVTK_Viewer::Type(),false)){ - SUIT_ViewWindow* aWindow = aViewManager->getActiveView(); - VVTK_ViewWindow* aViewWindow = dynamic_cast(aWindow); - if(VVTK_MainWindow1* aMainWindow = aViewWindow->getMainWindow1()){ - SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor(); - if(theWatched == anInteractor){ - SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow); - anInteractor->removeEventFilter(this); - } - } - if(VVTK_MainWindow2* aMainWindow = aViewWindow->getMainWindow2()){ - SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor(); - if(theWatched == aMainWindow->GetInteractor()){ - SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow); - anInteractor->removeEventFilter(this); - } - } - } - } +// if(theEvent->type() == QEvent::Show){ +// if(SUIT_ViewManager* aViewManager = getViewManager(VVTK_Viewer::Type(),false)){ +// SUIT_ViewWindow* aWindow = aViewManager->getActiveView(); +// VVTK_ViewWindow* aViewWindow = dynamic_cast(aWindow); +// if(VVTK_MainWindow1* aMainWindow = aViewWindow->getMainWindow1()){ +// SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor(); +// if(theWatched == anInteractor){ +// SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow); +// anInteractor->removeEventFilter(this); +// } +// } +// if(VVTK_MainWindow2* aMainWindow = aViewWindow->getMainWindow2()){ +// SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor(); +// if(theWatched == aMainWindow->GetInteractor()){ +// SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow); +// anInteractor->removeEventFilter(this); +// } +// } +// } +// } return aRet; } @@ -1630,7 +1634,7 @@ void VisuGUI_Module::storeVisualParameters(int savePoint) _PTR(IParameters) ip = ClientFactory::getIParameters(ap); // viewers counters are used for storing view_numbers in IParameters - int svtkViewers( 0 ), vvtkViewers( 0 ), plotViewers( 0 ); + int svtkViewers( 0 ), /*vvtkViewers( 0 ),*/ plotViewers( 0 ); // componentName is used for encoding of entries when storing them in IParameters _PTR(SComponent) visuEng = ClientFindOrCreateVisuComponent( studyDS ); @@ -1642,7 +1646,7 @@ void VisuGUI_Module::storeVisualParameters(int savePoint) // saving VVTK viewer parameters. VVTK (Gauss Viewers) are NOT created by SalomeApp since // VVTK is declared in VISU, so here we store VVTK view window parameters. // VisuGUI_Module::restoreVisualParameters() creates VVTK_Views and restores its parameters. - ip->setProperty( "ActiveGaussViewer", "-1" ); + /* ip->setProperty( "ActiveGaussViewer", "-1" ); getApp()->viewManagers( VVTK_Viewer::Type(), lst ); for ( it = lst.begin(); it != lst.end(); it++ ) { if ( SUIT_ViewWindow* vwin = (*it)->getActiveView() ) { @@ -1659,7 +1663,7 @@ void VisuGUI_Module::storeVisualParameters(int savePoint) vvtkViewers++; } } - + */ // VISU module opens one SVTK viewer in activateModule(). This causes a bug in save-restore visual // parameters: it no SVTK view was saved, we need NOT any SVTK on restore. Here we store if any is open.. /* @@ -1671,17 +1675,17 @@ void VisuGUI_Module::storeVisualParameters(int savePoint) // main cycle to store parameters of displayed objects lst.clear(); getApp()->viewManagers( lst ); - vvtkViewers = svtkViewers = plotViewers = 0; + /*vvtkViewers = */svtkViewers = plotViewers = 0; for ( it = lst.begin(); it != lst.end(); it++ ) { SUIT_ViewManager* vman = *it; QString vType = vman->getType(); int* viewsCounter = vType == SVTK_Viewer::Type() ? &svtkViewers : - vType == VVTK_Viewer::Type() ? &vvtkViewers : + //vType == VVTK_Viewer::Type() ? &vvtkViewers : vType == SPlot2d_Viewer::Type() ? &plotViewers : 0; // saving VTK actors' properties - if ( vType == SVTK_Viewer::Type() || // processing SVTK and VVTK viewers in the same - vType == VVTK_Viewer::Type() ) { // way (VVTK_ViewWindow inherits SVTK_ViewWindow) + if ( vType == SVTK_Viewer::Type() /*|| // processing SVTK and VVTK viewers in the same + vType == VVTK_Viewer::Type()*/ ) { // way (VVTK_ViewWindow inherits SVTK_ViewWindow) QVector views = vman->getViews(); for ( int i = 0, iEnd = vman->getViewsCount(); i < iEnd; i++ ) { @@ -1769,7 +1773,7 @@ void VisuGUI_Module::storeVisualParameters(int savePoint) QList::Iterator itCurve; plotVF->getCurves( curves ); - Plot2d_Curve* curve; + //Plot2d_Curve* curve; for ( itCurve = curves.begin(); itCurve != curves.end(); itCurve++ ) { if ( SPlot2d_Curve* sCurve = dynamic_cast( *itCurve ) ) { if ( sCurve->hasIO() ) { @@ -1839,21 +1843,21 @@ void VisuGUI_Module::restoreVisualParameters(int savePoint) std::vector::iterator namesIt = paramNames.begin(); std::vector::iterator valuesIt = paramValues.begin(); - if ( *entIt == "GaussViewer" ) { - // parameter names are view window's captions, values - visual parameters. - for ( ; namesIt != paramNames.end(); ++namesIt, ++valuesIt ) { - SUIT_ViewManager* vman = onCreateViewManager(); - SUIT_ViewWindow* vwin = vman->getActiveView(); - vwin->setWindowTitle( (*namesIt).c_str() ); - - // wait untill the window is really shown. This step fixes MANY bugs.. - while ( !vwin->isVisible() ) - qApp->processEvents(); - - vwin->setVisualParameters( (*valuesIt).c_str() ); - } - continue; // skip to next entry - } +// if ( *entIt == "GaussViewer" ) { +// // parameter names are view window's captions, values - visual parameters. +// for ( ; namesIt != paramNames.end(); ++namesIt, ++valuesIt ) { +// SUIT_ViewManager* vman = onCreateViewManager(); +// SUIT_ViewWindow* vwin = vman->getActiveView(); +// vwin->setWindowTitle( (*namesIt).c_str() ); + +// // wait untill the window is really shown. This step fixes MANY bugs.. +// while ( !vwin->isVisible() ) +// qApp->processEvents(); + +// vwin->setVisualParameters( (*valuesIt).c_str() ); +// } +// continue; // skip to next entry +// } // entry is a normal entry - it should be "decoded" (setting base adress of component) QString entry( ip->decodeEntry( *entIt ).c_str() ); @@ -1875,8 +1879,8 @@ void VisuGUI_Module::restoreVisualParameters(int savePoint) // cout << " -- " << viewerType << ": entry = " << entry.latin1() << ", paramName = " << paramName << endl; - if ( viewerType == SVTK_Viewer::Type().toLatin1().data() || - viewerType == VVTK_Viewer::Type().toLatin1().data() ) { + if ( viewerType == SVTK_Viewer::Type().toLatin1().data() /*|| + viewerType == VVTK_Viewer::Type().toLatin1().data()*/ ) { // used as inner map key for locating the actor. QString viewerTypeIndex = QString( viewerType.c_str() ) + QString::number( viewIndex ); @@ -2002,8 +2006,8 @@ void VisuGUI_Module::restoreVisualParameters(int savePoint) SUIT_ViewModel* vmodel = (*it)->getViewModel(); if ( !vmodel ) continue; - if ( vmodel->getType() == SVTK_Viewer::Type() || // processing SVTK and VVTK viewers - vmodel->getType() == VVTK_Viewer::Type() ) { // in the same way + if ( vmodel->getType() == SVTK_Viewer::Type() /*|| // processing SVTK and VVTK viewers + vmodel->getType() == VVTK_Viewer::Type()*/ ) { // in the same way SVTK_ViewWindow* vtkView = (SVTK_ViewWindow*) (*it)->getActiveView(); vtkView->getRenderer()->ResetCameraClippingRange(); vtkView->Repaint(); @@ -2029,19 +2033,19 @@ void VisuGUI_Module::restoreVisualParameters(int savePoint) */ // if active Gauss Viewer is set ( != -1) then raise the gauss view window. - bool ok; - QString activeGaussViewerStr = ip->getProperty( "ActiveGaussViewer" ).c_str(); - int activeGaussViewer = activeGaussViewerStr.toInt( &ok ); - if ( ok && activeGaussViewer != -1 ) { - lst.clear(); - getApp()->viewManagers( VVTK_Viewer::Type(), lst ); - if ( activeGaussViewer >= 0 && activeGaussViewer < lst.count() ) { - SUIT_ViewWindow* activeView = lst.at( activeGaussViewer )->getActiveView(); - if ( activeView ) { - activeView->activateWindow(); - //activeView->setFocus(); - } - } - } +// bool ok; +// QString activeGaussViewerStr = ip->getProperty( "ActiveGaussViewer" ).c_str(); +// int activeGaussViewer = activeGaussViewerStr.toInt( &ok ); +// if ( ok && activeGaussViewer != -1 ) { +// lst.clear(); +// getApp()->viewManagers( VVTK_Viewer::Type(), lst ); +// if ( activeGaussViewer >= 0 && activeGaussViewer < lst.count() ) { +// SUIT_ViewWindow* activeView = lst.at( activeGaussViewer )->getActiveView(); +// if ( activeView ) { +// activeView->activateWindow(); +// //activeView->setFocus(); +// } +// } +// } } diff --git a/src/VISUGUI/VisuGUI_Module.h b/src/VISUGUI/VisuGUI_Module.h index 4ba8be2a..792d397b 100644 --- a/src/VISUGUI/VisuGUI_Module.h +++ b/src/VISUGUI/VisuGUI_Module.h @@ -123,8 +123,8 @@ protected: createRecorderPreferences(); protected slots: - SUIT_ViewManager* - onCreateViewManager(); + // SUIT_ViewManager* + // onCreateViewManager(); void OnCreateGaussPoints(); @@ -132,8 +132,8 @@ protected slots: void OnViewCreated(SUIT_ViewWindow*); - void - OnViewManagerAdded(SUIT_ViewManager*); + // void + //OnViewManagerAdded(SUIT_ViewManager*); //! Reimplemented method of the Gauss Points edition. virtual @@ -141,19 +141,19 @@ protected slots: OnEditGaussPoints(); //! Virtual method of saving configuration. - virtual - void - OnSaveConfiguration(); + // virtual + // void + // OnSaveConfiguration(); //! Virtual method of overwriting configuration. - virtual - void - OnOverwriteConfiguration(); + // virtual + // void + // OnOverwriteConfiguration(); //! Virtual method of restoring configuration. - virtual - void - OnRestoreConfiguration(); + // virtual + // void + // OnRestoreConfiguration(); protected: _PTR(SObject) myConfigSObject; diff --git a/src/VISUGUI/VisuGUI_Prs3dTools.h b/src/VISUGUI/VisuGUI_Prs3dTools.h index 43a362e7..a2299398 100644 --- a/src/VISUGUI/VisuGUI_Prs3dTools.h +++ b/src/VISUGUI/VisuGUI_Prs3dTools.h @@ -313,7 +313,7 @@ namespace VISU if (!CheckTimeStamp(theModule,aTimeStampSObj,anIO,aPublishInStudyMode)) return aPrs; - if(aPublishInStudyMode == VISU::ColoredPrs3d_i::EPublishIndependently){ + if(/*aPublishInStudyMode == */VISU::ColoredPrs3d_i::EPublishIndependently){ // CreatePrs3dInViewer // (theModule,aTimeStampSObj,aPublishInStudyMode); aPrs = CreatePrs3dInViewer @@ -321,22 +321,22 @@ namespace VISU return aPrs; }else{ if(theDesiredViewerType.isNull()){ - if (SUIT_ViewManager* aViewManager = theModule->getApp()->activeViewManager()) - if (aViewManager->getType() == VVTK_Viewer::Type()){ + if (/*SUIT_ViewManager* aViewManager = */theModule->getApp()->activeViewManager()) + /*if (aViewManager->getType() == VVTK_Viewer::Type()){ aPrs = CreatePrs3dInViewer (theModule,aTimeStampSObj,aPublishInStudyMode); return aPrs; - } + }*/ aPrs = CreatePrs3dInViewer (theModule,aTimeStampSObj,aPublishInStudyMode); }else{ - if(theDesiredViewerType == VVTK_Viewer::Type()) { + /*if(theDesiredViewerType == VVTK_Viewer::Type()) { aPrs = CreatePrs3dInViewer (theModule,aTimeStampSObj,aPublishInStudyMode); - } else { + } else {*/ aPrs = CreatePrs3dInViewer (theModule,aTimeStampSObj,aPublishInStudyMode); - } + //} } } return aPrs; diff --git a/src/VISUGUI/VisuGUI_Selection.cxx b/src/VISUGUI/VisuGUI_Selection.cxx index ce18a01e..e2ceec1f 100644 --- a/src/VISUGUI/VisuGUI_Selection.cxx +++ b/src/VISUGUI/VisuGUI_Selection.cxx @@ -336,8 +336,8 @@ struct TPopupDispatcher TPopupFunctor aFunctor; if(aType == SVTK_Viewer::Type()) return aFunctor.template Get(theModule, theEntry); - else if(aType == VVTK_Viewer::Type()) - return aFunctor.template Get(theModule, theEntry); + //else if(aType == VVTK_Viewer::Type()) + //return aFunctor.template Get(theModule, theEntry); } return QString(); } diff --git a/src/VISUGUI/VisuGUI_ViewTools.h b/src/VISUGUI/VisuGUI_ViewTools.h index 014ae5a5..52d6bb6f 100644 --- a/src/VISUGUI/VisuGUI_ViewTools.h +++ b/src/VISUGUI/VisuGUI_ViewTools.h @@ -41,8 +41,8 @@ #include "SalomeApp_Module.h" #include "SalomeApp_Application.h" -#include "VVTK_ViewModel.h" -#include "VVTK_ViewWindow.h" +//#include "VVTK_ViewModel.h" +//#include "VVTK_ViewWindow.h" #include "SVTK_Functor.h" #include "SVTK_ViewModel.h" @@ -64,7 +64,7 @@ #include #include -class VVTK_Viewer; +//class VVTK_Viewer; namespace VISU { diff --git a/src/VVTK/Makefile.am b/src/VVTK/Makefile.am index c09b3d46..cfa91ad8 100755 --- a/src/VVTK/Makefile.am +++ b/src/VVTK/Makefile.am @@ -29,46 +29,46 @@ lib_LTLIBRARIES= libVVTK.la # header files salomeinclude_HEADERS= \ VVTK.h \ - VVTK_ViewManager.h \ - VVTK_ViewModel.h \ - VVTK_InteractorStyle.h \ - VVTK_PickingDlg.h \ - VVTK_SegmentationCursorDlg.h \ +# VVTK_ViewManager.h \ +# VVTK_ViewModel.h \ +# VVTK_InteractorStyle.h \ +# VVTK_PickingDlg.h \ +# VVTK_SegmentationCursorDlg.h \ VVTK_PrimitiveBox.h \ - VVTK_SizeBox.h \ - VVTK_ViewWindow.h \ - VVTK_MainWindow.h \ - VVTK_ImageWriter.h \ - VVTK_ImageWriterMgr.h \ - VVTK_RecorderDlg.h \ - VVTK_Recorder.h + VVTK_SizeBox.h +# VVTK_ViewWindow.h \ +# VVTK_MainWindow.h \ +# VVTK_ImageWriter.h \ +# VVTK_ImageWriterMgr.h \ +# VVTK_RecorderDlg.h \ +# VVTK_Recorder.h dist_libVVTK_la_SOURCES= \ - VVTK_ViewManager.cxx \ - VVTK_ViewModel.cxx \ - VVTK_InteractorStyle.cxx \ - VVTK_PickingDlg.cxx \ - VVTK_SegmentationCursorDlg.cxx \ +# VVTK_ViewManager.cxx \ +# VVTK_ViewModel.cxx \ +# VVTK_InteractorStyle.cxx \ +# VVTK_PickingDlg.cxx \ +# VVTK_SegmentationCursorDlg.cxx \ VVTK_PrimitiveBox.cxx \ - VVTK_SizeBox.cxx \ - VVTK_ViewWindow.cxx \ - VVTK_Renderer.cxx \ - VVTK_MainWindow.cxx \ - VVTK_ImageWriter.cxx \ - VVTK_ImageWriterMgr.cxx \ - VVTK_RecorderDlg.cxx \ - VVTK_Recorder.cxx + VVTK_SizeBox.cxx +# VVTK_ViewWindow.cxx \ +# VVTK_Renderer.cxx \ +# VVTK_MainWindow.cxx \ +# VVTK_ImageWriter.cxx \ +# VVTK_ImageWriterMgr.cxx \ +# VVTK_RecorderDlg.cxx \ +# VVTK_Recorder.cxx MOC_FILES= \ - VVTK_ViewWindow_moc.cxx \ - VVTK_ViewModel_moc.cxx \ - VVTK_ViewManager_moc.cxx \ - VVTK_PickingDlg_moc.cxx \ - VVTK_SegmentationCursorDlg_moc.cxx \ - VVTK_RecorderDlg_moc.cxx \ +# VVTK_ViewWindow_moc.cxx \ +# VVTK_ViewModel_moc.cxx \ +# VVTK_ViewManager_moc.cxx \ +# VVTK_PickingDlg_moc.cxx \ +# VVTK_SegmentationCursorDlg_moc.cxx \ +# VVTK_RecorderDlg_moc.cxx \ VVTK_PrimitiveBox_moc.cxx \ - VVTK_SizeBox_moc.cxx \ - VVTK_MainWindow_moc.cxx + VVTK_SizeBox_moc.cxx +# VVTK_MainWindow_moc.cxx nodist_libVVTK_la_SOURCES=$(MOC_FILES) libVVTK_la_CPPFLAGS= \