#include <SUIT_ViewWindow.h>
#include <SUIT_OverrideCursor.h>
-#include <VTKViewer_ViewWindow.h>
-#include <VTKViewer_RenderWindowInteractor.h>
#include <OCCViewer_ViewManager.h>
#include <OCCViewer_ViewModel.h>
#include <OCCViewer_ViewWindow.h>
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( 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();
}
}
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<SVTK_ViewWindow*>( 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();
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<SVTK_ViewWindow*>( 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();
SALOME_ListIO aList;
- if ( viewWindow->getViewManager()->getType() == VTKViewer_Viewer::Type() ) {
+ if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) {
SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>( 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<SVTK_Prs*>( stvkViewer->CreatePrs( It.Value()->getEntry() ) );
+ SVTK_Viewer* stvkViewer = dynamic_cast<SVTK_Viewer*>(vw->getViewManager()->getViewModel());
+ SVTK_Prs* vtkPrs = stvkViewer ? dynamic_cast<SVTK_Prs*>( stvkViewer->CreatePrs( It.Value()->getEntry() ) ) : 0;
if ( vtkPrs && !vtkPrs->IsNull() ) {
if ( mode == 0 )
rwi->ChangeRepresentationToWireframe( vtkPrs->GetObjects() );
#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"
}
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<SVTK_ViewFrame*>( 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");
#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"
QPtrList<SUIT_ViewWindow> aViewWindowsList = SUIT_Session::session()->activeApplication()->desktop()->windows();
for ( QPtrListIterator<SUIT_ViewWindow> 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<SVTK_ViewWindow*>( it.current() );
+ if( !aVTKViewWindow )
+ continue;
vtkRenderer* Renderer = aVTKViewWindow->getRenderer();
vtkActorCollection* theActors = Renderer->GetActors();
theActors->InitTraversal();
#include <SalomeApp_Module.h>
#include <OCCViewer_ViewModel.h>
-#include <VTKViewer_ViewModel.h>
+#include <SVTK_ViewModel.h>
#include <OB_Browser.h>
// 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<SALOME_View*>(aViewModel);
{
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<SALOME_View*>(aViewModel);
#include <SALOME_Actor.h>
#include <OCCViewer_ViewModel.h>
-#include <VTKViewer_ViewModel.h>
+#include <SVTK_ViewModel.h>
#include "GEOMImpl_Types.hxx"
{
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
}
}
}
- 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<SVTK_Prs*>( prs );
+ vtkActorCollection* lst = vtkPrs ? vtkPrs->GetObjects() : 0;
if ( lst ) {
lst->InitTraversal();
vtkActor* actor = lst->GetNextActor();
#include <OCCViewer_ViewModel.h>
#include <OCCViewer_ViewManager.h>
-#include <VTKViewer_ViewWindow.h>
+#include <SVTK_ViewWindow.h>
#include <SVTK_RenderWindowInteractor.h>
#include <SVTK_InteractorStyle.h>
#include <SVTK_ViewModel.h>
-#include <VTKViewer_ViewManager.h>
+#include <SVTK_ViewManager.h>
#include <SalomeApp_Application.h>
#include <SalomeApp_SelectionMgr.h>
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<OCCViewer_ViewWindow*>( window );
}
}
else if( ViewVTK ) {
- VTKViewer_ViewWindow* vw = dynamic_cast<VTKViewer_ViewWindow*>( window );
+ SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>( window );
if ( vw ) {
vtkCamera* camera = vw->getRenderer()->GetActiveCamera();
// 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 );
SUIT_ViewWindow* win = 0;
for ( win = winList.first(); win; win = winList.next() ) {
if ( win->getViewManager()->getTypeView() == VIEW_VTK ) {
- VTKViewer_ViewWindow* vw = dynamic_cast<VTKViewer_ViewWindow*>( window );
+ SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>( window );
if ( vw ) {
- VTKViewer_RenderWindowInteractor* anInteractor = vw->getRWInteractor();
+ SVTK_RenderWindowInteractor* anInteractor = vw->getRWInteractor();
anInteractor->SetSelectionProp();
anInteractor->SetSelectionTolerance();
SVTK_InteractorStyleSALOME* aStyle = anInteractor->GetInteractorStyleSALOME();
}
}
else if ( ViewVTK ) {
- VTKViewer_ViewWindow* vw = dynamic_cast<VTKViewer_ViewWindow*>( window );
+ SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>( window );
if ( vw ) {
- VTKViewer_RenderWindowInteractor* myRenderInter = vw->getRWInteractor();
+ SVTK_RenderWindowInteractor* myRenderInter = vw->getRWInteractor();
DisplayMode = myRenderInter->GetDisplayMode();
}
}
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<SVTK_Viewer*>( vm->getViewModel() ), sm ) );
// disable OCC selectors
getApp()->selectionMgr()->setEnabled( false, OCCViewer_Viewer::Type() );
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);
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 );
}
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<SVTK_ViewFrame*>( aViewFrame )->getRWInteractor()->GetDisplayMode();
int nbSel = Sel->IObjectCount();
else {
////// VTK viewer only
popup->removeItem( 8034 ); // "Isos"
- VTKViewer_Prs* vtkPrs = dynamic_cast<VTKViewer_Prs*>( prs );
+ SVTK_Prs* vtkPrs = dynamic_cast<SVTK_Prs*>( prs );
if ( vtkPrs && !vtkPrs->IsNull() ) {
vtkActorCollection* actorList = vtkPrs->GetObjects();
actorList->InitTraversal();
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
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<SVTK_Viewer*>( 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);
}
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 )
#include <OCCViewer_ViewManager.h>
#include <SOCC_ViewModel.h>
-#include <VTKViewer_ViewWindow.h>
-#include <VTKViewer_ViewModel.h>
-#include <VTKViewer_RenderWindowInteractor.h>
+#include <SVTK_ViewModel.h>
#include <SVTK_ViewWindow.h>
#include <SVTK_RenderWindowInteractor.h>
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<SVTK_ViewWindow*>( window );
return 0;
#include <SALOME_ListIO.hxx>
#include <SALOME_ListIteratorOfListIO.hxx>
-#include <VTKViewer_ViewModel.h>
-#include <OCCViewer_ViewModel.h>
-#include <OCCViewer_ViewWindow.h>
-
+#include <SVTK_ViewModel.h>
#include <SVTK_ViewWindow.h>
#include <SVTK_RenderWindowInteractor.h>
+#include <OCCViewer_ViewModel.h>
+#include <OCCViewer_ViewWindow.h>
+
#include <SUIT_ViewManager.h>
#include <SUIT_Application.h>
#include <SUIT_Desktop.h>
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 );
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<SVTK_ViewWindow*>( window );
if ( !vtkVW )
#include <SALOME_ListIO.hxx>
#include <SALOME_ListIteratorOfListIO.hxx>
-#include <VTKViewer_ViewModel.h>
-#include <OCCViewer_ViewModel.h>
-#include <OCCViewer_ViewWindow.h>
-
+#include <SVTK_ViewModel.h>
#include <SVTK_ViewWindow.h>
#include <SVTK_RenderWindowInteractor.h>
+#include <OCCViewer_ViewModel.h>
+#include <OCCViewer_ViewWindow.h>
+
#include <SUIT_ViewManager.h>
#include <SUIT_Application.h>
#include <SUIT_Desktop.h>
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<SVTK_ViewWindow*>( window );
#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"
if (!anActiveWindow)
return;
- if ( anActiveWindow->getViewManager()->getType() == VTKViewer_Viewer::Type() )
+ if ( anActiveWindow->getViewManager()->getType() == SVTK_Viewer::Type() )
{
- VTKViewer_ViewWindow* aVTKFrame = dynamic_cast<VTKViewer_ViewWindow*>( anActiveWindow );
+ SVTK_ViewWindow* aVTKFrame = dynamic_cast<SVTK_ViewWindow*>( anActiveWindow );
+ if( !aVTKFrame )
+ return;
TextLabelNear->setText( tr( "Near" ) );
TextLabelFar->setText( tr( "Far" ) );
if (!anActiveWindow)
return false;
- if ( anActiveWindow->getViewManager()->getType() == VTKViewer_Viewer::Type() )
+ if ( anActiveWindow->getViewManager()->getType() == SVTK_Viewer::Type() )
{
- VTKViewer_ViewWindow* aVTKFrame = dynamic_cast<VTKViewer_ViewWindow*>( anActiveWindow );
+ SVTK_ViewWindow* aVTKFrame = dynamic_cast<SVTK_ViewWindow*>( anActiveWindow );
+ if( !aVTKFrame )
+ return false;
vtkRenderer* aRenderer = aVTKFrame->getRenderer();
if(!aRenderer) return false;
if (!anActiveWindow)
return;
- if ( anActiveWindow->getViewManager()->getType() == VTKViewer_Viewer::Type() )
+ if ( anActiveWindow->getViewManager()->getType() == SVTK_Viewer::Type() )
{
- VTKViewer_ViewWindow* aVTKFrame = dynamic_cast<VTKViewer_ViewWindow*>( anActiveWindow );
+ SVTK_ViewWindow* aVTKFrame = dynamic_cast<SVTK_ViewWindow*>( anActiveWindow );
+ if( !aVTKFrame )
+ return;
vtkRenderer* aRenderer = aVTKFrame->getRenderer();
if(!aRenderer) return;