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.salome-platform.org/ or email : webmaster.salome@opencascade.com
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_ViewWindow.h"
40 #include "SVTK_ViewModel.h"
41 #include "SPlot2d_Curve.h"
42 #include "Plot2d_ViewFrame.h"
43 #include "Plot2d_ViewWindow.h"
44 #include "Plot2d_ViewModel.h"
46 #include "SalomeApp_Study.h"
47 #include "SalomeApp_Application.h"
48 #include "LightApp_SelectionMgr.h"
50 #include "SALOME_Event.hxx"
51 #include "SALOME_ListIO.hxx"
52 #include "SALOME_ListIteratorOfListIO.hxx"
54 #include <vtkCamera.h>
55 #include <vtkRenderer.h>
56 #include <vtkRenderWindow.h>
58 #include <qapplication.h>
63 static int MYDEBUG = 1;
65 static int MYDEBUG = 0;
70 struct TNewViewManagerEvent: public SALOME_Event
73 typedef SalomeApp_Application* TResult;
76 TNewViewManagerEvent (const int theStudyId):
77 myStudyId(theStudyId),
85 MESSAGE("Find application for study with id = : " << myStudyId);
86 SUIT_Session* aSession = SUIT_Session::session();
87 QPtrList<SUIT_Application> anApplications = aSession->applications();
88 QPtrListIterator<SUIT_Application> anIter (anApplications);
89 while (SUIT_Application* anApp = anIter.current()) {
91 if (SUIT_Study* aSStudy = anApp->activeStudy()) {
92 if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
93 if (_PTR(Study) aCStudy = aStudy->studyDS()) {
94 //if (myStudyName == aCStudy->Name()) {
95 if (myStudyId == aCStudy->StudyId()) {
96 myResult = dynamic_cast<SalomeApp_Application*>(anApp);
104 //MESSAGE("Error: application is not found for study : " << myStudyName);
105 MESSAGE("Error: application is not found for study with id = : " << myStudyId);
110 //===========================================================================
111 ViewManager_i::ViewManager_i(SALOMEDS::Study_ptr theStudy)
113 if(MYDEBUG) MESSAGE("ViewManager_i::ViewManager_i - "<<this);
115 //CORBA::String_var aStudyName = theStudy->Name();
116 //myApplication = ProcessEvent(new TNewViewManagerEvent(aStudyName.in()));
117 int aStudyID = theStudy->StudyId();
118 myApplication = ProcessEvent(new TNewViewManagerEvent(aStudyID));
122 ViewManager_i::~ViewManager_i()
124 if(MYDEBUG) MESSAGE("ViewManager_i::~ViewManager_i - "<<this);
128 struct TCurrentViewEvent: public SALOME_Event
130 SalomeApp_Application* myApplication;
131 typedef VISU::View_ptr TResult;
134 TCurrentViewEvent(SalomeApp_Application* theApplication):
135 myApplication(theApplication),
136 myResult(VISU::View::_nil())
143 VISU::View3D_i* aView = new View3D_i (myApplication);
144 if (aView->Create(0))
145 myResult = aView->_this();
149 VISU::View_ptr ViewManager_i::GetCurrentView(){
150 return ProcessEvent(new TCurrentViewEvent(myApplication));
154 template<class TViewFrame>
155 struct TCreateViewFrameEvent: public SALOME_Event
157 SalomeApp_Application* myApplication;
158 typedef typename TViewFrame::TInterface TInterface;
159 typedef typename TInterface::_ptr_type TResult;
162 TCreateViewFrameEvent (SalomeApp_Application* theApplication):
163 myApplication(theApplication),
164 myResult(TInterface::_nil())
171 //if (CheckStudy(myStudyDocument)) {
173 TViewFrame* pView = new TViewFrame (myApplication);
174 if (pView->Create(1)) {
175 myResult = pView->_this();
176 qApp->processEvents(); // Fix for bug 9929
183 VISU::View3D_ptr ViewManager_i::Create3DView()
185 if (MYDEBUG) MESSAGE("ViewManager_i::Create3DView");
186 return ProcessEvent(new TCreateViewFrameEvent<View3D_i>(myApplication));
189 VISU::XYPlot_ptr ViewManager_i::CreateXYPlot()
191 if (MYDEBUG) MESSAGE("ViewManager_i::CreateXYPlot");
192 return ProcessEvent(new TCreateViewFrameEvent<XYPlot_i>(myApplication));
195 class TCreateViewEvent: public SALOME_Event
198 TCreateViewEvent (SalomeApp_Application* theApplication)
199 : myApplication(theApplication)
202 SalomeApp_Application* myApplication;
205 class TCreateTableViewFrameEvent: public TCreateViewEvent
209 TCreateTableViewFrameEvent (SalomeApp_Application* theApplication,
211 TCreateViewEvent(theApplication),
213 myResult(VISU::TableView::_nil())
216 virtual void Execute()
218 //if (CheckStudy(myStudyDocument)) {
219 VISU::TableView_i* pView = new TableView_i (myApplication);
220 if (pView->Create(myTable) != NULL)
221 myResult = pView->_this();
224 typedef VISU::TableView_ptr TResult;
228 VISU::TableView_ptr ViewManager_i::CreateTableView (VISU::Table_ptr theTable)
230 if (MYDEBUG) MESSAGE("ViewManager_i::CreateTableView");
231 //return ProcessEvent(new TCreateViewFrameEvent<TableView_i>(myApplication));
232 return ProcessEvent(new TCreateTableViewFrameEvent (myApplication, theTable));
235 void ViewManager_i::Destroy (View_ptr theView)
237 class TEvent: public SALOME_Event {
240 TEvent(View_ptr theView):
243 virtual void Execute(){
244 if (!CORBA::is_nil(myView)) {
245 if (VISU::View_i* pView = dynamic_cast<VISU::View_i*>(VISU::GetServant(myView).in())) {
247 pView->_remove_ref();
253 if (MYDEBUG) MESSAGE("ViewManager_i::Destroy - " << theView->_is_nil());
254 ProcessVoidEvent(new TEvent(theView));
257 //===========================================================================
258 // VISU namespace functions
259 //===========================================================================
260 vtkRenderer* GetRenderer (SUIT_ViewWindow* theViewWindow)
262 if (SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(theViewWindow))
263 return vw->getRenderer();
267 vtkCamera* GetCamera (SUIT_ViewWindow* theViewWindow)
269 return GetRenderer(theViewWindow)->GetActiveCamera();
272 void RepaintView (SUIT_ViewWindow* theViewWindow)
274 if (SVTK_ViewWindow* vf = dynamic_cast<SVTK_ViewWindow*>(theViewWindow)) {
275 vf->getRenderer()->ResetCameraClippingRange();
276 vf->getRenderWindow()->Render();
280 VISU_Actor* UpdateViewer (SUIT_ViewWindow* theViewWindow, int theDisplaing, Prs3d_i* thePrs)
282 SVTK_ViewWindow* vf = dynamic_cast<SVTK_ViewWindow*>(theViewWindow);
283 if (!vf) return NULL;
284 if(MYDEBUG) MESSAGE("UpdateViewer - theDisplaing = "<<theDisplaing<<"; thePrs = "<<thePrs);
285 vtkRenderer *aRen = vf->getRenderer();
286 vtkActorCollection *anActColl = aRen->GetActors();
288 VISU_Actor *anVISUActor = NULL, *aResActor = NULL;
289 for(anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL;){
290 if(anActor->IsA("VISU_Actor")){
291 anVISUActor = VISU_Actor::SafeDownCast(anActor);
292 if (thePrs == anVISUActor->GetPrs3d()) {
293 aResActor = anVISUActor;
294 if(theDisplaing < eErase)
295 aResActor->VisibilityOn();
297 aResActor->VisibilityOff();
299 if(theDisplaing > eDisplay)
300 anVISUActor->VisibilityOff();
302 anVISUActor->VisibilityOn();
307 RepaintView(theViewWindow);
310 if(thePrs != NULL && theDisplaing < eErase){
312 anVISUActor = thePrs->CreateActor();
313 vf->AddActor(anVISUActor);
314 }catch(std::exception& exc){
315 if(MYDEBUG) INFOS(exc.what());
318 if(MYDEBUG) INFOS("Unknown exception was occured!!!");
322 RepaintView(theViewWindow);
326 void UpdatePlot2d (Plot2d_ViewFrame *theView,int theDisplaying, Curve_i* theCurve)
328 if(MYDEBUG) MESSAGE("UpdatePlot2d - theDisplaying = " << theDisplaying);
331 QList<Plot2d_Curve> clist;
332 theView->getCurves(clist);
333 if (theDisplaying == eEraseAll) {
334 for (int i = 0; i < clist.count(); i++) {
335 if(MYDEBUG) MESSAGE("UpdatePlot2d - erasing all : curve - " << clist.at(i));
336 theView->eraseCurve(clist.at(i));
338 } else if (theDisplaying == eErase) {
340 for (int i = 0; i < clist.count(); i++) {
341 SPlot2d_Curve* aSPlot2dC = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
342 if (aSPlot2dC->hasIO() &&
343 !strcmp(aSPlot2dC->getIO()->getEntry(), theCurve->GetEntry())) {
344 if(MYDEBUG) MESSAGE("UpdatePlot2d - erasing : curve - " << aSPlot2dC);
345 theView->eraseCurve(aSPlot2dC);
349 } else if (theDisplaying == eDisplay) {
352 for (int i = 0; i < clist.count(); i++) {
353 SPlot2d_Curve* aSPlot2dC = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
354 if (aSPlot2dC->hasIO() &&
355 !strcmp(aSPlot2dC->getIO()->getEntry(), theCurve->GetEntry())) {
356 if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying : curve - " << aSPlot2dC);
357 aSPlot2dC->setHorTitle( theCurve->GetHorTitle().c_str() );
358 aSPlot2dC->setVerTitle( theCurve->GetVerTitle().c_str() );
359 aSPlot2dC->setHorUnits( theCurve->GetHorUnits().c_str() );
360 aSPlot2dC->setVerUnits( theCurve->GetVerUnits().c_str() );
363 int nbPoints = theCurve->GetData( xList, yList );
364 if (nbPoints > 0 && xList && yList) {
365 aSPlot2dC->setData( xList, yList, nbPoints );
367 if (!theCurve->IsAuto()) {
368 aSPlot2dC->setLine((Plot2d_Curve::LineType)theCurve->GetLine(),
369 theCurve->GetLineWidth());
370 aSPlot2dC->setMarker((Plot2d_Curve::MarkerType)theCurve->GetMarker());
371 SALOMEDS::Color color = theCurve->GetColor();
372 aSPlot2dC->setColor(QColor((int)(color.R*255.),
374 (int)(color.B*255.)));
376 aSPlot2dC->setAutoAssign(theCurve->IsAuto());
377 theView->displayCurve(aSPlot2dC);
382 Plot2d_Curve* crv = theCurve->CreatePresentation();
383 if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying : curve (new) - "<<crv );
385 theView->displayCurve( crv );
386 theCurve->SetLine( (VISU::Curve::LineType)crv->getLine(), crv->getLineWidth() );
387 theCurve->SetMarker( (VISU::Curve::MarkerType)crv->getMarker());
388 SALOMEDS::Color newColor;
389 newColor.R = crv->getColor().red()/255.;
390 newColor.G = crv->getColor().green()/255.;
391 newColor.B = crv->getColor().blue()/255.;
392 theCurve->SetColor( newColor );
393 crv->setAutoAssign( theCurve->IsAuto() );
397 } else if (theDisplaying == eDisplayOnly) {
400 for (int i = 0; i < clist.count(); i++) {
401 SPlot2d_Curve* aSPlot2dC = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
402 if (aSPlot2dC->hasIO() &&
403 !strcmp(aSPlot2dC->getIO()->getEntry(), theCurve->GetEntry())) {
404 if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying only : curve - " << aSPlot2dC);
405 aSPlot2dC->setHorTitle( theCurve->GetHorTitle().c_str() );
406 aSPlot2dC->setVerTitle( theCurve->GetVerTitle().c_str() );
407 aSPlot2dC->setHorUnits( theCurve->GetHorUnits().c_str() );
408 aSPlot2dC->setVerUnits( theCurve->GetVerUnits().c_str() );
411 int nbPoints = theCurve->GetData( xList, yList );
412 if ( nbPoints > 0 && xList && yList ) {
413 aSPlot2dC->setData( xList, yList, nbPoints );
415 if ( !theCurve->IsAuto() ) {
416 aSPlot2dC->setLine((Plot2d_Curve::LineType)theCurve->GetLine(), theCurve->GetLineWidth());
417 aSPlot2dC->setMarker((Plot2d_Curve::MarkerType)theCurve->GetMarker());
418 SALOMEDS::Color color = theCurve->GetColor();
419 aSPlot2dC->setColor(QColor((int)(color.R*255.), (int)(color.G*255.), (int)(color.B*255.)));
421 aSPlot2dC->setAutoAssign(theCurve->IsAuto());
422 theView->displayCurve(aSPlot2dC);
425 theView->eraseCurve(aSPlot2dC);
429 Plot2d_Curve* crv = theCurve->CreatePresentation();
430 if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying only : curve (new) - " << crv);
432 theView->displayCurve(crv);
433 theCurve->SetLine((VISU::Curve::LineType)crv->getLine(), crv->getLineWidth());
434 theCurve->SetMarker((VISU::Curve::MarkerType)crv->getMarker());
435 SALOMEDS::Color newColor;
436 newColor.R = crv->getColor().red()/255.;
437 newColor.G = crv->getColor().green()/255.;
438 newColor.B = crv->getColor().blue()/255.;
439 theCurve->SetColor(newColor);
440 crv->setAutoAssign(theCurve->IsAuto());
447 VISU_Actor* GetActor (VISU::Prs3d_i* thePrs3d, SVTK_ViewWindow* theVTKFrame)
449 vtkActorCollection *anActColl = theVTKFrame->getRenderer()->GetActors();
450 anActColl->InitTraversal();
451 while (vtkActor *anActor = anActColl->GetNextActor())
452 if (VISU_Actor* anVISUActor = dynamic_cast<VISU_Actor*>(anActor))
453 if (thePrs3d == anVISUActor->GetPrs3d())
458 struct TDeleteActorsEvent: public SALOME_Event
460 VISU::Curve_i* myPrs;
462 TDeleteActorsEvent (VISU::Curve_i* thePrs):
472 // 1. Find appropriate application (code like in TNewViewManagerEvent::Execute())
473 SALOMEDS::Study_var myStudyDocument = myPrs->GetStudyDocument();
474 SalomeApp_Application* anApp = NULL;
475 CORBA::String_var studyName = myStudyDocument->Name();
476 std::string aStudyName = studyName.in();
477 SUIT_Session* aSession = SUIT_Session::session();
478 QPtrList<SUIT_Application> anApplications = aSession->applications();
479 QPtrListIterator<SUIT_Application> anIter (anApplications);
480 while (SUIT_Application* aSUITApp = anIter.current()) {
482 if (SUIT_Study* aSStudy = aSUITApp->activeStudy()) {
483 if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
484 if (_PTR(Study) aCStudy = aStudy->studyDS()) {
485 if (aStudyName == aCStudy->Name()) {
486 anApp = dynamic_cast<SalomeApp_Application*>(aSUITApp);
496 // 2. Remove corresponding IO from selection
497 SALOMEDS::SObject_var aSObject = myPrs->GetSObject();
498 CORBA::String_var anEntry = aSObject->GetID();
500 LightApp_SelectionMgr* aSelectionMgr = anApp->selectionMgr();
501 SALOME_ListIO aListIO, aNewListIO;
502 aSelectionMgr->selectedObjects(aListIO);
504 for (SALOME_ListIteratorOfListIO it (aListIO); it.More(); it.Next()) {
505 if (it.Value()->hasEntry()) {
506 std::string aCurEntry (it.Value()->getEntry());
507 if (aCurEntry != std::string( anEntry.in() ) ) {
508 aNewListIO.Append(it.Value());
513 aSelectionMgr->setSelectedObjects(aNewListIO);
516 ViewManagerList aViewManagerList;
517 anApp->viewManagers(SVTK_Viewer::Type(), aViewManagerList);
518 QPtrListIterator<SUIT_ViewManager> anVMIter (aViewManagerList);
519 for (; anVMIter.current(); ++anVMIter) {
520 SUIT_ViewManager* aViewManager = anVMIter.current();
521 QPtrVector<SUIT_ViewWindow> aViews = aViewManager->getViews();
522 for (int i = 0, iEnd = aViews.size(); i < iEnd; i++) {
523 if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) {
524 if (Plot2d_ViewWindow* vw = dynamic_cast<Plot2d_ViewWindow*>(aViewWindow)) {
525 Plot2d_ViewFrame* vf = vw->getViewFrame();
526 QList<Plot2d_Curve> clist;
527 vf->getCurves(clist);
528 for (int i = 0; i < clist.count(); i++) {
529 if (SPlot2d_Curve* cu = dynamic_cast<SPlot2d_Curve*>(clist.at(i))) {
531 strcmp(cu->getIO()->getEntry(), myPrs->GetEntry()) == 0) {
537 //jfa tmp:aViewFrame->unHighlightAll();
545 void DeleteActors (VISU::Curve_i* thePrs)
548 ProcessVoidEvent(new TDeleteActorsEvent (thePrs));
550 /* // 1. Find appropriate application (code like in TNewViewManagerEvent::Execute())
551 SALOMEDS::Study_var myStudyDocument = thePrs->GetStudyDocument();
552 SalomeApp_Application* anApp = NULL;
553 CORBA::String_var studyName = myStudyDocument->Name();
554 std::string aStudyName = studyName.in();
555 SUIT_Session* aSession = SUIT_Session::session();
556 QPtrList<SUIT_Application> anApplications = aSession->applications();
557 QPtrListIterator<SUIT_Application> anIter (anApplications);
558 while (SUIT_Application* aSUITApp = anIter.current()) {
560 if (SUIT_Study* aSStudy = aSUITApp->activeStudy()) {
561 if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
562 if (_PTR(Study) aCStudy = aStudy->studyDS()) {
563 if (aStudyName == aCStudy->Name()) {
564 anApp = dynamic_cast<SalomeApp_Application*>(aSUITApp);
574 // 2. Remove corresponding IO from selection
575 SALOMEDS::SObject_var aSObject = thePrs->GetSObject();
576 CORBA::String_var anEntry = aSObject->GetID();
578 LightApp_SelectionMgr* aSelectionMgr = anApp->selectionMgr();
579 SALOME_ListIO aListIO, aNewListIO;
580 aSelectionMgr->selectedObjects(aListIO);
582 for (SALOME_ListIteratorOfListIO it (aListIO); it.More(); it.Next()) {
583 if (it.Value()->hasEntry()) {
584 std::string aCurEntry (it.Value()->getEntry());
585 if (aCurEntry != std::string( anEntry.in() ) ) {
586 aNewListIO.Append(it.Value());
591 aSelectionMgr->setSelectedObjects(aNewListIO);
594 ViewManagerList aViewManagerList;
595 anApp->viewManagers(SVTK_Viewer::Type(), aViewManagerList);
596 QPtrListIterator<SUIT_ViewManager> anVMIter (aViewManagerList);
597 for (; anVMIter.current(); ++anVMIter) {
598 SUIT_ViewManager* aViewManager = anVMIter.current();
599 QPtrVector<SUIT_ViewWindow> aViews = aViewManager->getViews();
600 for (int i = 0, iEnd = aViews.size(); i < iEnd; i++) {
601 if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) {
602 if (Plot2d_ViewWindow* vw = dynamic_cast<Plot2d_ViewWindow*>(aViewWindow)) {
603 Plot2d_ViewFrame* vf = vw->getViewFrame();
604 QList<Plot2d_Curve> clist;
605 vf->getCurves(clist);
606 for (int i = 0; i < clist.count(); i++) {
607 if (SPlot2d_Curve* cu = dynamic_cast<SPlot2d_Curve*>(clist.at(i))) {
609 strcmp(cu->getIO()->getEntry(), thePrs->GetEntry()) == 0) {
615 //jfa tmp:aViewFrame->unHighlightAll();
622 void DeleteActors (VISU::Prs3d_i* thePrs)
626 // 1. Find appropriate application (code like in TNewViewManagerEvent::Execute())
627 SALOMEDS::Study_var myStudyDocument = thePrs->GetStudyDocument();
628 SalomeApp_Application* anApp = NULL;
629 CORBA::String_var studyName = myStudyDocument->Name();
630 std::string aStudyName = studyName.in();
631 SUIT_Session* aSession = SUIT_Session::session();
632 QPtrList<SUIT_Application> anApplications = aSession->applications();
633 QPtrListIterator<SUIT_Application> anIter (anApplications);
634 while (SUIT_Application* aSUITApp = anIter.current()) {
636 if (SUIT_Study* aSStudy = aSUITApp->activeStudy()) {
637 if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
638 if (_PTR(Study) aCStudy = aStudy->studyDS()) {
639 if (aStudyName == aCStudy->Name()) {
640 anApp = dynamic_cast<SalomeApp_Application*>(aSUITApp);
650 // 2. Remove corresponding IO from selection
651 SALOMEDS::SObject_var aSObject = thePrs->GetSObject();
652 CORBA::String_var anEntry = aSObject->GetID();
654 LightApp_SelectionMgr* aSelectionMgr = anApp->selectionMgr();
655 SALOME_ListIO aListIO, aNewListIO;
656 aSelectionMgr->selectedObjects(aListIO);
658 for (SALOME_ListIteratorOfListIO it (aListIO); it.More(); it.Next()) {
659 if (it.Value()->hasEntry()) {
660 std::string aCurEntry (it.Value()->getEntry());
661 if (aCurEntry != std::string( anEntry.in() ) ) {
662 aNewListIO.Append(it.Value());
667 aSelectionMgr->setSelectedObjects(aNewListIO);
670 ViewManagerList aViewManagerList;
671 anApp->viewManagers(SVTK_Viewer::Type(), aViewManagerList);
672 QPtrListIterator<SUIT_ViewManager> anVMIter (aViewManagerList);
673 for (; anVMIter.current(); ++anVMIter) {
674 SUIT_ViewManager* aViewManager = anVMIter.current();
675 QPtrVector<SUIT_ViewWindow> aViews = aViewManager->getViews();
676 for (int i = 0, iEnd = aViews.size(); i < iEnd; i++) {
677 if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) {
678 if (SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(aViewWindow)) {
679 VISU_Actor* anActor = NULL;
680 vtkActorCollection *anActColl = vw->getRenderer()->GetActors();
681 anActColl->InitTraversal();
682 vtkActor *aVTKActor = anActColl->GetNextActor();
683 for (; !anActor && aVTKActor; aVTKActor = anActColl->GetNextActor()) {
684 if (VISU_Actor* anVISUActor = dynamic_cast<VISU_Actor*>(aVTKActor)) {
685 if (thePrs == anVISUActor->GetPrs3d()) {
686 anActor = anVISUActor;
691 vw->RemoveActor(anActor);