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 "SalomeApp_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>
62 static int MYDEBUG = 1;
64 static int MYDEBUG = 0;
69 struct TNewViewManagerEvent: public SALOME_Event
72 typedef SalomeApp_Application* TResult;
75 TNewViewManagerEvent (const int theStudyId):
76 myStudyId(theStudyId),
84 MESSAGE("Find application for study with id = : " << myStudyId);
85 SUIT_Session* aSession = SUIT_Session::session();
86 QPtrList<SUIT_Application> anApplications = aSession->applications();
87 QPtrListIterator<SUIT_Application> anIter (anApplications);
88 while (SUIT_Application* anApp = anIter.current()) {
90 if (SUIT_Study* aSStudy = anApp->activeStudy()) {
91 if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
92 if (_PTR(Study) aCStudy = aStudy->studyDS()) {
93 //if (myStudyName == aCStudy->Name()) {
94 if (myStudyId == aCStudy->StudyId()) {
95 myResult = dynamic_cast<SalomeApp_Application*>(anApp);
103 //MESSAGE("Error: application is not found for study : " << myStudyName);
104 MESSAGE("Error: application is not found for study with id = : " << myStudyId);
109 //===========================================================================
110 ViewManager_i::ViewManager_i(SALOMEDS::Study_ptr theStudy)
112 if(MYDEBUG) MESSAGE("ViewManager_i::ViewManager_i - "<<this);
114 //CORBA::String_var aStudyName = theStudy->Name();
115 //myApplication = ProcessEvent(new TNewViewManagerEvent(aStudyName.in()));
116 int aStudyID = theStudy->StudyId();
117 myApplication = ProcessEvent(new TNewViewManagerEvent(aStudyID));
121 ViewManager_i::~ViewManager_i()
123 if(MYDEBUG) MESSAGE("ViewManager_i::~ViewManager_i - "<<this);
127 struct TCurrentViewEvent: public SALOME_Event
129 const SalomeApp_Application* myApplication;
130 typedef VISU::View_ptr TResult;
133 TCurrentViewEvent(const SalomeApp_Application* theApplication):
134 myApplication(theApplication),
135 myResult(VISU::View::_nil())
142 //if (SUIT_ViewManager *aViewManager = myApplication->activeViewManager()) {
143 // if (aViewManager->getType() == "VTKViewer") {
144 // if (SUIT_ViewWindow *aViewWindow = aViewManager->getActiveView()) {
145 VISU::View3D_i* pView =
146 new View3D_i ((SalomeApp_Application*)myApplication);
147 if (pView->Create(0))
148 myResult = pView->_this();
155 VISU::View_ptr ViewManager_i::GetCurrentView(){
156 return ProcessEvent(new TCurrentViewEvent(myApplication));
160 template<class TViewFrame>
161 struct TCreateViewFrameEvent: public SALOME_Event
163 SalomeApp_Application* myApplication;
164 typedef typename TViewFrame::TInterface TInterface;
165 typedef typename TInterface::_ptr_type TResult;
168 TCreateViewFrameEvent (SalomeApp_Application* theApplication):
169 myApplication(theApplication),
170 myResult(TInterface::_nil())
177 //if (CheckStudy(myStudyDocument)) {
179 TViewFrame* pView = new TViewFrame (myApplication);
180 if (pView->Create(1))
181 myResult = pView->_this();
187 VISU::View3D_ptr ViewManager_i::Create3DView()
189 if (MYDEBUG) MESSAGE("ViewManager_i::Create3DView");
190 return ProcessEvent(new TCreateViewFrameEvent<View3D_i>(myApplication));
193 VISU::XYPlot_ptr ViewManager_i::CreateXYPlot()
195 if (MYDEBUG) MESSAGE("ViewManager_i::CreateXYPlot");
196 return ProcessEvent(new TCreateViewFrameEvent<XYPlot_i>(myApplication));
199 class TCreateViewEvent: public SALOME_Event
202 TCreateViewEvent (SalomeApp_Application* theApplication)
203 : myApplication(theApplication)
206 SalomeApp_Application* myApplication;
209 class TCreateTableViewFrameEvent: public TCreateViewEvent
213 TCreateTableViewFrameEvent (SalomeApp_Application* theApplication,
215 TCreateViewEvent(theApplication),
217 myResult(VISU::TableView::_nil())
220 virtual void Execute()
222 //if (CheckStudy(myStudyDocument)) {
223 VISU::TableView_i* pView = new TableView_i (myApplication);
224 if (pView->Create(myTable) != NULL)
225 myResult = pView->_this();
228 typedef VISU::TableView_ptr TResult;
232 VISU::TableView_ptr ViewManager_i::CreateTableView (VISU::Table_ptr theTable)
234 if (MYDEBUG) MESSAGE("ViewManager_i::CreateTableView");
235 //return ProcessEvent(new TCreateViewFrameEvent<TableView_i>(myApplication));
236 return ProcessEvent(new TCreateTableViewFrameEvent (myApplication, theTable));
239 void ViewManager_i::Destroy (View_ptr theView)
241 class TEvent: public SALOME_Event {
244 TEvent(View_ptr theView):
247 virtual void Execute(){
248 if (!CORBA::is_nil(myView)) {
249 if (VISU::View_i* pView = dynamic_cast<VISU::View_i*>(VISU::GetServant(myView).in())) {
251 pView->_remove_ref();
257 if (MYDEBUG) MESSAGE("ViewManager_i::Destroy - " << theView->_is_nil());
258 ProcessVoidEvent(new TEvent(theView));
261 //===========================================================================
262 // VISU namespace functions
263 //===========================================================================
264 SVTK_ViewWindow* GetViewWindow (SUIT_ViewWindow* theStudyFrame)
266 return dynamic_cast<SVTK_ViewWindow*>(theStudyFrame);
269 vtkRenderer* GetRenderer (SUIT_ViewWindow* theStudyFrame)
271 return GetViewWindow(theStudyFrame)->getRenderer();
274 vtkCamera* GetCamera (SUIT_ViewWindow* theStudyFrame)
276 return GetRenderer(theStudyFrame)->GetActiveCamera();
279 void RepaintView (SUIT_ViewWindow* theViewWindow)
281 SVTK_ViewWindow* vf = GetViewWindow(theViewWindow);
282 vf->getRenderer()->ResetCameraClippingRange();
283 vf->getRenderWindow()->getRenderWindow()->Render();
286 VISU_Actor* UpdateViewer (SUIT_ViewWindow* theStudyFrame, int theDisplaing, Prs3d_i* thePrs)
288 SVTK_ViewWindow* vf = GetViewWindow(theStudyFrame);
289 if (!vf) return NULL;
290 if(MYDEBUG) MESSAGE("UpdateViewer - theDisplaing = "<<theDisplaing<<"; thePrs = "<<thePrs);
291 vtkRenderer *aRen = vf->getRenderer();
292 vtkActorCollection *anActColl = aRen->GetActors();
294 VISU_Actor *anVISUActor = NULL, *aResActor = NULL;
295 for(anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL;){
296 if(anActor->IsA("VISU_Actor")){
297 anVISUActor = VISU_Actor::SafeDownCast(anActor);
298 if (thePrs == anVISUActor->GetPrs3d()) {
299 aResActor = anVISUActor->GetParent();
300 if(theDisplaing < eErase)
301 aResActor->VisibilityOn();
303 aResActor->VisibilityOff();
305 if(theDisplaing > eDisplay)
306 anVISUActor->VisibilityOff();
308 anVISUActor->VisibilityOn();
313 RepaintView(theStudyFrame);
316 if(thePrs != NULL && theDisplaing < eErase){
318 anVISUActor = thePrs->CreateActor();
319 vf->AddActor(anVISUActor);
320 }catch(std::exception& exc){
321 if(MYDEBUG) INFOS(exc.what());
324 if(MYDEBUG) INFOS("Unknown exception was occured!!!");
328 RepaintView(theStudyFrame);
332 void UpdatePlot2d (Plot2d_ViewFrame *theView,int theDisplaying, Curve_i* theCurve)
334 if(MYDEBUG) MESSAGE("UpdatePlot2d - theDisplaying = " << theDisplaying);
337 QList<Plot2d_Curve> clist;
338 theView->getCurves(clist);
339 if (theDisplaying == eEraseAll) {
340 for (int i = 0; i < clist.count(); i++) {
341 if(MYDEBUG) MESSAGE("UpdatePlot2d - erasing all : curve - " << clist.at(i));
342 theView->eraseCurve(clist.at(i));
344 } else if (theDisplaying == eErase) {
346 for (int i = 0; i < clist.count(); i++) {
347 SPlot2d_Curve* aSPlot2dC = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
348 if (aSPlot2dC->hasIO() &&
349 !strcmp(aSPlot2dC->getIO()->getEntry(), theCurve->GetEntry())) {
350 if(MYDEBUG) MESSAGE("UpdatePlot2d - erasing : curve - " << aSPlot2dC);
351 theView->eraseCurve(aSPlot2dC);
355 } else if (theDisplaying == eDisplay) {
358 for (int i = 0; i < clist.count(); i++) {
359 SPlot2d_Curve* aSPlot2dC = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
360 if (aSPlot2dC->hasIO() &&
361 !strcmp(aSPlot2dC->getIO()->getEntry(), theCurve->GetEntry())) {
362 if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying : curve - " << aSPlot2dC);
363 aSPlot2dC->setHorTitle( theCurve->GetHorTitle().c_str() );
364 aSPlot2dC->setVerTitle( theCurve->GetVerTitle().c_str() );
365 aSPlot2dC->setHorUnits( theCurve->GetHorUnits().c_str() );
366 aSPlot2dC->setVerUnits( theCurve->GetVerUnits().c_str() );
369 int nbPoints = theCurve->GetData( xList, yList );
370 if (nbPoints > 0 && xList && yList) {
371 aSPlot2dC->setData( xList, yList, nbPoints );
373 if (!theCurve->IsAuto()) {
374 aSPlot2dC->setLine((Plot2d_Curve::LineType)theCurve->GetLine(),
375 theCurve->GetLineWidth());
376 aSPlot2dC->setMarker((Plot2d_Curve::MarkerType)theCurve->GetMarker());
377 SALOMEDS::Color color = theCurve->GetColor();
378 aSPlot2dC->setColor(QColor((int)(color.R*255.),
380 (int)(color.B*255.)));
382 aSPlot2dC->setAutoAssign(theCurve->IsAuto());
383 theView->displayCurve(aSPlot2dC);
388 Plot2d_Curve* crv = theCurve->CreatePresentation();
389 if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying : curve (new) - "<<crv );
391 theView->displayCurve( crv );
392 theCurve->SetLine( (VISU::Curve::LineType)crv->getLine(), crv->getLineWidth() );
393 theCurve->SetMarker( (VISU::Curve::MarkerType)crv->getMarker());
394 SALOMEDS::Color newColor;
395 newColor.R = crv->getColor().red()/255.;
396 newColor.G = crv->getColor().green()/255.;
397 newColor.B = crv->getColor().blue()/255.;
398 theCurve->SetColor( newColor );
399 crv->setAutoAssign( theCurve->IsAuto() );
403 } else if (theDisplaying == eDisplayOnly) {
406 for (int i = 0; i < clist.count(); i++) {
407 SPlot2d_Curve* aSPlot2dC = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
408 if (aSPlot2dC->hasIO() &&
409 !strcmp(aSPlot2dC->getIO()->getEntry(), theCurve->GetEntry())) {
410 if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying only : curve - " << aSPlot2dC);
411 aSPlot2dC->setHorTitle( theCurve->GetHorTitle().c_str() );
412 aSPlot2dC->setVerTitle( theCurve->GetVerTitle().c_str() );
413 aSPlot2dC->setHorUnits( theCurve->GetHorUnits().c_str() );
414 aSPlot2dC->setVerUnits( theCurve->GetVerUnits().c_str() );
417 int nbPoints = theCurve->GetData( xList, yList );
418 if ( nbPoints > 0 && xList && yList ) {
419 aSPlot2dC->setData( xList, yList, nbPoints );
421 if ( !theCurve->IsAuto() ) {
422 aSPlot2dC->setLine((Plot2d_Curve::LineType)theCurve->GetLine(), theCurve->GetLineWidth());
423 aSPlot2dC->setMarker((Plot2d_Curve::MarkerType)theCurve->GetMarker());
424 SALOMEDS::Color color = theCurve->GetColor();
425 aSPlot2dC->setColor(QColor((int)(color.R*255.), (int)(color.G*255.), (int)(color.B*255.)));
427 aSPlot2dC->setAutoAssign(theCurve->IsAuto());
428 theView->displayCurve(aSPlot2dC);
431 theView->eraseCurve(aSPlot2dC);
435 Plot2d_Curve* crv = theCurve->CreatePresentation();
436 if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying only : curve (new) - " << crv);
438 theView->displayCurve(crv);
439 theCurve->SetLine((VISU::Curve::LineType)crv->getLine(), crv->getLineWidth());
440 theCurve->SetMarker((VISU::Curve::MarkerType)crv->getMarker());
441 SALOMEDS::Color newColor;
442 newColor.R = crv->getColor().red()/255.;
443 newColor.G = crv->getColor().green()/255.;
444 newColor.B = crv->getColor().blue()/255.;
445 theCurve->SetColor(newColor);
446 crv->setAutoAssign(theCurve->IsAuto());
453 VISU_Actor* GetActor (VISU::Prs3d_i* thePrs3d, SVTK_ViewWindow* theVTKFrame)
455 vtkActorCollection *anActColl = theVTKFrame->getRenderer()->GetActors();
456 anActColl->InitTraversal();
457 while (vtkActor *anActor = anActColl->GetNextActor())
458 if (VISU_Actor* anVISUActor = dynamic_cast<VISU_Actor*>(anActor))
459 if (thePrs3d == anVISUActor->GetPrs3d())
460 return anVISUActor->GetParent();
464 struct TDeleteActorsEvent: public SALOME_Event
466 VISU::Curve_i* myPrs;
468 TDeleteActorsEvent (VISU::Curve_i* thePrs):
478 // 1. Find appropriate application (code like in TNewViewManagerEvent::Execute())
479 SALOMEDS::Study_var myStudyDocument = myPrs->GetStudyDocument();
480 SalomeApp_Application* anApp = NULL;
481 CORBA::String_var studyName = myStudyDocument->Name();
482 std::string aStudyName = studyName.in();
483 SUIT_Session* aSession = SUIT_Session::session();
484 QPtrList<SUIT_Application> anApplications = aSession->applications();
485 QPtrListIterator<SUIT_Application> anIter (anApplications);
486 while (SUIT_Application* aSUITApp = anIter.current()) {
488 if (SUIT_Study* aSStudy = aSUITApp->activeStudy()) {
489 if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
490 if (_PTR(Study) aCStudy = aStudy->studyDS()) {
491 if (aStudyName == aCStudy->Name()) {
492 anApp = dynamic_cast<SalomeApp_Application*>(aSUITApp);
502 // 2. Remove corresponding IO from selection
503 SALOMEDS::SObject_var aSObject = myPrs->GetSObject();
504 CORBA::String_var anEntry = aSObject->GetID();
506 SalomeApp_SelectionMgr* aSelectionMgr = anApp->selectionMgr();
507 SALOME_ListIO aListIO, aNewListIO;
508 aSelectionMgr->selectedObjects(aListIO);
510 for (SALOME_ListIteratorOfListIO it (aListIO); it.More(); it.Next()) {
511 if (it.Value()->hasEntry()) {
512 std::string aCurEntry (it.Value()->getEntry());
513 if (aCurEntry != std::string( anEntry.in() ) ) {
514 aNewListIO.Append(it.Value());
519 aSelectionMgr->setSelectedObjects(aNewListIO);
522 ViewManagerList aViewManagerList;
523 anApp->viewManagers(SVTK_Viewer::Type(), aViewManagerList);
524 QPtrListIterator<SUIT_ViewManager> anVMIter (aViewManagerList);
525 for (; anVMIter.current(); ++anVMIter) {
526 SUIT_ViewManager* aViewManager = anVMIter.current();
527 QPtrVector<SUIT_ViewWindow> aViews = aViewManager->getViews();
528 for (int i = 0, iEnd = aViews.size(); i < iEnd; i++) {
529 if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) {
530 if (Plot2d_ViewWindow* vw = dynamic_cast<Plot2d_ViewWindow*>(aViewWindow)) {
531 Plot2d_ViewFrame* vf = vw->getViewFrame();
532 QList<Plot2d_Curve> clist;
533 vf->getCurves(clist);
534 for (int i = 0; i < clist.count(); i++) {
535 if (SPlot2d_Curve* cu = dynamic_cast<SPlot2d_Curve*>(clist.at(i))) {
537 strcmp(cu->getIO()->getEntry(), myPrs->GetEntry()) == 0) {
543 //jfa tmp:aViewFrame->unHighlightAll();
551 void DeleteActors (VISU::Curve_i* thePrs)
554 ProcessVoidEvent(new TDeleteActorsEvent (thePrs));
556 /* // 1. Find appropriate application (code like in TNewViewManagerEvent::Execute())
557 SALOMEDS::Study_var myStudyDocument = thePrs->GetStudyDocument();
558 SalomeApp_Application* anApp = NULL;
559 CORBA::String_var studyName = myStudyDocument->Name();
560 std::string aStudyName = studyName.in();
561 SUIT_Session* aSession = SUIT_Session::session();
562 QPtrList<SUIT_Application> anApplications = aSession->applications();
563 QPtrListIterator<SUIT_Application> anIter (anApplications);
564 while (SUIT_Application* aSUITApp = anIter.current()) {
566 if (SUIT_Study* aSStudy = aSUITApp->activeStudy()) {
567 if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
568 if (_PTR(Study) aCStudy = aStudy->studyDS()) {
569 if (aStudyName == aCStudy->Name()) {
570 anApp = dynamic_cast<SalomeApp_Application*>(aSUITApp);
580 // 2. Remove corresponding IO from selection
581 SALOMEDS::SObject_var aSObject = thePrs->GetSObject();
582 CORBA::String_var anEntry = aSObject->GetID();
584 SalomeApp_SelectionMgr* aSelectionMgr = anApp->selectionMgr();
585 SALOME_ListIO aListIO, aNewListIO;
586 aSelectionMgr->selectedObjects(aListIO);
588 for (SALOME_ListIteratorOfListIO it (aListIO); it.More(); it.Next()) {
589 if (it.Value()->hasEntry()) {
590 std::string aCurEntry (it.Value()->getEntry());
591 if (aCurEntry != std::string( anEntry.in() ) ) {
592 aNewListIO.Append(it.Value());
597 aSelectionMgr->setSelectedObjects(aNewListIO);
600 ViewManagerList aViewManagerList;
601 anApp->viewManagers(SVTK_Viewer::Type(), aViewManagerList);
602 QPtrListIterator<SUIT_ViewManager> anVMIter (aViewManagerList);
603 for (; anVMIter.current(); ++anVMIter) {
604 SUIT_ViewManager* aViewManager = anVMIter.current();
605 QPtrVector<SUIT_ViewWindow> aViews = aViewManager->getViews();
606 for (int i = 0, iEnd = aViews.size(); i < iEnd; i++) {
607 if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) {
608 if (Plot2d_ViewWindow* vw = dynamic_cast<Plot2d_ViewWindow*>(aViewWindow)) {
609 Plot2d_ViewFrame* vf = vw->getViewFrame();
610 QList<Plot2d_Curve> clist;
611 vf->getCurves(clist);
612 for (int i = 0; i < clist.count(); i++) {
613 if (SPlot2d_Curve* cu = dynamic_cast<SPlot2d_Curve*>(clist.at(i))) {
615 strcmp(cu->getIO()->getEntry(), thePrs->GetEntry()) == 0) {
621 //jfa tmp:aViewFrame->unHighlightAll();
628 void DeleteActors (VISU::Prs3d_i* thePrs)
632 // 1. Find appropriate application (code like in TNewViewManagerEvent::Execute())
633 SALOMEDS::Study_var myStudyDocument = thePrs->GetStudyDocument();
634 SalomeApp_Application* anApp = NULL;
635 CORBA::String_var studyName = myStudyDocument->Name();
636 std::string aStudyName = studyName.in();
637 SUIT_Session* aSession = SUIT_Session::session();
638 QPtrList<SUIT_Application> anApplications = aSession->applications();
639 QPtrListIterator<SUIT_Application> anIter (anApplications);
640 while (SUIT_Application* aSUITApp = anIter.current()) {
642 if (SUIT_Study* aSStudy = aSUITApp->activeStudy()) {
643 if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
644 if (_PTR(Study) aCStudy = aStudy->studyDS()) {
645 if (aStudyName == aCStudy->Name()) {
646 anApp = dynamic_cast<SalomeApp_Application*>(aSUITApp);
656 // 2. Remove corresponding IO from selection
657 SALOMEDS::SObject_var aSObject = thePrs->GetSObject();
658 CORBA::String_var anEntry = aSObject->GetID();
660 SalomeApp_SelectionMgr* aSelectionMgr = anApp->selectionMgr();
661 SALOME_ListIO aListIO, aNewListIO;
662 aSelectionMgr->selectedObjects(aListIO);
664 for (SALOME_ListIteratorOfListIO it (aListIO); it.More(); it.Next()) {
665 if (it.Value()->hasEntry()) {
666 std::string aCurEntry (it.Value()->getEntry());
667 if (aCurEntry != std::string( anEntry.in() ) ) {
668 aNewListIO.Append(it.Value());
673 aSelectionMgr->setSelectedObjects(aNewListIO);
676 ViewManagerList aViewManagerList;
677 anApp->viewManagers(SVTK_Viewer::Type(), aViewManagerList);
678 QPtrListIterator<SUIT_ViewManager> anVMIter (aViewManagerList);
679 for (; anVMIter.current(); ++anVMIter) {
680 SUIT_ViewManager* aViewManager = anVMIter.current();
681 QPtrVector<SUIT_ViewWindow> aViews = aViewManager->getViews();
682 for (int i = 0, iEnd = aViews.size(); i < iEnd; i++) {
683 if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) {
684 if (SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(aViewWindow)) {
685 VISU_Actor* anActor = NULL;
686 vtkActorCollection *anActColl = vw->getRenderer()->GetActors();
687 anActColl->InitTraversal();
688 vtkActor *aVTKActor = anActColl->GetNextActor();
689 for (; !anActor && aVTKActor; aVTKActor = anActColl->GetNextActor()) {
690 if (VISU_Actor* anVISUActor = dynamic_cast<VISU_Actor*>(aVTKActor)) {
691 if (thePrs == anVISUActor->GetPrs3d()) {
692 anActor = anVISUActor->GetParent();
697 vw->RemoveActor(anActor);