From 5e4b5ac5ab254efff8d5b4a60ad1e612eec5ba56 Mon Sep 17 00:00:00 2001 From: apo Date: Mon, 27 Nov 2006 13:30:37 +0000 Subject: [PATCH] Fix a regressions with popups --- src/VISUGUI/VisuGUI.cxx | 485 +++++++++++------------- src/VISUGUI/VisuGUI_Tools.cxx | 12 +- src/VISUGUI/VisuGUI_Tools.h | 2 + src/VISUGUI/VisuGUI_TransparencyDlg.cxx | 8 +- 4 files changed, 243 insertions(+), 264 deletions(-) diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index d83027d6..0c61cec1 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -156,20 +156,22 @@ static int MYDEBUG = 0; // Class: VisuGUI ////////////////////////////////////////////////// -VisuGUI::VisuGUI(): +VisuGUI +::VisuGUI(): SalomeApp_Module( "VISU" ), myDisplayer( 0 ) { } -VisuGUI::~VisuGUI() +VisuGUI +::~VisuGUI() { } void -VisuGUI:: -OnImportFromFile() +VisuGUI +::OnImportFromFile() { if(MYDEBUG) MESSAGE("VisuGUI::OnImportFromFile()"); if ( CheckLock(GetCStudy(GetAppStudy(this)),GetDesktop(this)) ) @@ -237,8 +239,8 @@ OnImportFromFile() } void -VisuGUI:: -OnImportTableFromFile() +VisuGUI +::OnImportTableFromFile() { if(MYDEBUG) MESSAGE("VisuGUI::OnImportTableFromFile()"); if ( CheckLock(GetCStudy(GetAppStudy(this)),GetDesktop(this)) ) @@ -272,8 +274,8 @@ OnImportTableFromFile() } void -VisuGUI:: -OnExportTableToFile() +VisuGUI +::OnExportTableToFile() { if(MYDEBUG) MESSAGE("VisuGUI::OnExportTableToFile()"); @@ -375,8 +377,8 @@ OnExportTableToFile() } void -VisuGUI:: -OnImportMedField() +VisuGUI +::OnImportMedField() { _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this)); if (CheckLock(aCStudy,GetDesktop(this))) @@ -495,8 +497,8 @@ CreateCurves( SalomeApp_Module* theModule, } void -VisuGUI:: -OnCreateMesh() +VisuGUI +::OnCreateMesh() { _PTR(Study) aStudy = GetCStudy(GetAppStudy(this)); if (CheckLock(aStudy,GetDesktop(this))) @@ -516,8 +518,8 @@ OnCreateMesh() } void -VisuGUI:: -OnCreateManyMesh() +VisuGUI +::OnCreateManyMesh() { _PTR(Study) aStudy = GetCStudy(GetAppStudy(this)); if (CheckLock(aStudy,GetDesktop(this))) @@ -542,72 +544,72 @@ OnCreateManyMesh() } void -VisuGUI:: -OnCreateScalarMap() +VisuGUI +::OnCreateScalarMap() { CreatePrs3d(this); } void -VisuGUI:: -OnCreateDeformedShape() +VisuGUI +::OnCreateDeformedShape() { CreatePrs3d(this); } void -VisuGUI:: -OnCreateScalarMapOnDeformedShape() +VisuGUI +::OnCreateScalarMapOnDeformedShape() { CreatePrs3d(this); } void -VisuGUI:: -OnCreateVectors() +VisuGUI +::OnCreateVectors() { CreatePrs3d(this); } void -VisuGUI:: -OnCreateIsoSurfaces() +VisuGUI +::OnCreateIsoSurfaces() { CreatePrs3d(this); } void -VisuGUI:: -OnCreateCutPlanes() +VisuGUI +::OnCreateCutPlanes() { CreatePrs3d(this); } void -VisuGUI:: -OnCreateCutLines() +VisuGUI +::OnCreateCutLines() { CreatePrs3d(this); } void -VisuGUI:: -OnCreateStreamLines() +VisuGUI +::OnCreateStreamLines() { CreatePrs3d(this); } void -VisuGUI:: -OnCreatePlot3D() +VisuGUI +::OnCreatePlot3D() { CreatePrs3d(this); } void -VisuGUI:: -OnCreatePlot2dView() +VisuGUI +::OnCreatePlot2dView() { CheckLock(GetCStudy(GetAppStudy(this)),GetDesktop(this)); GetVisuGen( this )->CreateContainer(); @@ -615,8 +617,8 @@ OnCreatePlot2dView() } void -VisuGUI:: -OnDisplayPrs() +VisuGUI +::OnDisplayPrs() { if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs"); @@ -663,16 +665,16 @@ OnDisplayPrs() } void -VisuGUI:: -OnDisplayOnlyPrs() +VisuGUI +::OnDisplayOnlyPrs() { OnEraseAll(); OnDisplayPrs(); } void -VisuGUI:: -OnErasePrs() +VisuGUI +::OnErasePrs() { if(MYDEBUG) MESSAGE("OnErasePrs"); @@ -701,8 +703,8 @@ OnErasePrs() } void -VisuGUI:: -OnEraseAll() +VisuGUI +::OnEraseAll() { startOperation( myEraseAll ); if (SVTK_ViewWindow* vw = GetActiveViewWindow(this)) { @@ -726,8 +728,8 @@ OnEraseAll() void -VisuGUI:: -OnEditScalarMap() +VisuGUI +::OnEditScalarMap() { Handle(SALOME_InteractiveObject) anIO; if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO)) @@ -735,8 +737,8 @@ OnEditScalarMap() } void -VisuGUI:: -OnEditDeformedShape() +VisuGUI +::OnEditDeformedShape() { Handle(SALOME_InteractiveObject) anIO; if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO)) @@ -744,8 +746,8 @@ OnEditDeformedShape() } void -VisuGUI:: -OnEditScalarMapOnDeformedShape() +VisuGUI +::OnEditScalarMapOnDeformedShape() { Handle(SALOME_InteractiveObject) anIO; if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO)) @@ -753,8 +755,8 @@ OnEditScalarMapOnDeformedShape() } void -VisuGUI:: -OnEditCutPlanes() +VisuGUI +::OnEditCutPlanes() { Handle(SALOME_InteractiveObject) anIO; if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO)) @@ -762,8 +764,8 @@ OnEditCutPlanes() } void -VisuGUI:: -OnEditCutLines() +VisuGUI +::OnEditCutLines() { Handle(SALOME_InteractiveObject) anIO; if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO)) @@ -771,8 +773,8 @@ OnEditCutLines() } void -VisuGUI:: -OnEditIsoSurfaces() +VisuGUI +::OnEditIsoSurfaces() { Handle(SALOME_InteractiveObject) anIO; if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO)) @@ -780,8 +782,8 @@ OnEditIsoSurfaces() } void -VisuGUI:: -OnEditVectors() +VisuGUI +::OnEditVectors() { Handle(SALOME_InteractiveObject) anIO; if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO)) @@ -789,8 +791,8 @@ OnEditVectors() } void -VisuGUI:: -OnEditStreamLines() +VisuGUI +::OnEditStreamLines() { Handle(SALOME_InteractiveObject) anIO; if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO)) @@ -798,8 +800,8 @@ OnEditStreamLines() } void -VisuGUI:: -OnEditPlot3D() +VisuGUI +::OnEditPlot3D() { Handle(SALOME_InteractiveObject) anIO; if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, &anIO)) @@ -808,82 +810,77 @@ OnEditPlot3D() void -VisuGUI:: -OnMakeSurfaceframe() +VisuGUI +::OnMakeSurfaceframe() { ChangeRepresentation(this, VISU::SURFACEFRAME); } void -VisuGUI:: -OnMakeInsideframe() +VisuGUI +::OnMakeInsideframe() { ChangeRepresentation(this, VISU::INSIDEFRAME); } void -VisuGUI:: -OnMakeWireframe() +VisuGUI +::OnMakeWireframe() { ChangeRepresentation(this, VISU::WIREFRAME); } void -VisuGUI:: -OnMakeSurface() +VisuGUI +::OnMakeSurface() { ChangeRepresentation(this, VISU::SHADED); } void -VisuGUI:: -OnMakePoints() +VisuGUI +::OnMakePoints() { ChangeRepresentation(this, VISU::POINT); } void -VisuGUI:: -OnMakeShrink() +VisuGUI +::OnMakeShrink() { ChangeRepresentation(this, VISU::SHRINK); } void -VisuGUI:: -OnSetShadingOn() +VisuGUI +::OnSetShadingOn() { SetShading(this, true); } void -VisuGUI:: -OnSetShadingOff() +VisuGUI +::OnSetShadingOff() { SetShading(this, false); } void -VisuGUI:: -OnChangeColor() +VisuGUI +::OnChangeColor() { - Handle(SALOME_InteractiveObject) anIO; - CORBA::Object_var anObject = GetSelectedObj(this, &anIO); - if (CORBA::is_nil(anObject)) return; - PortableServer::ServantBase_var aServant = VISU::GetServant(anObject); - if (!aServant.in()) return; - - VISU::Prs3d_i* aPrs3d = dynamic_cast(aServant.in()); - if (!aPrs3d) return; - - SVTK_ViewWindow* vw = GetActiveViewWindow(this); - if (!vw) return; - - VISU_Actor* anActor = GetActor(aPrs3d, vw); - if (!anActor) return; - + SVTK_ViewWindow* aViewWindow = GetActiveViewWindow(this); + if(!aViewWindow) + return; + VISU::Prs3d_i* aPrs3d = GetPrsToModify(this); + if(!aPrs3d) + return; + VISU_Actor* anActor = VISU::FindActor(aViewWindow, aPrs3d); + if(!anActor) + return; VISU::Mesh_i* aMesh = dynamic_cast(aPrs3d); VISU::DeformedShape_i* aDeformedShape = dynamic_cast(aPrs3d); + SALOMEDS::Color anOldColor, aNewColor; int aRepresent = anActor->GetRepresentation(); if (aMesh) { @@ -936,81 +933,67 @@ OnChangeColor() } void -VisuGUI:: -OnChangeWireframeColor() +VisuGUI +::OnChangeWireframeColor() { - Handle(SALOME_InteractiveObject) anIO; - CORBA::Object_var anObject = GetSelectedObj(this, &anIO); - if (CORBA::is_nil(anObject)) return; - PortableServer::ServantBase_var aServant = VISU::GetServant(anObject); - if (!aServant.in()) return; - - VISU::Prs3d_i* aPrs3d = dynamic_cast(aServant.in()); - if (!aPrs3d) return; - - SVTK_ViewWindow* vw = GetActiveViewWindow(this); - if (!vw) return; - - VISU_Actor* anActor = GetActor(aPrs3d, vw); - if (!anActor) return; - - if (VISU::Mesh_i* aMesh = dynamic_cast(aPrs3d)) { - SALOMEDS::Color anOldColor = aMesh->GetLinkColor(), aNewColor; - QColor aColor (int(255*anOldColor.R), - int(255*anOldColor.G), - int(255*anOldColor.B)); - QColor aColorNew = QColorDialog::getColor(aColor, GetDesktop(this)); - if (aColorNew.isValid()) { - aNewColor.R = aColorNew.red()/255.; - aNewColor.G = aColorNew.green()/255.; - aNewColor.B = aColorNew.blue()/255.; - aMesh->SetLinkColor(aNewColor); - RecreateActor(this, aMesh); - } + SVTK_ViewWindow* aViewWindow = GetActiveViewWindow(this); + if(!aViewWindow) + return; + VISU::Prs3d_i* aPrs3d = GetPrsToModify(this); + if(!aPrs3d) + return; + VISU_Actor* anActor = VISU::FindActor(aViewWindow, aPrs3d); + if(!anActor) + return; + if(aPrs3d->GetType() != VISU::TMESH) + return; + VISU::Mesh_i* aMesh = dynamic_cast(aPrs3d); + if(!aMesh) + return; + SALOMEDS::Color anOldColor = aMesh->GetLinkColor(), aNewColor; + QColor aColor (int(255*anOldColor.R), + int(255*anOldColor.G), + int(255*anOldColor.B)); + QColor aColorNew = QColorDialog::getColor(aColor, GetDesktop(this)); + if (aColorNew.isValid()) { + aNewColor.R = aColorNew.red()/255.; + aNewColor.G = aColorNew.green()/255.; + aNewColor.B = aColorNew.blue()/255.; + aMesh->SetLinkColor(aNewColor); + RecreateActor(this, aMesh); } } void -VisuGUI:: -OnChangeOpacity() +VisuGUI +::OnChangeOpacity() { - Handle(SALOME_InteractiveObject) anIO; - CORBA::Object_var anObject = GetSelectedObj(this, &anIO); - if (CORBA::is_nil(anObject)) return; - PortableServer::ServantBase_var aServant = VISU::GetServant(anObject); - if (!aServant.in()) return; - - VISU::Prs3d_i* aPrsObject = dynamic_cast(aServant.in()); - if (!aPrsObject) return; - - SVTK_ViewWindow* vw = GetActiveViewWindow(this); - if (!vw) return; - - VISU_Actor* anActor = GetActor(aPrsObject, vw); - if (!anActor) return; - - VisuGUI_TransparencyDlg* aTransparencyDlg = new VisuGUI_TransparencyDlg( this ); - aTransparencyDlg->show(); + SVTK_ViewWindow* aViewWindow = GetActiveViewWindow(this); + if(!aViewWindow) + return; + VISU::Prs3d_i* aPrs3d = GetPrsToModify(this); + if(!aPrs3d) + return; + VISU_Actor* anActor = VISU::FindActor(aViewWindow, aPrs3d); + if(!anActor) + return; + VisuGUI_TransparencyDlg* aDialog = new VisuGUI_TransparencyDlg( this ); + aDialog->show(); } void -VisuGUI:: -OnChangeLines() +VisuGUI +::OnChangeLines() { - Handle(SALOME_InteractiveObject) anIO; - CORBA::Object_var anObject = GetSelectedObj(this, &anIO); - if (CORBA::is_nil(anObject)) return; - PortableServer::ServantBase_var aServant = VISU::GetServant(anObject); - if (!aServant.in()) return; - - VISU::Prs3d_i* aPrsObject = dynamic_cast(aServant.in()); - if (!aPrsObject) return; - - SVTK_ViewWindow* vw = GetActiveViewWindow(this); - if (!vw) return; - - VISU_Actor* anActor = GetActor(aPrsObject, vw); - if (!anActor) return; + SVTK_ViewWindow* aViewWindow = GetActiveViewWindow(this); + if(!aViewWindow) + return; + VISU::Prs3d_i* aPrs3d = GetPrsToModify(this); + if(!aPrs3d) + return; + VISU_Actor* anActor = VISU::FindActor(aViewWindow, aPrs3d); + if(!anActor) + return; VisuGUI_CursorDlg* CursorDlg = new VisuGUI_CursorDlg (GetDesktop(this), tr("DLG_LINEWIDTH_TITLE"), TRUE); @@ -1034,8 +1017,8 @@ OnChangeLines() } void -VisuGUI:: -OnShowTable() +VisuGUI +::OnShowTable() { Handle(SALOME_InteractiveObject) anIO; CORBA::Object_var anObject = GetSelectedObj( this, &anIO ); @@ -1069,8 +1052,8 @@ OnShowTable() } void -VisuGUI:: -OnCreateTable() +VisuGUI +::OnCreateTable() { Handle(SALOME_InteractiveObject) anIO; CORBA::Object_var anObject = GetSelectedObj( this, &anIO ); @@ -1084,8 +1067,8 @@ OnCreateTable() } void -VisuGUI:: -OnDeleteObjects() +VisuGUI +::OnDeleteObjects() { SalomeApp_Study* anAppStudy = GetAppStudy(this); _PTR(Study) aCStudy = GetCStudy(anAppStudy); @@ -1162,8 +1145,8 @@ OnDeleteObjects() } void -VisuGUI:: -OnPlotData() +VisuGUI +::OnPlotData() { Handle(SALOME_InteractiveObject) anIO; CORBA::Object_var anObject = GetSelectedObj( this, &anIO ); @@ -1318,8 +1301,8 @@ OnPlotData() } void -VisuGUI:: -OnCurveProperties() +VisuGUI +::OnCurveProperties() { LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this); SALOME_ListIO aListIO; @@ -1360,8 +1343,8 @@ OnCurveProperties() } void -VisuGUI:: -OnClearContainer() +VisuGUI +::OnClearContainer() { _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this)); if (CheckLock(aCStudy,GetDesktop(this))) @@ -1386,8 +1369,8 @@ OnClearContainer() } void -VisuGUI:: -OnEditContainer() +VisuGUI +::OnEditContainer() { Handle(SALOME_InteractiveObject) anIO; CORBA::Object_var anObject = GetSelectedObj(this, &anIO); @@ -1408,8 +1391,8 @@ OnEditContainer() } void -VisuGUI:: -OnSaveViewParams() +VisuGUI +::OnSaveViewParams() { _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this)); if (CheckLock(aCStudy,GetDesktop(this))) @@ -1435,8 +1418,8 @@ OnSaveViewParams() } void -VisuGUI:: -OnRestoreViewParams() +VisuGUI +::OnRestoreViewParams() { SUIT_ViewManager* aViewMgr = getApp()->activeViewManager(); if (aViewMgr->getType() != SVTK_Viewer::Type()) @@ -1457,8 +1440,8 @@ OnRestoreViewParams() } void -VisuGUI:: -OnRename() +VisuGUI +::OnRename() { _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this)); if (CheckLock(aCStudy,GetDesktop(this))) @@ -1549,35 +1532,30 @@ OnRename() } void -VisuGUI:: -OnClippingPlanes() +VisuGUI +::OnClippingPlanes() { new VisuGUI_ClippingDlg (this, "", false); } void -VisuGUI:: -OnSweep() +VisuGUI +::OnSweep() { - // GetSelectedPrs3d - Handle(SALOME_InteractiveObject) anIO; - CORBA::Object_var anObject = GetSelectedObj(this, &anIO); - if (CORBA::is_nil(anObject)) return; - PortableServer::ServantBase_var aServant = VISU::GetServant(anObject); - if (!aServant.in()) return; - - VISU::ScalarMap_i* aPrsObject = dynamic_cast(aServant.in()); - if (!aPrsObject) return; - - SVTK_ViewWindow* vw = GetActiveViewWindow(this); - if (!vw) return; - - VISU_Actor* aActor = GetActor(aPrsObject, vw); - if (!aActor) return; - - if (!aActor->GetVisibility()) { - aActor->VisibilityOn(); - } + SVTK_ViewWindow* aViewWindow = GetActiveViewWindow(this); + if(!aViewWindow) + return; + VISU::Prs3d_i* aPrs3d = GetPrsToModify(this); + if(!aPrs3d) + return; + VISU::ScalarMap_i* aScalarMap = dynamic_cast(aPrs3d); + if(!aScalarMap) + return; + VISU_Actor* anActor = VISU::FindActor(aViewWindow, aPrs3d); + if(!anActor) + return; + if(!anActor->GetVisibility()) + anActor->VisibilityOn(); // Get sweep parameters SUIT_ResourceMgr* aResourceMgr = GetResourceMgr(); @@ -1594,9 +1572,9 @@ OnSweep() for (int i = 0; i <= aSteps; i++) { try { float aPercents = float(i)/aSteps; - aPrsObject->SetMapScale(aPercents); - aPrsObject->UpdateActor(aActor); - vw->getRenderWindow()->Render(); + aScalarMap->SetMapScale(aPercents); + aScalarMap->UpdateActor(anActor); + aViewWindow->getRenderWindow()->Render(); usleep(aTemp); } catch (std::exception& exc) { INFOS("Follow exception was occured :\n" << exc.what()); @@ -1609,8 +1587,8 @@ OnSweep() } void -VisuGUI:: -OnTimeAnimation() +VisuGUI +::OnTimeAnimation() { if (!VISU::GetActiveViewWindow(this)) return; @@ -1648,8 +1626,8 @@ OnTimeAnimation() //************************************************************************ void -VisuGUI:: -OnShowAnimation() +VisuGUI +::OnShowAnimation() { if (!VISU::GetActiveViewWindow(this)) return; @@ -1704,8 +1682,8 @@ DoSameAs(VISU::Prs3d_i* thePrs3d) //---------------------------------------------------------------------------- void -VisuGUI:: -OnCopyPresentation() +VisuGUI +::OnCopyPresentation() { _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this)); if (CheckLock(aCStudy,GetDesktop(this))) @@ -1760,8 +1738,8 @@ OnCopyPresentation() } void -VisuGUI:: -OnSelectionInfo() +VisuGUI +::OnSelectionInfo() { if (GetActiveViewWindow(this)) (new VisuGUI_SelectionDlg(this))->show(); @@ -1773,8 +1751,8 @@ OnSelectionInfo() } void -VisuGUI:: -OnMergeScalarBars() +VisuGUI +::OnMergeScalarBars() { LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this); SALOME_ListIO aListIO; @@ -1834,8 +1812,8 @@ OnMergeScalarBars() } void -VisuGUI:: -OnFreeScalarBars() +VisuGUI +::OnFreeScalarBars() { LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this); SALOME_ListIO aListIO; @@ -1871,32 +1849,25 @@ OnFreeScalarBars() } void -VisuGUI:: -OnTranslatePrs() +VisuGUI +::OnTranslatePrs() { if(MYDEBUG) MESSAGE("VisuGUI::OnTranslatePrs"); VisuGUI_OffsetDlg* aDlg = new VisuGUI_OffsetDlg (this); - _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this)); - LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this); SALOME_ListIO aListIO; aSelectionMgr->selectedObjects(aListIO); - SALOME_ListIteratorOfListIO It (aListIO); - for (; It.More(); It.Next()) { - Handle(SALOME_InteractiveObject)& anIO = It.Value(); + SalomeApp_Study* aStudy = GetAppStudy(this); + SALOME_ListIteratorOfListIO anIter(aListIO); + for (; anIter.More(); anIter.Next()) { + Handle(SALOME_InteractiveObject) anIO = anIter.Value(); if (anIO->hasEntry()) { - _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry()); - if (aSObject) { - CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSObject); - if (!CORBA::is_nil(aCORBAObject)) { - PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject); - if (VISU::Prs3d_i* aPrsObject = dynamic_cast(aServant.in())) { - aDlg->addPresentation(aPrsObject); - } - } - } + QString anEntry(anIO->getEntry()); + CORBA::Object_var anObject = VISU::GetSelectedObj(aStudy, anEntry); + if(VISU::Prs3d_i* aPrsObject = VISU::GetPrsToModify(anObject)) + aDlg->addPresentation(aPrsObject); } } if (aDlg->getPrsCount() > 0) @@ -1906,8 +1877,8 @@ OnTranslatePrs() } void -VisuGUI:: -OnArrangeActors() +VisuGUI +::OnArrangeActors() { SVTK_ViewWindow* vw = GetActiveViewWindow(this); if (vw) { @@ -1919,8 +1890,8 @@ OnArrangeActors() void -VisuGUI:: -initialize( CAM_Application* theApp ) +VisuGUI +::initialize( CAM_Application* theApp ) { SalomeApp_Module::initialize( theApp ); @@ -1931,8 +1902,8 @@ initialize( CAM_Application* theApp ) } void -VisuGUI:: -createActions() +VisuGUI +::createActions() { QPixmap aPixmap; QWidget* aParent = application()->desktop(); @@ -2249,8 +2220,8 @@ createActions() } void -VisuGUI:: -createMenus() +VisuGUI +::createMenus() { // Add actions to menus int aMenuId; @@ -2287,8 +2258,8 @@ createMenus() } void -VisuGUI:: -createToolBars() +VisuGUI +::createToolBars() { int aToolId = createTool( tr("TOOL_IMPORT") ); createTool( VISU_IMPORT_FROM_FILE, aToolId ); @@ -2314,8 +2285,8 @@ createToolBars() } void -VisuGUI:: -createPopupMenus() +VisuGUI +::createPopupMenus() { // Prepare popup menus QtxPopupMgr* mgr = popupMgr(); @@ -2764,8 +2735,8 @@ void VisuGUI::contextMenuPopup( const QString& theClient, QPopupMenu* theMenu, Q //*************************************************************************** void -VisuGUI:: -windows( QMap& theMap ) const +VisuGUI +::windows( QMap& theMap ) const { theMap.clear(); theMap.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::DockLeft ); @@ -2774,8 +2745,8 @@ windows( QMap& theMap ) const void -VisuGUI:: -viewManagers( QStringList& theList ) const +VisuGUI +::viewManagers( QStringList& theList ) const { theList.clear(); // append SVTK viewer only if there is no opened VVTK @@ -2788,8 +2759,8 @@ viewManagers( QStringList& theList ) const QString -VisuGUI:: -engineIOR() const +VisuGUI +::engineIOR() const { CORBA::String_var anIOR = GetVisuGen(this)->GetID(); return QString(anIOR.in()); @@ -2797,8 +2768,8 @@ engineIOR() const bool -VisuGUI:: -activateModule( SUIT_Study* theStudy ) +VisuGUI +::activateModule( SUIT_Study* theStudy ) { SalomeApp_Module::activateModule( theStudy ); studyActivated(); @@ -2813,8 +2784,8 @@ activateModule( SUIT_Study* theStudy ) bool -VisuGUI:: -deactivateModule( SUIT_Study* theStudy ) +VisuGUI +::deactivateModule( SUIT_Study* theStudy ) { setMenuShown( false ); setToolShown( false ); @@ -2827,8 +2798,8 @@ deactivateModule( SUIT_Study* theStudy ) } LightApp_Selection* -VisuGUI:: -createSelection() const +VisuGUI +::createSelection() const { return new VisuGUI_Selection( (SalomeApp_Module*)this ); } diff --git a/src/VISUGUI/VisuGUI_Tools.cxx b/src/VISUGUI/VisuGUI_Tools.cxx index f4da70ae..50ad7cfa 100644 --- a/src/VISUGUI/VisuGUI_Tools.cxx +++ b/src/VISUGUI/VisuGUI_Tools.cxx @@ -323,10 +323,16 @@ namespace VISU if (CheckLock(GetCStudy(GetAppStudy(theModule)),GetDesktop(theModule))) return NULL; - CORBA::Object_var anObject = GetSelectedObj(theModule, theIO); - if(VISU::Base_i* aBase = GetServantInterface(anObject)){ + return GetPrsToModify(GetSelectedObj(theModule, theIO)); + } + + //------------------------------------------------------------ + VISU::Prs3d_i* + GetPrsToModify(CORBA::Object_var theObject) + { + if(VISU::Base_i* aBase = GetServantInterface(theObject)){ if(aBase->GetType() == VISU::TCOLOREDPRS3DHOLDER){ - VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(anObject); + VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(theObject); VISU::ColoredPrs3d_var aColoredPrs3d = aHolder->GetDevice(); aBase = dynamic_cast(GetServant(aColoredPrs3d).in()); } diff --git a/src/VISUGUI/VisuGUI_Tools.h b/src/VISUGUI/VisuGUI_Tools.h index 41647fcb..d05afd28 100644 --- a/src/VISUGUI/VisuGUI_Tools.h +++ b/src/VISUGUI/VisuGUI_Tools.h @@ -95,6 +95,8 @@ namespace VISU Handle(SALOME_InteractiveObject)* theIO = NULL, VISU::Storable::TRestoringMap* theMap = NULL); + VISU::Prs3d_i* GetPrsToModify(CORBA::Object_var theObject); + VISU::Prs3d_i* GetPrsToModify(const SalomeApp_Module* theModule, Handle(SALOME_InteractiveObject)* theIO = NULL, VISU::Storable::TRestoringMap* theMap = NULL); diff --git a/src/VISUGUI/VisuGUI_TransparencyDlg.cxx b/src/VISUGUI/VisuGUI_TransparencyDlg.cxx index 2739cf7a..e8114766 100644 --- a/src/VISUGUI/VisuGUI_TransparencyDlg.cxx +++ b/src/VISUGUI/VisuGUI_TransparencyDlg.cxx @@ -207,10 +207,10 @@ void VisuGUI_TransparencyDlg::SetTransparency() SALOME_ListIO aList; mySelectionMgr->selectedObjects(aList); - SALOME_ListIteratorOfListIO It (aList); - for (;It.More(); It.Next()) { - Handle(SALOME_InteractiveObject) IOS = It.Value(); - VISU_Actor* anActor = VISU::FindActor(myViewWindow, IOS->getEntry()); + SALOME_ListIteratorOfListIO anIter(aList); + for (; anIter.More(); anIter.Next()) { + Handle(SALOME_InteractiveObject) anIO = anIter.Value(); + VISU_Actor* anActor = VISU::FindActor(myViewWindow, anIO->getEntry()); if (anActor) anActor->SetOpacity(opacity); } -- 2.39.2