1 // VISU OBJECT : interactive object for VISU entities implementation
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
23 // File : VISU_ViewManager_i.cc
24 // Author : Alexey PETROV
27 #include "VISU_ViewManager_i.hh"
28 #include "VISU_View_i.hh"
29 #include "VISU_Prs3d_i.hh"
30 #include "VISU_Table_i.hh"
32 #include "VISU_Actor.h"
34 #include "SUIT_Tools.h"
35 #include "SUIT_Session.h"
36 #include "SUIT_ViewWindow.h"
37 #include "SUIT_ViewManager.h"
39 #include "SVTK_RenderWindow.h"
40 #include "SVTK_ViewWindow.h"
41 #include "SVTK_ViewModel.h"
42 #include "SPlot2d_Curve.h"
43 #include "Plot2d_ViewFrame.h"
44 #include "Plot2d_ViewWindow.h"
45 #include "Plot2d_ViewModel.h"
47 #include "SalomeApp_Study.h"
48 #include "SalomeApp_Application.h"
49 #include "LightApp_SelectionMgr.h"
51 #include "SALOME_Event.hxx"
52 #include "SALOME_ListIO.hxx"
53 #include "SALOME_ListIteratorOfListIO.hxx"
55 #include <vtkCamera.h>
56 #include <vtkRenderer.h>
57 #include <vtkRenderWindow.h>
59 #include <qapplication.h>
64 static int MYDEBUG = 1;
66 static int MYDEBUG = 0;
71 struct TNewViewManagerEvent: public SALOME_Event
74 typedef SalomeApp_Application* TResult;
77 TNewViewManagerEvent (const int theStudyId):
78 myStudyId(theStudyId),
86 MESSAGE("Find application for study with id = : " << myStudyId);
87 SUIT_Session* aSession = SUIT_Session::session();
88 QPtrList<SUIT_Application> anApplications = aSession->applications();
89 QPtrListIterator<SUIT_Application> anIter (anApplications);
90 while (SUIT_Application* anApp = anIter.current()) {
92 if (SUIT_Study* aSStudy = anApp->activeStudy()) {
93 if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
94 if (_PTR(Study) aCStudy = aStudy->studyDS()) {
95 //if (myStudyName == aCStudy->Name()) {
96 if (myStudyId == aCStudy->StudyId()) {
97 myResult = dynamic_cast<SalomeApp_Application*>(anApp);
105 //MESSAGE("Error: application is not found for study : " << myStudyName);
106 MESSAGE("Error: application is not found for study with id = : " << myStudyId);
111 //===========================================================================
112 ViewManager_i::ViewManager_i(SALOMEDS::Study_ptr theStudy)
114 if(MYDEBUG) MESSAGE("ViewManager_i::ViewManager_i - "<<this);
116 //CORBA::String_var aStudyName = theStudy->Name();
117 //myApplication = ProcessEvent(new TNewViewManagerEvent(aStudyName.in()));
118 int aStudyID = theStudy->StudyId();
119 myApplication = ProcessEvent(new TNewViewManagerEvent(aStudyID));
123 ViewManager_i::~ViewManager_i()
125 if(MYDEBUG) MESSAGE("ViewManager_i::~ViewManager_i - "<<this);
129 struct TCurrentViewEvent: public SALOME_Event
131 const SalomeApp_Application* myApplication;
132 typedef VISU::View_ptr TResult;
135 TCurrentViewEvent(const SalomeApp_Application* theApplication):
136 myApplication(theApplication),
137 myResult(VISU::View::_nil())
144 //if (SUIT_ViewManager *aViewManager = myApplication->activeViewManager()) {
145 // if (aViewManager->getType() == "VTKViewer") {
146 // if (SUIT_ViewWindow *aViewWindow = aViewManager->getActiveView()) {
147 VISU::View3D_i* pView =
148 new View3D_i ((SalomeApp_Application*)myApplication);
149 if (pView->Create(0))
150 myResult = pView->_this();
157 VISU::View_ptr ViewManager_i::GetCurrentView(){
158 return ProcessEvent(new TCurrentViewEvent(myApplication));
162 template<class TViewFrame>
163 struct TCreateViewFrameEvent: public SALOME_Event
165 SalomeApp_Application* myApplication;
166 typedef typename TViewFrame::TInterface TInterface;
167 typedef typename TInterface::_ptr_type TResult;
170 TCreateViewFrameEvent (SalomeApp_Application* theApplication):
171 myApplication(theApplication),
172 myResult(TInterface::_nil())
179 //if (CheckStudy(myStudyDocument)) {
181 TViewFrame* pView = new TViewFrame (myApplication);
182 if (pView->Create(1)) {
183 myResult = pView->_this();
184 qApp->processEvents(); // Fix for bug 9929
191 VISU::View3D_ptr ViewManager_i::Create3DView()
193 if (MYDEBUG) MESSAGE("ViewManager_i::Create3DView");
194 return ProcessEvent(new TCreateViewFrameEvent<View3D_i>(myApplication));
197 VISU::XYPlot_ptr ViewManager_i::CreateXYPlot()
199 if (MYDEBUG) MESSAGE("ViewManager_i::CreateXYPlot");
200 return ProcessEvent(new TCreateViewFrameEvent<XYPlot_i>(myApplication));
203 class TCreateViewEvent: public SALOME_Event
206 TCreateViewEvent (SalomeApp_Application* theApplication)
207 : myApplication(theApplication)
210 SalomeApp_Application* myApplication;
213 class TCreateTableViewFrameEvent: public TCreateViewEvent
217 TCreateTableViewFrameEvent (SalomeApp_Application* theApplication,
219 TCreateViewEvent(theApplication),
221 myResult(VISU::TableView::_nil())
224 virtual void Execute()
226 //if (CheckStudy(myStudyDocument)) {
227 VISU::TableView_i* pView = new TableView_i (myApplication);
228 if (pView->Create(myTable) != NULL)
229 myResult = pView->_this();
232 typedef VISU::TableView_ptr TResult;
236 VISU::TableView_ptr ViewManager_i::CreateTableView (VISU::Table_ptr theTable)
238 if (MYDEBUG) MESSAGE("ViewManager_i::CreateTableView");
239 //return ProcessEvent(new TCreateViewFrameEvent<TableView_i>(myApplication));
240 return ProcessEvent(new TCreateTableViewFrameEvent (myApplication, theTable));
243 void ViewManager_i::Destroy (View_ptr theView)
245 class TEvent: public SALOME_Event {
248 TEvent(View_ptr theView):
251 virtual void Execute(){
252 if (!CORBA::is_nil(myView)) {
253 if (VISU::View_i* pView = dynamic_cast<VISU::View_i*>(VISU::GetServant(myView).in())) {
255 pView->_remove_ref();
261 if (MYDEBUG) MESSAGE("ViewManager_i::Destroy - " << theView->_is_nil());
262 ProcessVoidEvent(new TEvent(theView));
265 //===========================================================================
266 // VISU namespace functions
267 //===========================================================================
268 SVTK_ViewWindow* GetViewWindow (SUIT_ViewWindow* theStudyFrame)
270 return dynamic_cast<SVTK_ViewWindow*>(theStudyFrame);
273 vtkRenderer* GetRenderer (SUIT_ViewWindow* theStudyFrame)
275 return GetViewWindow(theStudyFrame)->getRenderer();
278 vtkCamera* GetCamera (SUIT_ViewWindow* theStudyFrame)
280 return GetRenderer(theStudyFrame)->GetActiveCamera();
283 void RepaintView (SUIT_ViewWindow* theViewWindow)
285 SVTK_ViewWindow* vf = GetViewWindow(theViewWindow);
286 vf->getRenderer()->ResetCameraClippingRange();
287 vf->getRenderWindow()->getRenderWindow()->Render();
290 VISU_Actor* UpdateViewer (SUIT_ViewWindow* theStudyFrame, int theDisplaing, Prs3d_i* thePrs)
292 SVTK_ViewWindow* vf = GetViewWindow(theStudyFrame);
293 if (!vf) return NULL;
294 if(MYDEBUG) MESSAGE("UpdateViewer - theDisplaing = "<<theDisplaing<<"; thePrs = "<<thePrs);
295 vtkRenderer *aRen = vf->getRenderer();
296 vtkActorCollection *anActColl = aRen->GetActors();
298 VISU_Actor *anVISUActor = NULL, *aResActor = NULL;
299 for(anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL;){
300 if(anActor->IsA("VISU_Actor")){
301 anVISUActor = VISU_Actor::SafeDownCast(anActor);
302 if (thePrs == anVISUActor->GetPrs3d()) {
303 aResActor = anVISUActor->GetParent();
304 if(theDisplaing < eErase)
305 aResActor->VisibilityOn();
307 aResActor->VisibilityOff();
309 if(theDisplaing > eDisplay)
310 anVISUActor->VisibilityOff();
312 anVISUActor->VisibilityOn();
317 RepaintView(theStudyFrame);
320 if(thePrs != NULL && theDisplaing < eErase){
322 anVISUActor = thePrs->CreateActor();
323 vf->AddActor(anVISUActor);
324 }catch(std::exception& exc){
325 if(MYDEBUG) INFOS(exc.what());
328 if(MYDEBUG) INFOS("Unknown exception was occured!!!");
332 RepaintView(theStudyFrame);
336 void UpdatePlot2d (Plot2d_ViewFrame *theView,int theDisplaying, Curve_i* theCurve)
338 if(MYDEBUG) MESSAGE("UpdatePlot2d - theDisplaying = " << theDisplaying);
341 QList<Plot2d_Curve> clist;
342 theView->getCurves(clist);
343 if (theDisplaying == eEraseAll) {
344 for (int i = 0; i < clist.count(); i++) {
345 if(MYDEBUG) MESSAGE("UpdatePlot2d - erasing all : curve - " << clist.at(i));
346 theView->eraseCurve(clist.at(i));
348 } else if (theDisplaying == eErase) {
350 for (int i = 0; i < clist.count(); i++) {
351 SPlot2d_Curve* aSPlot2dC = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
352 if (aSPlot2dC->hasIO() &&
353 !strcmp(aSPlot2dC->getIO()->getEntry(), theCurve->GetEntry())) {
354 if(MYDEBUG) MESSAGE("UpdatePlot2d - erasing : curve - " << aSPlot2dC);
355 theView->eraseCurve(aSPlot2dC);
359 } else if (theDisplaying == eDisplay) {
362 for (int i = 0; i < clist.count(); i++) {
363 SPlot2d_Curve* aSPlot2dC = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
364 if (aSPlot2dC->hasIO() &&
365 !strcmp(aSPlot2dC->getIO()->getEntry(), theCurve->GetEntry())) {
366 if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying : curve - " << aSPlot2dC);
367 aSPlot2dC->setHorTitle( theCurve->GetHorTitle().c_str() );
368 aSPlot2dC->setVerTitle( theCurve->GetVerTitle().c_str() );
369 aSPlot2dC->setHorUnits( theCurve->GetHorUnits().c_str() );
370 aSPlot2dC->setVerUnits( theCurve->GetVerUnits().c_str() );
373 int nbPoints = theCurve->GetData( xList, yList );
374 if (nbPoints > 0 && xList && yList) {
375 aSPlot2dC->setData( xList, yList, nbPoints );
377 if (!theCurve->IsAuto()) {
378 aSPlot2dC->setLine((Plot2d_Curve::LineType)theCurve->GetLine(),
379 theCurve->GetLineWidth());
380 aSPlot2dC->setMarker((Plot2d_Curve::MarkerType)theCurve->GetMarker());
381 SALOMEDS::Color color = theCurve->GetColor();
382 aSPlot2dC->setColor(QColor((int)(color.R*255.),
384 (int)(color.B*255.)));
386 aSPlot2dC->setAutoAssign(theCurve->IsAuto());
387 theView->displayCurve(aSPlot2dC);
392 Plot2d_Curve* crv = theCurve->CreatePresentation();
393 if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying : curve (new) - "<<crv );
395 theView->displayCurve( crv );
396 theCurve->SetLine( (VISU::Curve::LineType)crv->getLine(), crv->getLineWidth() );
397 theCurve->SetMarker( (VISU::Curve::MarkerType)crv->getMarker());
398 SALOMEDS::Color newColor;
399 newColor.R = crv->getColor().red()/255.;
400 newColor.G = crv->getColor().green()/255.;
401 newColor.B = crv->getColor().blue()/255.;
402 theCurve->SetColor( newColor );
403 crv->setAutoAssign( theCurve->IsAuto() );
407 } else if (theDisplaying == eDisplayOnly) {
410 for (int i = 0; i < clist.count(); i++) {
411 SPlot2d_Curve* aSPlot2dC = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
412 if (aSPlot2dC->hasIO() &&
413 !strcmp(aSPlot2dC->getIO()->getEntry(), theCurve->GetEntry())) {
414 if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying only : curve - " << aSPlot2dC);
415 aSPlot2dC->setHorTitle( theCurve->GetHorTitle().c_str() );
416 aSPlot2dC->setVerTitle( theCurve->GetVerTitle().c_str() );
417 aSPlot2dC->setHorUnits( theCurve->GetHorUnits().c_str() );
418 aSPlot2dC->setVerUnits( theCurve->GetVerUnits().c_str() );
421 int nbPoints = theCurve->GetData( xList, yList );
422 if ( nbPoints > 0 && xList && yList ) {
423 aSPlot2dC->setData( xList, yList, nbPoints );
425 if ( !theCurve->IsAuto() ) {
426 aSPlot2dC->setLine((Plot2d_Curve::LineType)theCurve->GetLine(), theCurve->GetLineWidth());
427 aSPlot2dC->setMarker((Plot2d_Curve::MarkerType)theCurve->GetMarker());
428 SALOMEDS::Color color = theCurve->GetColor();
429 aSPlot2dC->setColor(QColor((int)(color.R*255.), (int)(color.G*255.), (int)(color.B*255.)));
431 aSPlot2dC->setAutoAssign(theCurve->IsAuto());
432 theView->displayCurve(aSPlot2dC);
435 theView->eraseCurve(aSPlot2dC);
439 Plot2d_Curve* crv = theCurve->CreatePresentation();
440 if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying only : curve (new) - " << crv);
442 theView->displayCurve(crv);
443 theCurve->SetLine((VISU::Curve::LineType)crv->getLine(), crv->getLineWidth());
444 theCurve->SetMarker((VISU::Curve::MarkerType)crv->getMarker());
445 SALOMEDS::Color newColor;
446 newColor.R = crv->getColor().red()/255.;
447 newColor.G = crv->getColor().green()/255.;
448 newColor.B = crv->getColor().blue()/255.;
449 theCurve->SetColor(newColor);
450 crv->setAutoAssign(theCurve->IsAuto());
457 VISU_Actor* GetActor (VISU::Prs3d_i* thePrs3d, SVTK_ViewWindow* theVTKFrame)
459 vtkActorCollection *anActColl = theVTKFrame->getRenderer()->GetActors();
460 anActColl->InitTraversal();
461 while (vtkActor *anActor = anActColl->GetNextActor())
462 if (VISU_Actor* anVISUActor = dynamic_cast<VISU_Actor*>(anActor))
463 if (thePrs3d == anVISUActor->GetPrs3d())
464 return anVISUActor->GetParent();
468 struct TDeleteActorsEvent: public SALOME_Event
470 VISU::Curve_i* myPrs;
472 TDeleteActorsEvent (VISU::Curve_i* thePrs):
482 // 1. Find appropriate application (code like in TNewViewManagerEvent::Execute())
483 SALOMEDS::Study_var myStudyDocument = myPrs->GetStudyDocument();
484 SalomeApp_Application* anApp = NULL;
485 CORBA::String_var studyName = myStudyDocument->Name();
486 std::string aStudyName = studyName.in();
487 SUIT_Session* aSession = SUIT_Session::session();
488 QPtrList<SUIT_Application> anApplications = aSession->applications();
489 QPtrListIterator<SUIT_Application> anIter (anApplications);
490 while (SUIT_Application* aSUITApp = anIter.current()) {
492 if (SUIT_Study* aSStudy = aSUITApp->activeStudy()) {
493 if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
494 if (_PTR(Study) aCStudy = aStudy->studyDS()) {
495 if (aStudyName == aCStudy->Name()) {
496 anApp = dynamic_cast<SalomeApp_Application*>(aSUITApp);
506 // 2. Remove corresponding IO from selection
507 SALOMEDS::SObject_var aSObject = myPrs->GetSObject();
508 CORBA::String_var anEntry = aSObject->GetID();
510 LightApp_SelectionMgr* aSelectionMgr = anApp->selectionMgr();
511 SALOME_ListIO aListIO, aNewListIO;
512 aSelectionMgr->selectedObjects(aListIO);
514 for (SALOME_ListIteratorOfListIO it (aListIO); it.More(); it.Next()) {
515 if (it.Value()->hasEntry()) {
516 std::string aCurEntry (it.Value()->getEntry());
517 if (aCurEntry != std::string( anEntry.in() ) ) {
518 aNewListIO.Append(it.Value());
523 aSelectionMgr->setSelectedObjects(aNewListIO);
526 ViewManagerList aViewManagerList;
527 anApp->viewManagers(SVTK_Viewer::Type(), aViewManagerList);
528 QPtrListIterator<SUIT_ViewManager> anVMIter (aViewManagerList);
529 for (; anVMIter.current(); ++anVMIter) {
530 SUIT_ViewManager* aViewManager = anVMIter.current();
531 QPtrVector<SUIT_ViewWindow> aViews = aViewManager->getViews();
532 for (int i = 0, iEnd = aViews.size(); i < iEnd; i++) {
533 if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) {
534 if (Plot2d_ViewWindow* vw = dynamic_cast<Plot2d_ViewWindow*>(aViewWindow)) {
535 Plot2d_ViewFrame* vf = vw->getViewFrame();
536 QList<Plot2d_Curve> clist;
537 vf->getCurves(clist);
538 for (int i = 0; i < clist.count(); i++) {
539 if (SPlot2d_Curve* cu = dynamic_cast<SPlot2d_Curve*>(clist.at(i))) {
541 strcmp(cu->getIO()->getEntry(), myPrs->GetEntry()) == 0) {
547 //jfa tmp:aViewFrame->unHighlightAll();
555 void DeleteActors (VISU::Curve_i* thePrs)
558 ProcessVoidEvent(new TDeleteActorsEvent (thePrs));
560 /* // 1. Find appropriate application (code like in TNewViewManagerEvent::Execute())
561 SALOMEDS::Study_var myStudyDocument = thePrs->GetStudyDocument();
562 SalomeApp_Application* anApp = NULL;
563 CORBA::String_var studyName = myStudyDocument->Name();
564 std::string aStudyName = studyName.in();
565 SUIT_Session* aSession = SUIT_Session::session();
566 QPtrList<SUIT_Application> anApplications = aSession->applications();
567 QPtrListIterator<SUIT_Application> anIter (anApplications);
568 while (SUIT_Application* aSUITApp = anIter.current()) {
570 if (SUIT_Study* aSStudy = aSUITApp->activeStudy()) {
571 if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
572 if (_PTR(Study) aCStudy = aStudy->studyDS()) {
573 if (aStudyName == aCStudy->Name()) {
574 anApp = dynamic_cast<SalomeApp_Application*>(aSUITApp);
584 // 2. Remove corresponding IO from selection
585 SALOMEDS::SObject_var aSObject = thePrs->GetSObject();
586 CORBA::String_var anEntry = aSObject->GetID();
588 LightApp_SelectionMgr* aSelectionMgr = anApp->selectionMgr();
589 SALOME_ListIO aListIO, aNewListIO;
590 aSelectionMgr->selectedObjects(aListIO);
592 for (SALOME_ListIteratorOfListIO it (aListIO); it.More(); it.Next()) {
593 if (it.Value()->hasEntry()) {
594 std::string aCurEntry (it.Value()->getEntry());
595 if (aCurEntry != std::string( anEntry.in() ) ) {
596 aNewListIO.Append(it.Value());
601 aSelectionMgr->setSelectedObjects(aNewListIO);
604 ViewManagerList aViewManagerList;
605 anApp->viewManagers(SVTK_Viewer::Type(), aViewManagerList);
606 QPtrListIterator<SUIT_ViewManager> anVMIter (aViewManagerList);
607 for (; anVMIter.current(); ++anVMIter) {
608 SUIT_ViewManager* aViewManager = anVMIter.current();
609 QPtrVector<SUIT_ViewWindow> aViews = aViewManager->getViews();
610 for (int i = 0, iEnd = aViews.size(); i < iEnd; i++) {
611 if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) {
612 if (Plot2d_ViewWindow* vw = dynamic_cast<Plot2d_ViewWindow*>(aViewWindow)) {
613 Plot2d_ViewFrame* vf = vw->getViewFrame();
614 QList<Plot2d_Curve> clist;
615 vf->getCurves(clist);
616 for (int i = 0; i < clist.count(); i++) {
617 if (SPlot2d_Curve* cu = dynamic_cast<SPlot2d_Curve*>(clist.at(i))) {
619 strcmp(cu->getIO()->getEntry(), thePrs->GetEntry()) == 0) {
625 //jfa tmp:aViewFrame->unHighlightAll();
632 void DeleteActors (VISU::Prs3d_i* thePrs)
636 // 1. Find appropriate application (code like in TNewViewManagerEvent::Execute())
637 SALOMEDS::Study_var myStudyDocument = thePrs->GetStudyDocument();
638 SalomeApp_Application* anApp = NULL;
639 CORBA::String_var studyName = myStudyDocument->Name();
640 std::string aStudyName = studyName.in();
641 SUIT_Session* aSession = SUIT_Session::session();
642 QPtrList<SUIT_Application> anApplications = aSession->applications();
643 QPtrListIterator<SUIT_Application> anIter (anApplications);
644 while (SUIT_Application* aSUITApp = anIter.current()) {
646 if (SUIT_Study* aSStudy = aSUITApp->activeStudy()) {
647 if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
648 if (_PTR(Study) aCStudy = aStudy->studyDS()) {
649 if (aStudyName == aCStudy->Name()) {
650 anApp = dynamic_cast<SalomeApp_Application*>(aSUITApp);
660 // 2. Remove corresponding IO from selection
661 SALOMEDS::SObject_var aSObject = thePrs->GetSObject();
662 CORBA::String_var anEntry = aSObject->GetID();
664 LightApp_SelectionMgr* aSelectionMgr = anApp->selectionMgr();
665 SALOME_ListIO aListIO, aNewListIO;
666 aSelectionMgr->selectedObjects(aListIO);
668 for (SALOME_ListIteratorOfListIO it (aListIO); it.More(); it.Next()) {
669 if (it.Value()->hasEntry()) {
670 std::string aCurEntry (it.Value()->getEntry());
671 if (aCurEntry != std::string( anEntry.in() ) ) {
672 aNewListIO.Append(it.Value());
677 aSelectionMgr->setSelectedObjects(aNewListIO);
680 ViewManagerList aViewManagerList;
681 anApp->viewManagers(SVTK_Viewer::Type(), aViewManagerList);
682 QPtrListIterator<SUIT_ViewManager> anVMIter (aViewManagerList);
683 for (; anVMIter.current(); ++anVMIter) {
684 SUIT_ViewManager* aViewManager = anVMIter.current();
685 QPtrVector<SUIT_ViewWindow> aViews = aViewManager->getViews();
686 for (int i = 0, iEnd = aViews.size(); i < iEnd; i++) {
687 if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) {
688 if (SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(aViewWindow)) {
689 VISU_Actor* anActor = NULL;
690 vtkActorCollection *anActColl = vw->getRenderer()->GetActors();
691 anActColl->InitTraversal();
692 vtkActor *aVTKActor = anActColl->GetNextActor();
693 for (; !anActor && aVTKActor; aVTKActor = anActColl->GetNextActor()) {
694 if (VISU_Actor* anVISUActor = dynamic_cast<VISU_Actor*>(aVTKActor)) {
695 if (thePrs == anVISUActor->GetPrs3d()) {
696 anActor = anVISUActor->GetParent();
701 vw->RemoveActor(anActor);