Handle(SALOME_InteractiveObject) anIO;
if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
EditPrs3d<VISU::ScalarMap_i, VisuGUI_ScalarBarDlg,1>(this, aPrs3d);
- if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
+ if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){
aViewWindow->highlight(anIO, 1);
}
}
Handle(SALOME_InteractiveObject) anIO;
if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
EditPrs3d<VISU::DeformedShape_i, VisuGUI_DeformedShapeDlg,1>(this, aPrs3d);
- if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
+ if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){
aViewWindow->highlight(anIO, 1);
}
}
Handle(SALOME_InteractiveObject) anIO;
if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
EditPrs3d<VISU::CutPlanes_i, VisuGUI_CutPlanesDlg,0>(this, aPrs3d);
- if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
+ if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){
aViewWindow->highlight(anIO, 1);
}
}
Handle(SALOME_InteractiveObject) anIO;
if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
EditPrs3d<VISU::CutLines_i, VisuGUI_CutLinesDlg,0>(this, aPrs3d);
- if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
+ if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){
aViewWindow->highlight(anIO, 1);
}
}
Handle(SALOME_InteractiveObject) anIO;
if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
EditPrs3d<VISU::IsoSurfaces_i, VisuGUI_IsoSurfacesDlg,1>(this, aPrs3d);
- if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
+ if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){
aViewWindow->highlight(anIO, 1);
}
}
Handle(SALOME_InteractiveObject) anIO;
if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
EditPrs3d<VISU::Vectors_i, VisuGUI_VectorsDlg,1>(this, aPrs3d);
- if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
+ if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){
aViewWindow->highlight(anIO, 1);
}
}
Handle(SALOME_InteractiveObject) anIO;
if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
EditPrs3d<VISU::StreamLines_i, VisuGUI_StreamLinesDlg,1>(this, aPrs3d);
- if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
+ if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){
aViewWindow->highlight(anIO, 1);
}
}
Handle(SALOME_InteractiveObject) anIO;
if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
EditPrs3d<VISU::Plot3D_i, VisuGUI_Plot3DDlg,0>(this, aPrs3d);
- if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
+ if(SVTK_ViewWindow* aViewWindow = GetViewWindow(this)){
aViewWindow->highlight(anIO, 1);
}
}
VisuGUI::
OnEraseAll()
{
- if (SVTK_ViewWindow* vw = GetViewWindow()) {
+ if (SVTK_ViewWindow* vw = GetViewWindow(this)) {
vw->unHighlightAll();
if (vtkRenderer *aRen = vw->getRenderer()) {
vtkActor *anActor;
VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
if (!aPrs3d) return;
- SVTK_ViewWindow* vw = GetViewWindow();
+ SVTK_ViewWindow* vw = GetViewWindow(this);
if (!vw) return;
VISU_Actor* anActor = GetActor(aPrs3d, vw);
VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
if (!aPrs3d) return;
- SVTK_ViewWindow* vw = GetViewWindow();
+ SVTK_ViewWindow* vw = GetViewWindow(this);
if (!vw) return;
VISU_Actor* anActor = GetActor(aPrs3d, vw);
VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
if (!aPrsObject) return;
- SVTK_ViewWindow* vw = GetViewWindow();
+ SVTK_ViewWindow* vw = GetViewWindow(this);
if (!vw) return;
VISU_Actor* anActor = GetActor(aPrsObject, vw);
VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
if (!aPrsObject) return;
- SVTK_ViewWindow* vw = GetViewWindow();
+ SVTK_ViewWindow* vw = GetViewWindow(this);
if (!vw) return;
VISU_Actor* anActor = GetActor(aPrsObject, vw);
VISU::ScalarMap_i* aPrsObject = dynamic_cast<VISU::ScalarMap_i*>(aServant.in());
if (!aPrsObject) return;
- SVTK_ViewWindow* vw = GetViewWindow();
+ SVTK_ViewWindow* vw = GetViewWindow(this);
if (!vw) return;
VISU_Actor* aActor = GetActor(aPrsObject, vw);
VisuGUI::
OnSelectionInfo()
{
- if (GetViewWindow())
+ if (GetViewWindow(this))
(new VisuGUI_SelectionDlg(GetDesktop(this)))->show();
else
SUIT_MessageBox::warn1(GetDesktop(this),
VisuGUI::
OnArrangeActors()
{
- SVTK_ViewWindow* vw = GetViewWindow();
+ SVTK_ViewWindow* vw = GetViewWindow(this);
if (vw) {
ArrangeDlg* aDlg = new ArrangeDlg (GetDesktop(this), vw);
aDlg->exec();
if(!CORBA::is_nil(anObject)){
if(VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(anObject).in())){
if(MYDEBUG) MESSAGE("VisuGUI_Module::OnDisplayPrs : Prs3d object");
- if(aPrs3d->GetType() != VISU::TGAUSSPOINTS)
- VISU::UpdateViewer<SVTK_Viewer>(this,aPrs3d,false,true,true);
- else
+ if(aPrs3d->GetType() == VISU::TGAUSSPOINTS)
VISU::UpdateViewer<VVTK_Viewer>(this,aPrs3d,false,true,true);
+ else if(SUIT_ViewManager* aViewManager = getApp()->activeViewManager()){
+ QString aType = aViewManager->getType();
+ if(aType == SVTK_Viewer::Type())
+ VISU::UpdateViewer<SVTK_Viewer>(this,aPrs3d,false,true,true);
+ else if(aType == VVTK_Viewer::Type())
+ VISU::UpdateViewer<VVTK_Viewer>(this,aPrs3d,false,true,true);
+ }
continue;
}
}
VisuGUI_Module
::OnDisplayOnlyPrs()
{
- if(SalomeApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this)){
- SALOME_ListIO aList;
- aSelectionMgr->selectedObjects(aList);
- for(SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next()){
- Handle(SALOME_InteractiveObject) anIO = it.Value();
- CORBA::Object_var anObject = GetSelectedObj( GetAppStudy(this), anIO->getEntry() );
-
- if(!CORBA::is_nil(anObject)){
- if(VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(anObject).in())){
- if(aPrs3d->GetType() != VISU::TGAUSSPOINTS)
- VISU::OnEraseAll<SVTK_Viewer>(this);
- else
- VISU::OnEraseAll<VVTK_Viewer>(this);
- break;
- }
- }
- }
- }
+ OnEraseAll();
OnDisplayPrs();
}
CreatePrs3d(VisuGUI* theModule,
const bool theIsCreateView = true)
{
- CreatePrs3d<TPrs3d_i,SVTK_Viewer,TDlg,IsDlgModal>(theModule,theIsCreateView);
+ if(SUIT_ViewManager* aViewManager = theModule->getApp()->activeViewManager()){
+ QString aType = aViewManager->getType();
+ if(aType == SVTK_Viewer::Type())
+ CreatePrs3d<TPrs3d_i,SVTK_Viewer,TDlg,IsDlgModal>(theModule,theIsCreateView);
+ else if(aType == VVTK_Viewer::Type())
+ CreatePrs3d<TPrs3d_i,VVTK_Viewer,TDlg,IsDlgModal>(theModule,theIsCreateView);
+ }
}
+
}
#endif
ChangeRepresentation (const SalomeApp_Module* theModule,
VISU::PresentationType theType)
{
- SUIT_ViewWindow* aView = GetActiveView(theModule, SVTK_Viewer::Type());
- if (!aView) return;
- SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>( aView );
+ SVTK_ViewWindow* vw = GetViewWindow( theModule, false );
if( !vw )
return;
SVTK_ViewWindow*
GetViewWindow(const SalomeApp_Module* theModule, const bool theCreate )
{
- if(SalomeApp_Application* anApp = theModule->getApp()){
- if(SUIT_ViewManager* aViewManager = anApp->getViewManager( SVTK_Viewer::Type(), theCreate )){
- if(SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView()){
- return dynamic_cast<SVTK_ViewWindow*>(aViewWindow);
- }
+ if (SalomeApp_Application* anApp = theModule->getApp())
+ {
+ SVTK_ViewWindow* wnd = dynamic_cast<SVTK_ViewWindow*>(anApp->desktop()->activeWindow());
+ if( wnd )
+ return wnd;
+ else
+ {
+ SUIT_ViewManager* aViewManager = anApp->getViewManager( SVTK_Viewer::Type(), theCreate );
+ return dynamic_cast<SVTK_ViewWindow*>( aViewManager->getActiveView() );
}
}
return NULL;
try {
thePrs->Update();
-
- TViewWindows aViewWindows = GetViews(theModule);
- for (int i = 0, iEnd = aViewWindows.size(); i < iEnd; i++) {
- SVTK_ViewWindow* aView = aViewWindows[i];
- if (VISU_Actor* anActor = FindActor(aView, anEntry.in())) {
- thePrs->UpdateActor(anActor);
- }
- }
+ thePrs->UpdateActors();
} catch (std::runtime_error& ex) {
INFOS(ex.what());
QApplication::restoreOverrideCursor();
QObject::tr("ERR_CANT_BUILD_PRESENTATION") + " " + QObject::tr(ex.what()),
QObject::tr("BUT_OK"));
- TViewWindows aViewWindows = GetViews(theModule);
- for (int i = 0, iEnd = aViewWindows.size(); i < iEnd; i++) {
- SVTK_ViewWindow* aView = aViewWindows[i];
- if (VISU_Actor* anActor = FindActor(aView, anEntry.in())) {
- aView->RemoveActor(anActor);
- anActor->Delete();
- }
- }
+ thePrs->RemoveActors();
return;
}
QApplication::restoreOverrideCursor();
if(VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(theBase).in())){
if(aType == VISU::TGAUSSPOINTS)
ErasePrs3d<VVTK_Viewer>(theModule,aPrsObject,thIsUpdate);
- else
- ErasePrs3d<SVTK_Viewer>(theModule,aPrsObject,thIsUpdate);
+ else if(SUIT_ViewManager* aViewManager = theModule->getApp()->activeViewManager()){
+ QString aType = aViewManager->getType();
+ if(aType == SVTK_Viewer::Type())
+ ErasePrs3d<SVTK_Viewer>(theModule,aPrsObject,thIsUpdate);
+ else if(aType == VVTK_Viewer::Type())
+ ErasePrs3d<VVTK_Viewer>(theModule,aPrsObject,thIsUpdate);
+ }
}
}} // switch (aType)
}
{
if(VISU_GaussPtsAct* anActor = dynamic_cast<VISU_GaussPtsAct*>(theActor)){
anActor->SetPickingSettings(myPickingSettings);
- Superclass::AddActor(anActor);
}
+ Superclass::AddActor(theActor);
}
//----------------------------------------------------------------------------
using namespace VISU;
if(VISU_GaussPtsAct1* anActor = dynamic_cast<VISU_GaussPtsAct1*>(theActor)){
anActor->SetPickingSettings(NULL);
- Superclass::RemoveActor(theActor);
}
+ Superclass::RemoveActor(theActor);
}
//----------------------------------------------------------------------------
VVTK_Renderer1
::AddActor(VTKViewer_Actor* theActor)
{
+ Superclass::AddActor(theActor);
if(VISU_GaussPtsAct1* anActor = dynamic_cast<VISU_GaussPtsAct1*>(theActor)){
anActor->SetImplicitFunctionWidget(GetImplicitFunctionWidget());
anActor->SetOutsideCursorSettings(myOutsideCursorSettings);
- Superclass::AddActor(anActor);
AdjustImplicitFunctionWidget();
}
}
VVTK_Renderer1
::RemoveActor(VTKViewer_Actor* theActor)
{
+ Superclass::RemoveActor(theActor);
using namespace VISU;
if(VISU_GaussPtsAct1* anActor = dynamic_cast<VISU_GaussPtsAct1*>(theActor)){
anActor->SetImplicitFunctionWidget(NULL);
anActor->SetOutsideCursorSettings(NULL);
- Superclass::RemoveActor(theActor);
AdjustImplicitFunctionWidget();
}
}