1 // Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 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
24 #include <QColorDialog>
27 #include <vtkCamera.h>
28 #include <vtkRenderer.h>
29 #include <vtkActorCollection.h>
31 //#include "SUIT_Session.h"
32 #include "SVTK_Selection.h"
33 #include "SVTK_ViewModel.h"
34 #include "SVTK_ViewWindow.h"
35 #include "SVTK_View.h"
36 //#include "SVTK_MainWindow.h"
39 #include "VTKViewer_Algorithm.h"
40 #include "VTKViewer_ViewModel.h"
42 #include "SUIT_ViewModel.h"
43 #include "SUIT_ViewManager.h"
45 #include "SALOME_Actor.h"
47 #include "QtxActionToolMgr.h"
48 #include "QtxBackgroundTool.h"
50 // VSR: Uncomment below line to allow texture background support in VTK viewer
51 #define VTK_ENABLE_TEXTURED_BACKGROUND
54 // in order NOT TO link with SalomeApp, here the code returns SALOMEDS_Study.
55 // SalomeApp_Study::studyDS() does it as well, but -- here it is retrieved from
56 // SALOMEDS::StudyManager - no linkage with SalomeApp.
58 // Temporarily commented to avoid awful dependecy on SALOMEDS
59 // TODO: better mechanism of storing display/erse status in a study
60 // should be provided...
61 //static _PTR(Study) getStudyDS()
63 // SALOMEDSClient_Study* aStudy = NULL;
64 // _PTR(StudyManager) aMgr( new SALOMEDS_StudyManager() );
65 // get id of SUIT_Study, if it's a SalomeApp_Study, it will return
66 // id of its underlying SALOMEDS::Study
67 // SUIT_Application* app = SUIT_Session::session()->activeApplication();
68 // if ( !app ) return _PTR(Study)(aStudy);
69 // SUIT_Study* stud = app->activeStudy();
70 // if ( !stud ) return _PTR(Study)(aStudy);
71 // const int id = stud->id(); // virtual method, must return SALOMEDS_Study id
72 // get SALOMEDS_Study with this id from StudyMgr
73 // return aMgr->GetStudyByID( id );
79 SVTK_Viewer::SVTK_Viewer()
81 myTrihedronSize = 105;
82 myTrihedronRelative = true;
83 myIsStaticTrihedronVisible = true;
84 myIncrementSpeed = 10;
89 myDynamicPreSelection = false;
93 myDefaultBackground = Qtx::BackgroundData( Qt::black );
99 SVTK_Viewer::~SVTK_Viewer()
103 /*! Get data for supported background modes: gradient types, identifiers and supported image formats */
104 QString SVTK_Viewer::backgroundData( QStringList& gradList, QIntList& idList, QIntList& txtList )
106 gradList << tr( "GT_HORIZONTALGRADIENT" )
107 << tr( "GT_VERTICALGRADIENT" )
108 << tr( "GT_FIRSTDIAGONALGRADIENT" )
109 << tr( "GT_SECONDDIAGONALGRADIENT" )
110 << tr( "GT_FIRSTCORNERGRADIENT" )
111 << tr( "GT_SECONDCORNERGRADIENT" )
112 << tr( "GT_THIRDCORNERGRADIENT" )
113 << tr( "GT_FOURTHCORNERGRADIENT" );
114 idList << HorizontalGradient
116 << FirstDiagonalGradient
117 << SecondDiagonalGradient
118 << FirstCornerGradient
119 << SecondCornerGradient
120 << ThirdCornerGradient
121 << FourthCornerGradient;
122 #ifdef VTK_ENABLE_TEXTURED_BACKGROUND
123 txtList << Qtx::CenterTexture << Qtx::TileTexture << Qtx::StretchTexture;
125 return tr("BG_IMAGE_FILES");
128 //! Get background color of the viewer [obsolete]
129 QColor SVTK_Viewer::backgroundColor() const
131 return background().color();
134 //! Set background color to the viewer [obsolete]
135 void SVTK_Viewer::setBackgroundColor( const QColor& c )
137 Qtx::BackgroundData bg = background();
143 \return background data
145 Qtx::BackgroundData SVTK_Viewer::background() const
147 return myDefaultBackground;
152 \param theBackground - new background data
154 void SVTK_Viewer::setBackground( const Qtx::BackgroundData& theBackground )
156 myDefaultBackground = theBackground.isValid() ? theBackground : Qtx::BackgroundData( Qt::black );
157 QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
158 for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
159 if(SUIT_ViewWindow* aViewWindow = aViews.at(i)){
160 if(TViewWindow* aView = dynamic_cast<TViewWindow*>(aViewWindow)){
161 aView->setBackground(myDefaultBackground);
167 /*!Create new instance of view window on desktop \a theDesktop.
168 *\retval SUIT_ViewWindow* - created view window pointer.
170 SUIT_ViewWindow* SVTK_Viewer::createView( SUIT_Desktop* theDesktop )
172 TViewWindow* aViewWindow = new TViewWindow(theDesktop);
173 aViewWindow->Initialize(this);
175 aViewWindow->setBackground( background() );
176 aViewWindow->SetTrihedronSize( trihedronSize(), trihedronRelative() );
177 aViewWindow->SetStaticTrihedronVisible( isStaticTrihedronVisible() );
178 aViewWindow->SetProjectionMode( projectionMode() );
179 aViewWindow->SetInteractionStyle( interactionStyle() );
180 aViewWindow->SetZoomingStyle( zoomingStyle() );
181 aViewWindow->SetDynamicPreSelection( dynamicPreSelection() );
182 aViewWindow->SetIncrementalSpeed( incrementalSpeed(), incrementalSpeedMode() );
183 aViewWindow->SetSpacemouseButtons( spacemouseBtn(1), spacemouseBtn(2), spacemouseBtn(3) );
185 connect(aViewWindow, SIGNAL( actorAdded(VTKViewer_Actor*) ),
186 this, SLOT(onActorAdded(VTKViewer_Actor*)));
187 connect(aViewWindow, SIGNAL( actorRemoved(VTKViewer_Actor*) ),
188 this, SLOT(onActorRemoved(VTKViewer_Actor*)));
194 \return trihedron size
196 double SVTK_Viewer::trihedronSize() const
198 return myTrihedronSize;
202 \return true if thihedron changes size in accordance with bounding box
204 bool SVTK_Viewer::trihedronRelative() const
206 return myTrihedronRelative;
210 Sets trihedron size and relativeness( whether thihedron changes size in accordance with bounding box)
211 \param theSize - new size
212 \param theRelative - new relativeness
214 void SVTK_Viewer::setTrihedronSize( const double theSize, const bool theRelative )
216 myTrihedronSize = theSize;
217 myTrihedronRelative = theRelative;
219 if (SUIT_ViewManager* aViewManager = getViewManager()) {
220 QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
221 for ( uint i = 0; i < aViews.count(); i++ )
223 if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
224 aView->SetTrihedronSize( theSize, theRelative );
230 \return visibility status of the static trihedron
232 bool SVTK_Viewer::isStaticTrihedronVisible() const
234 return myIsStaticTrihedronVisible;
238 Sets visibility status of the static trihedron
239 \param theIsVisible - new visibility status
241 void SVTK_Viewer::setStaticTrihedronVisible( const bool theIsVisible )
243 myIsStaticTrihedronVisible = theIsVisible;
245 if (SUIT_ViewManager* aViewManager = getViewManager()) {
246 QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
247 for ( uint i = 0; i < aViews.count(); i++ )
249 if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
250 aView->SetStaticTrihedronVisible( theIsVisible );
256 \return projection mode
258 int SVTK_Viewer::projectionMode() const
265 Sets projection mode: 0 - orthogonal, 1 - perspective projection
266 \param theMode - new projection mode
268 void SVTK_Viewer::setProjectionMode( const int theMode )
270 if ( myProjMode != theMode ) {
271 myProjMode = theMode;
273 if (SUIT_ViewManager* aViewManager = getViewManager()) {
274 QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
275 for ( uint i = 0; i < aViews.count(); i++ )
277 if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
278 aView->SetProjectionMode( theMode );
285 \return interaction style
287 int SVTK_Viewer::interactionStyle() const
293 Sets interaction style: 0 - standard, 1 - keyboard free interaction
294 \param theStyle - new interaction style
296 void SVTK_Viewer::setInteractionStyle( const int theStyle )
300 if (SUIT_ViewManager* aViewManager = getViewManager()) {
301 QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
302 for ( uint i = 0; i < aViews.count(); i++ )
304 if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
305 aView->SetInteractionStyle( theStyle );
311 \return zooming style
313 int SVTK_Viewer::zoomingStyle() const
315 return myZoomingStyle;
319 Sets zooming style: 0 - standard, 1 - advanced (at cursor)
320 \param theStyle - new zooming style
322 void SVTK_Viewer::setZoomingStyle( const int theStyle )
324 myZoomingStyle = theStyle;
326 if (SUIT_ViewManager* aViewManager = getViewManager()) {
327 QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
328 for ( uint i = 0; i < aViews.count(); i++ )
330 if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
331 aView->SetZoomingStyle( theStyle );
337 \return dynamic preselection
339 bool SVTK_Viewer::dynamicPreSelection() const
341 return myDynamicPreSelection;
345 Sets dynamic preselection
346 \param theMode - new dynamic preselection mode
348 void SVTK_Viewer::setDynamicPreSelection( const bool theMode )
350 myDynamicPreSelection = theMode;
352 if (SUIT_ViewManager* aViewManager = getViewManager()) {
353 QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
354 for ( uint i = 0; i < aViews.count(); i++ )
356 if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
357 aView->SetDynamicPreSelection( theMode );
363 \return incremental speed value
365 int SVTK_Viewer::incrementalSpeed() const
367 return myIncrementSpeed;
371 \return modification mode of the incremental speed
373 int SVTK_Viewer::incrementalSpeedMode() const
375 return myIncrementMode;
379 Set the incremental speed value and modification mode
380 \param theValue - new value
381 \param theMode - new mode: 0 - arithmetic, 1 - geometrical progression
383 void SVTK_Viewer::setIncrementalSpeed( const int theValue, const int theMode )
385 myIncrementSpeed = theValue;
386 myIncrementMode = theMode;
388 if (SUIT_ViewManager* aViewManager = getViewManager()) {
389 QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
390 for ( uint i = 0; i < aViews.count(); i++ )
392 if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
393 aView->SetIncrementalSpeed( theValue, theMode );
399 \return spacemouse button assigned to the specified function
400 \param theIndex - function by number (from 1 to 3)
402 int SVTK_Viewer::spacemouseBtn( const int theIndex ) const
404 if ( theIndex < 1 || theIndex > 3 )
406 return mySpaceBtn[theIndex-1];
410 Set the spacemouse buttons
411 \param theBtn1, theBtn2, theBtn3 - new buttons
413 void SVTK_Viewer::setSpacemouseButtons( const int theBtn1, const int theBtn2, const int theBtn3 )
415 mySpaceBtn[0] = theBtn1;
416 mySpaceBtn[1] = theBtn2;
417 mySpaceBtn[2] = theBtn3;
419 if (SUIT_ViewManager* aViewManager = getViewManager()) {
420 QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
421 for ( uint i = 0; i < aViews.count(); i++ )
423 if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
424 aView->SetSpacemouseButtons( theBtn1, theBtn2, theBtn3 );
430 Sets new view manager
431 \param theViewManager - new view manager
433 void SVTK_Viewer::setViewManager(SUIT_ViewManager* theViewManager)
435 SUIT_ViewModel::setViewManager(theViewManager);
437 if ( !theViewManager )
440 connect(theViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
441 this, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*)));
443 connect(theViewManager, SIGNAL(mouseMove(SUIT_ViewWindow*, QMouseEvent*)),
444 this, SLOT(onMouseMove(SUIT_ViewWindow*, QMouseEvent*)));
446 connect(theViewManager, SIGNAL(mouseRelease(SUIT_ViewWindow*, QMouseEvent*)),
447 this, SLOT(onMouseRelease(SUIT_ViewWindow*, QMouseEvent*)));
451 Builds popup for vtk viewer
453 void SVTK_Viewer::contextMenuPopup( QMenu* thePopup )
455 thePopup->addAction( VTKViewer_Viewer::tr( "MEN_DUMP_VIEW" ), this, SLOT( onDumpView() ) );
456 thePopup->addAction( VTKViewer_Viewer::tr( "MEN_CHANGE_BACKGROUND" ), this, SLOT( onChangeBackground() ) );
458 thePopup->addSeparator();
460 if(TViewWindow* aView = dynamic_cast<TViewWindow*>(myViewManager->getActiveView())){
461 //Support of several toolbars in the popup menu
462 QList<QToolBar*> lst = qFindChildren<QToolBar*>( aView );
463 QList<QToolBar*>::const_iterator it = lst.begin(), last = lst.end();
464 for( ; it!=last; it++ )
465 thePopup->addAction( (*it)->toggleViewAction() );
466 aView->RefreshDumpImage();
471 SLOT: called on mouse button press, empty implementation
473 void SVTK_Viewer::onMousePress(SUIT_ViewWindow* vw, QMouseEvent* event)
477 SLOT: called on mouse move, empty implementation
479 void SVTK_Viewer::onMouseMove(SUIT_ViewWindow* vw, QMouseEvent* event)
483 SLOT: called on mouse button release, empty implementation
485 void SVTK_Viewer::onMouseRelease(SUIT_ViewWindow* vw, QMouseEvent* event)
489 Enables/disables selection
490 \param isEnabled - new state
492 void SVTK_Viewer::enableSelection(bool isEnabled)
494 mySelectionEnabled = isEnabled;
495 //!! To be done for view windows
499 Enables/disables selection of many object
500 \param isEnabled - new state
502 void SVTK_Viewer::enableMultiselection(bool isEnable)
504 myMultiSelectionEnabled = isEnable;
505 //!! To be done for view windows
509 SLOT: called on dump view operation is activated, stores scene to raster file
511 void SVTK_Viewer::onDumpView()
513 if(SUIT_ViewWindow* aView = myViewManager->getActiveView())
518 SLOT: called if background color is to be changed changed, passes new color to view port
520 void SVTK_Viewer::onChangeBackground()
522 SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(myViewManager->getActiveView());
526 // get supported gradient types
527 QStringList gradList;
528 QIntList idList, txtList;
529 QString formats = backgroundData( gradList, idList, txtList );
532 Qtx::BackgroundData bgData = QtxBackgroundDialog::getBackground( aView->background(), // initial background
533 aView, // parent for dialog box
534 txtList, // allowed texture modes
535 true, // enable solid color mode
536 true, // enable gradient mode
537 false, // disable custom gradient mode
538 !txtList.isEmpty(), // enable texture mode
539 gradList, // gradient names
540 idList, // gradient identifiers
541 formats ); // image formats
543 // set chosen background data to the viewer
544 if ( bgData.isValid() )
545 aView->setBackground( bgData );
550 \param prs - presentation
552 void SVTK_Viewer::Display( const SALOME_VTKPrs* prs )
554 // try do downcast object
555 if(const SVTK_Prs* aPrs = dynamic_cast<const SVTK_Prs*>( prs )){
558 if(vtkActorCollection* anActorCollection = aPrs->GetObjects()){
559 // get SALOMEDS Study
560 // Temporarily commented to avoid awful dependecy on SALOMEDS
561 // TODO: better mechanism of storing display/erse status in a study
562 // should be provided...
563 // _PTR(Study) aStudy(getStudyDS());
564 anActorCollection->InitTraversal();
565 while(vtkActor* anActor = anActorCollection->GetNextActor()){
566 if(SALOME_Actor* anAct = SALOME_Actor::SafeDownCast(anActor)){
567 if(!anAct->ShouldBeDisplayed())
569 // Set visibility flag
570 // Temporarily commented to avoid awful dependecy on SALOMEDS
571 // TODO: better mechanism of storing display/erse status in a study
572 // should be provided...
573 //Handle(SALOME_InteractiveObject) anObj = anAct->getIO();
574 //if(!anObj.IsNull() && anObj->hasEntry() && aStudy){
575 // ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),true,this);
577 // just display the object
578 QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
579 for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
580 if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(aViews.at(i))){
581 if(SVTK_View* aView = aViewWindow->getView()){
582 aView->Display(anAct,false);
583 if(anAct->IsSetCamera()){
584 vtkRenderer* aRenderer = aView->getRenderer();
585 anAct->SetCamera( aRenderer->GetActiveCamera() );
598 \param prs - presentation
599 \param forced - removes object from view
601 void SVTK_Viewer::Erase( const SALOME_VTKPrs* prs, const bool forced )
603 // try do downcast object
604 if(const SVTK_Prs* aPrs = dynamic_cast<const SVTK_Prs*>( prs )){
607 if(vtkActorCollection* anActorCollection = aPrs->GetObjects()){
608 // get SALOMEDS Study
609 // Temporarily commented to avoid awful dependecy on SALOMEDS
610 // TODO: better mechanism of storing display/erase status in a study
611 // should be provided...
612 //_PTR(Study) aStudy(getStudyDS());
613 anActorCollection->InitTraversal();
614 while(vtkActor* anActor = anActorCollection->GetNextActor())
615 if(SALOME_Actor* anAct = SALOME_Actor::SafeDownCast(anActor)){
616 // Set visibility flag
617 // Temporarily commented to avoid awful dependecy on SALOMEDS
618 // TODO: better mechanism of storing display/erase status in a study
619 // should be provided...
620 //Handle(SALOME_InteractiveObject) anObj = anAct->getIO();
621 //if(!anObj.IsNull() && anObj->hasEntry() && aStudy){
622 // ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),false,this);
624 // just display the object
625 QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
626 for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
627 if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(aViews.at(i)))
628 if(SVTK_View* aView = aViewWindow->getView())
631 aView->Remove(anAct,false);
633 aView->Erase(anAct,forced);
642 Erase all presentations
643 \param forced - removes all objects from view
645 void SVTK_Viewer::EraseAll( const bool forced )
647 // Temporarily commented to avoid awful dependecy on SALOMEDS
648 // TODO: better mechanism of storing display/erse status in a study
649 // should be provided...
650 //_PTR(Study) aStudy(getStudyDS());
651 QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
652 for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
653 if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(aViews.at(i)))
654 if(SVTK_View* aView = aViewWindow->getView()){
655 vtkRenderer* aRenderer = aView->getRenderer();
656 VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
657 vtkActorCollection* anActorCollection = aCopy.GetActors();
658 anActorCollection->InitTraversal();
659 while(vtkActor* anActor = anActorCollection->GetNextActor()){
660 if(SALOME_Actor* anAct = SALOME_Actor::SafeDownCast(anActor)){
661 // Set visibility flag
662 // Temporarily commented to avoid awful dependecy on SALOMEDS
663 // TODO: better mechanism of storing display/erse status in a study
664 // should be provided...
665 //Handle(SALOME_InteractiveObject) anObj = anAct->getIO();
666 //if(!anObj.IsNull() && anObj->hasEntry() && aStudy)
667 // ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),false,this);
669 aRenderer->RemoveActor(anAct);
672 anAct->SetVisibility( false );
673 // erase dependent actors
674 vtkActorCollection* aCollection = vtkActorCollection::New();
675 anAct->GetChildActors( aCollection );
676 aCollection->InitTraversal();
677 while(vtkActor* aSubAct = aCollection->GetNextActor())
678 aSubAct->SetVisibility( false );
679 aCollection->Delete();
689 Create presentation corresponding to the entry
692 SALOME_Prs* SVTK_Viewer::CreatePrs( const char* entry )
694 SVTK_Prs* prs = new SVTK_Prs();
696 if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(getViewManager()->getActiveView()))
697 if(SVTK_View* aView = aViewWindow->getView()){
698 vtkRenderer* aRenderer = aView->getRenderer();
699 VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
700 vtkActorCollection* theActors = aCopy.GetActors();
701 theActors->InitTraversal();
703 while( ( ac = theActors->GetNextActor() ) ) {
704 SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( ac );
705 if ( anActor && anActor->hasIO() && !strcmp( anActor->getIO()->getEntry(), entry ) ) {
706 prs->AddObject( ac );
715 \return true if object is displayed in viewer
716 \param obj - object to be checked
718 bool SVTK_Viewer::isVisible( const Handle(SALOME_InteractiveObject)& io )
720 QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
721 for(int i = 0, iEnd = aViews.size(); i < iEnd; i++)
722 if(SUIT_ViewWindow* aViewWindow = aViews.at(i))
723 if(TViewWindow* aViewWnd = dynamic_cast<TViewWindow*>(aViewWindow))
724 if(SVTK_View* aView = aViewWnd->getView())
725 if(!aView->isVisible( io ))
732 \Collect objects visible in viewer
733 \param theList - visible objects collection
735 void SVTK_Viewer::GetVisible( SALOME_ListIO& theList )
737 // here we collect object if it is disaplaed even one view
738 QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
739 for(int i = 0, iEnd = aViews.size(); i < iEnd; i++)
740 if(SUIT_ViewWindow* aViewWindow = aViews.at(i))
741 if(TViewWindow* aViewWnd = dynamic_cast<TViewWindow*>(aViewWindow))
742 if(SVTK_View* aView = aViewWnd->getView())
743 aView->GetVisible( theList );
747 Updates current viewer
749 void SVTK_Viewer::Repaint()
751 // if (theUpdateTrihedron) onAdjustTrihedron();
752 QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
753 for(int i = 0, iEnd = aViews.size(); i < iEnd; i++)
754 if(TViewWindow* aViewWindow = dynamic_cast<TViewWindow*>(aViews.at(i)))
755 if(SVTK_View* aView = aViewWindow->getView())
760 void SVTK_Viewer::onActorAdded(VTKViewer_Actor* theActor)
762 emit actorAdded((SVTK_ViewWindow*)sender(), theActor);
765 void SVTK_Viewer::onActorRemoved(VTKViewer_Actor* theActor)
767 emit actorRemoved((SVTK_ViewWindow*)sender(), theActor);