From c1745184cb4eb0e72088753b40a23902200aa62a Mon Sep 17 00:00:00 2001 From: asl Date: Wed, 5 Oct 2005 06:28:23 +0000 Subject: [PATCH] All modules must use SVTK package instead VTK --- src/DisplayGUI/DisplayGUI.cxx | 31 ++++++++------ src/EntityGUI/EntityGUI.cxx | 7 ++-- src/GEOMBase/GEOMBase.cxx | 12 +++--- src/GEOMBase/GEOMBase_Helper.cxx | 6 +-- src/GEOMGUI/GEOMGUI_Selection.cxx | 10 ++--- src/GEOMGUI/GeometryGUI.cxx | 40 +++++++++---------- src/GEOMGUI/GeometryGUI_Swig.cxx | 6 +-- src/GEOMToolsGUI/GEOMToolsGUI_1.cxx | 12 +++--- .../GEOMToolsGUI_TransparencyDlg.cxx | 10 ++--- src/OperationGUI/OperationGUI_ClippingDlg.cxx | 22 ++++++---- 10 files changed, 84 insertions(+), 72 deletions(-) diff --git a/src/DisplayGUI/DisplayGUI.cxx b/src/DisplayGUI/DisplayGUI.cxx index c8775f096..4f7f9485f 100644 --- a/src/DisplayGUI/DisplayGUI.cxx +++ b/src/DisplayGUI/DisplayGUI.cxx @@ -35,8 +35,6 @@ #include #include -#include -#include #include #include #include @@ -201,7 +199,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(); } } @@ -340,9 +338,11 @@ 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() ) { - VTKViewer_RenderWindowInteractor* myRenderInter= ((VTKViewer_ViewWindow*)viewWindow)->getRWInteractor(); - myRenderInter->SetDisplayMode( mode ); + if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) { + SVTK_ViewWindow* wnd = dynamic_cast( viewWindow ); + SVTK_RenderWindowInteractor* myRenderInter = wnd ? wnd->getRWInteractor() : 0; + if( myRenderInter ) + myRenderInter->SetDisplayMode( mode ); } else if ( viewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() ) { OCCViewer_Viewer* v3d = ((OCCViewer_ViewManager*)(viewWindow->getViewManager()))->getOCCViewer(); @@ -376,9 +376,11 @@ 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() ) { - VTKViewer_RenderWindowInteractor* myRenderInter= ((VTKViewer_ViewWindow*)viewWindow)->getRWInteractor(); - dispMode = myRenderInter->GetDisplayMode(); + if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) { + SVTK_ViewWindow* wnd = dynamic_cast( viewWindow ); + SVTK_RenderWindowInteractor* myRenderInter = wnd ? wnd->getRWInteractor() : 0; + if( myRenderInter ) + dispMode = myRenderInter->GetDisplayMode(); } else if ( viewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() ) { OCCViewer_Viewer* v3d = ((OCCViewer_ViewManager*)(viewWindow->getViewManager()))->getOCCViewer(); @@ -419,16 +421,19 @@ void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow SALOME_ListIO aList; - if ( viewWindow->getViewManager()->getType() == VTKViewer_Viewer::Type() ) { + if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) { SVTK_ViewWindow* vw = dynamic_cast( viewWindow ); - SVTK_RenderWindowInteractor* rwi = vw->getRWInteractor(); + SVTK_RenderWindowInteractor* rwi = vw ? vw->getRWInteractor() : 0; + + if( !rwi ) + return; aSelMgr->selectedObjects( aList ); 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 ) rwi->ChangeRepresentationToWireframe( vtkPrs->GetObjects() ); diff --git a/src/EntityGUI/EntityGUI.cxx b/src/EntityGUI/EntityGUI.cxx index c1af4be77..82fa8a094 100644 --- a/src/EntityGUI/EntityGUI.cxx +++ b/src/EntityGUI/EntityGUI.cxx @@ -35,7 +35,7 @@ #include "SUIT_ViewWindow.h" #include "OCCViewer_ViewModel.h" #include "OCCViewer_ViewManager.h" -#include "VTKViewer_ViewModel.h" +//#include "SVTK_ViewModel.h" #include "SalomeApp_Study.h" #include "SalomeApp_Tools.h" //#include "SALOMEGUI_ImportOperation.h" @@ -399,10 +399,11 @@ bool EntityGUI::OnSubShapeGetAll(const TopoDS_Shape& ShapeTopo, const char* Shap } else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) { - VTKViewer_RenderWindowInteractor* myRenderInter= ((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor(); + SVTK_ViewFrame* vf = dynamic_cast( QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame() ); + SVTK_RenderWindowInteractor* myRenderInter= vf ? vf->getRWInteractor() : 0; int themode = myRenderInter->GetDisplayMode(); - vtkRenderer *theRenderer = ((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRenderer(); + vtkRenderer *theRenderer = vf->getRenderer(); vtkRenderWindow *renWin = theRenderer->GetRenderWindow(); Handle(GEOM_InteractiveObject) IO = new GEOM_InteractiveObject(aResult->Name(), myGeomGUI->GetFatherior(), "GEOM"); diff --git a/src/GEOMBase/GEOMBase.cxx b/src/GEOMBase/GEOMBase.cxx index 194a81c96..049432031 100644 --- a/src/GEOMBase/GEOMBase.cxx +++ b/src/GEOMBase/GEOMBase.cxx @@ -40,9 +40,9 @@ #include "GEOM_AssemblyBuilder.h" #include "GEOM_Actor.h" -#include "VTKViewer_RenderWindowInteractor.h" -#include "VTKViewer_ViewModel.h" -#include "VTKViewer_ViewWindow.h" +#include "SVTK_RenderWindowInteractor.h" +#include "SVTK_ViewModel.h" +#include "SVTK_ViewWindow.h" #include "OCCViewer_ViewPort3d.h" #include "OCCViewer_ViewModel.h" #include "OCCViewer_ViewWindow.h" @@ -402,8 +402,10 @@ GEOM_Actor* GEOMBase::ConvertIORinGEOMActor(const char* IOR, Standard_Boolean& t QPtrList aViewWindowsList = SUIT_Session::session()->activeApplication()->desktop()->windows(); for ( QPtrListIterator it( aViewWindowsList ); it.current(); ++it ) { - if (it.current()->getViewManager()->getType() == VTKViewer_Viewer::Type()) { - VTKViewer_ViewWindow* aVTKViewWindow = (VTKViewer_ViewWindow*)it.current(); + if (it.current()->getViewManager()->getType() == SVTK_Viewer::Type()) { + SVTK_ViewWindow* aVTKViewWindow = dynamic_cast( it.current() ); + if( !aVTKViewWindow ) + continue; vtkRenderer* Renderer = aVTKViewWindow->getRenderer(); vtkActorCollection* theActors = Renderer->GetActors(); theActors->InitTraversal(); diff --git a/src/GEOMBase/GEOMBase_Helper.cxx b/src/GEOMBase/GEOMBase_Helper.cxx index 7c2707cab..c2e7114d3 100755 --- a/src/GEOMBase/GEOMBase_Helper.cxx +++ b/src/GEOMBase/GEOMBase_Helper.cxx @@ -49,7 +49,7 @@ #include #include -#include +#include #include @@ -337,7 +337,7 @@ void GEOMBase_Helper::displayPreview( const SALOME_Prs* prs, // Display prs SUIT_ViewManager* aViewManager = myViewWindow->getViewManager(); if ( aViewManager->getType() == OCCViewer_Viewer::Type() || - aViewManager->getType() == VTKViewer_Viewer::Type() ) + aViewManager->getType() == SVTK_Viewer::Type() ) { SUIT_ViewModel* aViewModel = aViewManager->getViewModel(); SALOME_View* aView = dynamic_cast(aViewModel); @@ -367,7 +367,7 @@ void GEOMBase_Helper::erasePreview( const bool update ) { SUIT_ViewManager* aViewManager = myViewWindow->getViewManager(); if ( aViewManager->getType() == OCCViewer_Viewer::Type() || - aViewManager->getType() == VTKViewer_Viewer::Type() ) + aViewManager->getType() == SVTK_Viewer::Type() ) { SUIT_ViewModel* aViewModel = aViewManager->getViewModel(); SALOME_View* aView = dynamic_cast(aViewModel); diff --git a/src/GEOMGUI/GEOMGUI_Selection.cxx b/src/GEOMGUI/GEOMGUI_Selection.cxx index 234f1c6a4..bc44c2b0b 100644 --- a/src/GEOMGUI/GEOMGUI_Selection.cxx +++ b/src/GEOMGUI/GEOMGUI_Selection.cxx @@ -24,7 +24,7 @@ #include #include -#include +#include #include "GEOMImpl_Types.hxx" @@ -94,7 +94,7 @@ QString GEOMGUI_Selection::displayMode( const int index ) const { SALOME_View* view = GEOM_Displayer::GetActiveView(); QString viewType = activeViewType(); - if ( view /*fix for 9320==>*/&& ( viewType == OCCViewer_Viewer::Type() || viewType == VTKViewer_Viewer::Type() ) ) { + if ( view /*fix for 9320==>*/&& ( viewType == OCCViewer_Viewer::Type() || viewType == SVTK_Viewer::Type() ) ) { SALOME_Prs* prs = view->CreatePrs( entry( index ) ); if ( prs ) { if ( viewType == OCCViewer_Viewer::Type() ) { // assuming OCC @@ -122,9 +122,9 @@ QString GEOMGUI_Selection::displayMode( const int index ) const } } } - else if ( viewType == VTKViewer_Viewer::Type() ) { // assuming VTK - SVTK_Prs* vtkPrs = (SVTK_Prs*) prs; - vtkActorCollection* lst = vtkPrs->GetObjects(); + else if ( viewType == SVTK_Viewer::Type() ) { // assuming VTK + SVTK_Prs* vtkPrs = dynamic_cast( prs ); + vtkActorCollection* lst = vtkPrs ? vtkPrs->GetObjects() : 0; if ( lst ) { lst->InitTraversal(); vtkActor* actor = lst->GetNextActor(); diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index 221972bde..759e40e15 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -41,11 +41,11 @@ #include #include -#include +#include #include #include #include -#include +#include #include #include @@ -250,7 +250,7 @@ void GeometryGUI::ActiveWorkingPlane() SUIT_ViewWindow* window = application()->desktop()->activeWindow(); bool ViewOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() ); - bool ViewVTK = ( window && window->getViewManager()->getType() == VTKViewer_Viewer::Type() ); + bool ViewVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() ); if( ViewOCC ) { OCCViewer_ViewWindow* vw = dynamic_cast( window ); @@ -264,7 +264,7 @@ void GeometryGUI::ActiveWorkingPlane() } } else if( ViewVTK ) { - VTKViewer_ViewWindow* vw = dynamic_cast( window ); + SVTK_ViewWindow* vw = dynamic_cast( window ); if ( vw ) { vtkCamera* camera = vw->getRenderer()->GetActiveCamera(); @@ -339,7 +339,7 @@ void GeometryGUI::OnGUIEvent( int id ) // check type of the active viewframe SUIT_ViewWindow* window = desk->activeWindow(); bool ViewOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() ); - bool ViewVTK = ( window && window->getViewManager()->getType() == VTKViewer_Viewer::Type() ); + bool ViewVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() ); // if current viewframe is not of OCC and not of VTK type - return immediately // fix for IPAL8958 - allow some commands to execute even when NO viewer is active (rename for example) bool NotViewerDependentCommand = ( id == 901 || id == 216 || id == 213 ); @@ -597,9 +597,9 @@ static void UpdateVtkSelection() SUIT_ViewWindow* win = 0; for ( win = winList.first(); win; win = winList.next() ) { if ( win->getViewManager()->getTypeView() == VIEW_VTK ) { - VTKViewer_ViewWindow* vw = dynamic_cast( window ); + SVTK_ViewWindow* vw = dynamic_cast( window ); if ( vw ) { - VTKViewer_RenderWindowInteractor* anInteractor = vw->getRWInteractor(); + SVTK_RenderWindowInteractor* anInteractor = vw->getRWInteractor(); anInteractor->SetSelectionProp(); anInteractor->SetSelectionTolerance(); SVTK_InteractorStyleSALOME* aStyle = anInteractor->GetInteractorStyleSALOME(); @@ -633,9 +633,9 @@ bool GeometryGUI::SetSettings() } } else if ( ViewVTK ) { - VTKViewer_ViewWindow* vw = dynamic_cast( window ); + SVTK_ViewWindow* vw = dynamic_cast( window ); if ( vw ) { - VTKViewer_RenderWindowInteractor* myRenderInter = vw->getRWInteractor(); + SVTK_RenderWindowInteractor* myRenderInter = vw->getRWInteractor(); DisplayMode = myRenderInter->GetDisplayMode(); } } @@ -1111,9 +1111,9 @@ bool GeometryGUI::activateModule( SUIT_Study* study ) application()->viewManagers( OCCViewer_Viewer::Type(), OCCViewManagers ); for ( vm = OCCViewManagers.first(); vm; vm = OCCViewManagers.next() ) myOCCSelectors.append( new GEOMGUI_OCCSelector( ((OCCViewer_ViewManager*)vm)->getOCCViewer(), sm ) ); - application()->viewManagers( VTKViewer_Viewer::Type(), VTKViewManagers ); + application()->viewManagers( SVTK_Viewer::Type(), VTKViewManagers ); for ( vm = VTKViewManagers.first(); vm; vm = VTKViewManagers.next() ) - myVTKSelectors.append( new SalomeApp_VTKSelector( (SVTK_Viewer*)vm->getViewModel(), sm ) ); + myVTKSelectors.append( new SalomeApp_VTKSelector( dynamic_cast( vm->getViewModel() ), sm ) ); // disable OCC selectors getApp()->selectionMgr()->setEnabled( false, OCCViewer_Viewer::Type() ); @@ -1121,7 +1121,7 @@ bool GeometryGUI::activateModule( SUIT_Study* study ) sr->setEnabled(true); // disable VTK selectors - getApp()->selectionMgr()->setEnabled( false, VTKViewer_Viewer::Type() ); + getApp()->selectionMgr()->setEnabled( false, SVTK_Viewer::Type() ); for ( SalomeApp_VTKSelector* sr = myVTKSelectors.first(); sr; sr = myVTKSelectors.next() ) sr->setEnabled(true); @@ -1153,7 +1153,7 @@ bool GeometryGUI::deactivateModule( SUIT_Study* study ) getApp()->selectionMgr()->setEnabled( true, OCCViewer_Viewer::Type() ); myVTKSelectors.clear(); - getApp()->selectionMgr()->setEnabled( true, VTKViewer_Viewer::Type() ); + getApp()->selectionMgr()->setEnabled( true, SVTK_Viewer::Type() ); return SalomeApp_Module::deactivateModule( study ); } @@ -1228,7 +1228,7 @@ bool GeometryGUI::CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QStr if ( aViewFrame->getTypeView() == VIEW_OCC ) aDisplayMode = ((OCCViewer_ViewFrame*)aViewFrame)->getViewer()->getAISContext()->DisplayMode(); else if ( aViewFrame->getTypeView() == VIEW_VTK ) - aDisplayMode = ((VTKViewer_ViewFrame*)aViewFrame)->getRWInteractor()->GetDisplayMode(); + aDisplayMode = (dynamic_cast( aViewFrame )->getRWInteractor()->GetDisplayMode(); int nbSel = Sel->IObjectCount(); @@ -1312,7 +1312,7 @@ bool GeometryGUI::CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QStr else { ////// VTK viewer only popup->removeItem( 8034 ); // "Isos" - VTKViewer_Prs* vtkPrs = dynamic_cast( prs ); + SVTK_Prs* vtkPrs = dynamic_cast( prs ); if ( vtkPrs && !vtkPrs->IsNull() ) { vtkActorCollection* actorList = vtkPrs->GetObjects(); actorList->InitTraversal(); @@ -1479,7 +1479,7 @@ void GeometryGUI::onWindowActivated( SUIT_ViewWindow* win ) return; const bool ViewOCC = ( win->getViewManager()->getType() == OCCViewer_Viewer::Type() ); -// const bool ViewVTK = ( win->getViewManager()->getType() == VTKViewer_Viewer::Type() ); +// const bool ViewVTK = ( win->getViewManager()->getType() == SVTK_Viewer::Type() ); // disable non-OCC viewframe menu commands // action( 404 )->setEnabled( ViewOCC ); // SKETCHER @@ -1520,13 +1520,13 @@ void GeometryGUI::onViewManagerAdded( SUIT_ViewManager* vm ) for ( GEOMGUI_OCCSelector* sr = myOCCSelectors.first(); sr; sr = myOCCSelectors.next() ) sr->setEnabled(true); } - else if ( vm->getType() == VTKViewer_Viewer::Type() ) + else if ( vm->getType() == SVTK_Viewer::Type() ) { SalomeApp_SelectionMgr* sm = getApp()->selectionMgr(); - myVTKSelectors.append( new SalomeApp_VTKSelector( (SVTK_Viewer*)vm->getViewModel(), sm ) ); + myVTKSelectors.append( new SalomeApp_VTKSelector( dynamic_cast( vm->getViewModel() ), sm ) ); // disable VTK selectors - getApp()->selectionMgr()->setEnabled( false, VTKViewer_Viewer::Type() ); + getApp()->selectionMgr()->setEnabled( false, SVTK_Viewer::Type() ); for ( SalomeApp_VTKSelector* sr = myVTKSelectors.first(); sr; sr = myVTKSelectors.next() ) sr->setEnabled(true); } @@ -1544,7 +1544,7 @@ void GeometryGUI::onViewManagerRemoved( SUIT_ViewManager* vm ) break; } } - if ( vm->getType() == VTKViewer_Viewer::Type() ) + if ( vm->getType() == SVTK_Viewer::Type() ) { for ( SalomeApp_VTKSelector* sr = myVTKSelectors.first(); sr; sr = myVTKSelectors.next() ) if ( sr->viewer() == viewer ) diff --git a/src/GEOMGUI/GeometryGUI_Swig.cxx b/src/GEOMGUI/GeometryGUI_Swig.cxx index fe9ff55a4..f5f82f8f2 100644 --- a/src/GEOMGUI/GeometryGUI_Swig.cxx +++ b/src/GEOMGUI/GeometryGUI_Swig.cxx @@ -42,9 +42,7 @@ #include #include -#include -#include -#include +#include #include #include @@ -98,7 +96,7 @@ inline OCCViewer_Viewer* GetOCCViewer(SUIT_Application* theApp){ inline SVTK_ViewWindow* GetSVTKViewWindow(SUIT_Application* theApp){ SUIT_ViewWindow* window = theApp->desktop()->activeWindow(); - if(window && window->getViewManager()->getType() == VTKViewer_Viewer::Type()) + if(window && window->getViewManager()->getType() == SVTK_Viewer::Type()) return dynamic_cast( window ); return 0; diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx index ed15e2ad0..8c2d26030 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx @@ -41,13 +41,13 @@ #include #include -#include -#include -#include - +#include #include #include +#include +#include + #include #include #include @@ -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 ); @@ -231,7 +231,7 @@ void GEOMToolsGUI::OnColor() 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 1610f9149..eb642a433 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx @@ -33,13 +33,13 @@ #include #include -#include -#include -#include - +#include #include #include +#include +#include + #include #include #include @@ -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 ); diff --git a/src/OperationGUI/OperationGUI_ClippingDlg.cxx b/src/OperationGUI/OperationGUI_ClippingDlg.cxx index bdda9f768..191eb88c2 100644 --- a/src/OperationGUI/OperationGUI_ClippingDlg.cxx +++ b/src/OperationGUI/OperationGUI_ClippingDlg.cxx @@ -31,8 +31,8 @@ #include "SUIT_Session.h" #include "SUIT_ViewWindow.h" -#include "VTKViewer_ViewWindow.h" -#include "VTKViewer_ViewModel.h" +#include "SVTK_ViewWindow.h" +#include "SVTK_ViewModel.h" #include "OCCViewer_ViewWindow.h" #include "OCCViewer_ViewPort3d.h" @@ -145,9 +145,11 @@ void OperationGUI_ClippingDlg::Init() if (!anActiveWindow) return; - if ( anActiveWindow->getViewManager()->getType() == VTKViewer_Viewer::Type() ) + if ( anActiveWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) { - VTKViewer_ViewWindow* aVTKFrame = dynamic_cast( anActiveWindow ); + SVTK_ViewWindow* aVTKFrame = dynamic_cast( anActiveWindow ); + if( !aVTKFrame ) + return; TextLabelNear->setText( tr( "Near" ) ); TextLabelFar->setText( tr( "Far" ) ); @@ -223,9 +225,11 @@ bool OperationGUI_ClippingDlg::ClickOnApply() if (!anActiveWindow) return false; - if ( anActiveWindow->getViewManager()->getType() == VTKViewer_Viewer::Type() ) + if ( anActiveWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) { - VTKViewer_ViewWindow* aVTKFrame = dynamic_cast( anActiveWindow ); + SVTK_ViewWindow* aVTKFrame = dynamic_cast( anActiveWindow ); + if( !aVTKFrame ) + return false; vtkRenderer* aRenderer = aVTKFrame->getRenderer(); if(!aRenderer) return false; @@ -331,9 +335,11 @@ void OperationGUI_ClippingDlg::onReset() if (!anActiveWindow) return; - if ( anActiveWindow->getViewManager()->getType() == VTKViewer_Viewer::Type() ) + if ( anActiveWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) { - VTKViewer_ViewWindow* aVTKFrame = dynamic_cast( anActiveWindow ); + SVTK_ViewWindow* aVTKFrame = dynamic_cast( anActiveWindow ); + if( !aVTKFrame ) + return; vtkRenderer* aRenderer = aVTKFrame->getRenderer(); if(!aRenderer) return; -- 2.39.2