Salome HOME
PR: mergefrom_BSEC_br1_14Mar04
[modules/kernel.git] / src / VTKViewer / VTKViewer_ViewFrame.cxx
1 //  SALOME VTKViewer : build VTK viewer into Salome desktop
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
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. 
10 // 
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. 
15 // 
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 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : VTKViewer_ViewFrame.cxx
25 //  Author : Nicolas REJNERI
26 //  Module : SALOME
27 //  $Header$
28
29 #include "VTKViewer_ViewFrame.h"
30 #include "VTKViewer_Utilities.h"
31 #include "VTKViewer_Trihedron.h"
32 #include "VTKViewer_RenderWindow.h"
33 //#include "VTKViewer_InteractorStyleSALOME.h"
34
35 #include "SALOME_Transform.h"
36 #include "SALOME_TransformFilter.h"
37 #include "SALOME_PassThroughFilter.h"
38 #include "SALOME_GeometryFilter.h"
39
40 #include "SALOME_Transform.h"
41 #include "SALOME_TransformFilter.h"
42 #include "SALOME_PassThroughFilter.h"
43 #include "SALOME_GeometryFilter.h"
44
45 #include "QAD_Settings.h"
46 #include "QAD_Config.h"
47 #include "QAD_Application.h"
48 #include "QAD_Desktop.h"
49 #include "SALOME_Selection.h"
50 #include "SALOME_InteractiveObject.hxx"
51 #include "VTKViewer_InteractorStyleSALOME.h"
52
53 #include "utilities.h"
54
55 //QT Include
56 #include <qlayout.h>
57 #include <qcolordialog.h>
58 #include <qfiledialog.h>
59 #include <qapplication.h>
60
61 // VTK Includes
62 #include <vtkActor.h>
63 #include <vtkRenderer.h>
64 #include <vtkTransform.h>
65
66 using namespace std;
67
68 /*!
69     Constructor
70 */
71 VTKViewer_ViewFrame::VTKViewer_ViewFrame(QWidget* parent, const char* name) 
72   :  QAD_ViewFrame(parent, name)
73 {
74   m_ViewUp[0] = 0; m_ViewUp[1] = 0; m_ViewUp[2] = -1;
75   m_ViewNormal[0] = 0; m_ViewNormal[1] = 0; m_ViewNormal[2] = 1;
76   m_Triedron = VTKViewer_Trihedron::New();
77   m_Transform = SALOME_Transform::New();
78   //m_Renderer = VTKViewer_Renderer::New() ;
79   m_Renderer = vtkRenderer::New() ;
80
81   m_Triedron->AddToRender(m_Renderer);
82   InitialSetup();
83 }  
84
85 void VTKViewer_ViewFrame::InitialSetup() {
86   m_RW = new VTKViewer_RenderWindow(this, "RenderWindow");
87   m_RW->getRenderWindow()->AddRenderer(m_Renderer);
88
89   m_Renderer->GetActiveCamera()->ParallelProjectionOn();
90   m_Renderer->LightFollowCameraOn();
91   m_Renderer->TwoSidedLightingOn();
92
93   // Set BackgroundColor
94   QString BgrColorRed   = QAD_CONFIG->getSetting("VTKViewer:BackgroundColorRed");
95   QString BgrColorGreen = QAD_CONFIG->getSetting("VTKViewer:BackgroundColorGreen");
96   QString BgrColorBlue  = QAD_CONFIG->getSetting("VTKViewer:BackgroundColorBlue");
97
98   if( !BgrColorRed.isEmpty() && !BgrColorGreen.isEmpty() && !BgrColorBlue.isEmpty() ) 
99     m_Renderer->SetBackground( BgrColorRed.toInt()/255., BgrColorGreen.toInt()/255., BgrColorBlue.toInt()/255. );
100   else
101     m_Renderer->SetBackground( 0, 0, 0 );
102   
103   // Create an interactor.
104   m_RWInteractor = VTKViewer_RenderWindowInteractor::New();
105   m_RWInteractor->setGUIWindow(m_RW);
106   m_RWInteractor->SetRenderWindow(m_RW->getRenderWindow());
107
108   VTKViewer_InteractorStyleSALOME* RWS = VTKViewer_InteractorStyleSALOME::New();
109   RWS->setGUIWindow(m_RW);
110   m_RWInteractor->SetInteractorStyle(RWS); 
111
112   m_RWInteractor->Initialize();
113   RWS->setTriedron(m_Triedron);
114   //SRN: additional initialization, to init CurrentRenderer of vtkInteractorStyle 
115   RWS->FindPokedRenderer(0, 0);
116
117   setCentralWidget( m_RW );
118   onViewReset();
119 }
120
121 VTKViewer_ViewFrame::~VTKViewer_ViewFrame() {
122   m_Transform->Delete() ;
123   // In order to ensure that the interactor unregisters
124   // this RenderWindow, we assign a NULL RenderWindow to 
125   // it before deleting it.
126   m_RWInteractor->SetRenderWindow(NULL) ;
127   m_RWInteractor->Delete() ;
128   
129   //m_RW->Delete() ;
130   m_Renderer->RemoveAllProps();
131   // NRI : BugID 1137:  m_Renderer->Delete() ;
132   m_Triedron->Delete();
133   MESSAGE("VTKViewer_ViewFrame::~VTKViewer_ViewFrame()");
134 }
135
136 /*!
137   Returns widget containing 3D-Viewer
138 */
139 QWidget* VTKViewer_ViewFrame::getViewWidget(){
140   return m_RW;
141 }
142
143 bool VTKViewer_ViewFrame::isTrihedronDisplayed(){
144   return m_Triedron->GetVisibility() == VTKViewer_Trihedron::eOn;
145 }
146
147 void VTKViewer_ViewFrame::onAdjustTrihedron(){   
148   if(!isTrihedronDisplayed()) 
149     return;
150   int aVisibleNum = m_Triedron->GetVisibleActorCount(m_Renderer);
151   if(aVisibleNum){
152     // calculating diagonal of visible props of the renderer
153     float bnd[6];
154     m_Triedron->VisibilityOff();
155     ::ComputeVisiblePropBounds(m_Renderer,bnd);
156     m_Triedron->VisibilityOn();
157     float aLength = 0;
158     static bool CalcByDiag = false;
159     if(CalcByDiag){
160       aLength = sqrt((bnd[1]-bnd[0])*(bnd[1]-bnd[0])+
161                      (bnd[3]-bnd[2])*(bnd[3]-bnd[2])+
162                      (bnd[5]-bnd[4])*(bnd[5]-bnd[4]));
163     }else{
164       aLength = bnd[1]-bnd[0];
165       aLength = max((bnd[3]-bnd[2]),aLength);
166       aLength = max((bnd[5]-bnd[4]),aLength);
167     }
168    
169     static float aSizeInPercents = 105;
170     QString aSetting = QAD_CONFIG->getSetting("Viewer:TrihedronSize");
171     if(!aSetting.isEmpty()) aSizeInPercents = aSetting.toFloat();
172
173     static float EPS_SIZE = 5.0E-3;
174     float aSize = m_Triedron->GetSize();
175     float aNewSize = aLength*aSizeInPercents/100.0;
176     // if the new trihedron size have sufficient difference, then apply the value
177     if(fabs(aNewSize-aSize) > aSize*EPS_SIZE || fabs(aNewSize-aSize) > aNewSize*EPS_SIZE)
178       m_Triedron->SetSize(aNewSize);
179   }
180   m_Triedron->Render(m_Renderer);
181   ::ResetCameraClippingRange(m_Renderer);
182 }
183
184 /*!
185   Display/hide Trihedron
186 */
187 void VTKViewer_ViewFrame::onViewTrihedron(){
188   if(!m_Triedron) return;
189   if(isTrihedronDisplayed())
190     m_Triedron->VisibilityOff();
191   else{
192     m_Triedron->VisibilityOn();
193   }
194   Repaint();
195 }
196
197 /*!
198   Provides top projection of the active view
199 */
200 void VTKViewer_ViewFrame::onViewTop(){
201   vtkCamera* camera = m_Renderer->GetActiveCamera();
202   camera->SetPosition(0,0,1);
203   camera->SetViewUp(0,1,0);
204   camera->SetFocalPoint(0,0,0);
205   onViewFitAll();
206 }
207
208 /*!
209   Provides bottom projection of the active view
210 */
211 void VTKViewer_ViewFrame::onViewBottom(){
212   vtkCamera* camera = m_Renderer->GetActiveCamera();
213   camera->SetPosition(0,0,-1);
214   camera->SetViewUp(0,1,0);
215   camera->SetFocalPoint(0,0,0);
216   onViewFitAll();
217 }
218
219 /*!
220   Provides left projection of the active view
221 */
222 void VTKViewer_ViewFrame::onViewLeft(){
223   vtkCamera* camera = m_Renderer->GetActiveCamera(); 
224   camera->SetPosition(0,1,0);
225   camera->SetViewUp(0,0,1);
226   camera->SetFocalPoint(0,0,0);
227   onViewFitAll();
228 }
229
230 /*!
231   Provides right projection of the active view
232 */
233 void VTKViewer_ViewFrame::onViewRight(){
234   vtkCamera* camera = m_Renderer->GetActiveCamera();
235   camera->SetPosition(0,-1,0);
236   camera->SetViewUp(0,0,1);
237   camera->SetFocalPoint(0,0,0);
238   onViewFitAll();
239 }
240
241 /*!
242   Provides back projection of the active view
243 */
244 void VTKViewer_ViewFrame::onViewBack(){
245   vtkCamera* camera = m_Renderer->GetActiveCamera();
246   camera->SetPosition(-1,0,0);
247   camera->SetViewUp(0,0,1);
248   camera->SetFocalPoint(0,0,0);
249   onViewFitAll();
250 }
251
252 /*!
253   Provides front projection of the active view
254 */
255 void VTKViewer_ViewFrame::onViewFront(){
256   vtkCamera* camera = m_Renderer->GetActiveCamera();
257   camera->SetPosition(1,0,0);
258   camera->SetViewUp(0,0,1);
259   camera->SetFocalPoint(0,0,0);
260   onViewFitAll();
261 }
262
263 /*!
264   Fits all objects in the active view
265 */
266 void VTKViewer_ViewFrame::onViewFitAll(){
267   m_RWInteractor->GetInteractorStyleSALOME()->ViewFitAll();
268 //   int aTriedronWasVisible = isTrihedronDisplayed();
269 //   if(m_Triedron->GetVisibleActorCount(m_Renderer)){
270 //     m_Triedron->VisibilityOff();
271 //     ::ResetCamera(m_Renderer);
272 //   }else{
273 //     m_Triedron->SetVisibility(VTKViewer_Trihedron::eOnlyLineOn);
274 //     ::ResetCamera(m_Renderer,true);
275 //   }
276 //   if(aTriedronWasVisible) m_Triedron->VisibilityOn();
277 //   else m_Triedron->VisibilityOff();
278
279   Repaint();
280 }
281
282 /*!
283   Reset the active view
284 */
285 void VTKViewer_ViewFrame::onViewReset(){
286   int aTriedronIsVisible = isTrihedronDisplayed();
287   m_Triedron->SetVisibility(VTKViewer_Trihedron::eOnlyLineOn);
288   ::ResetCamera(m_Renderer,true);  
289   vtkCamera* aCamera = m_Renderer->GetActiveCamera();
290   aCamera->SetPosition(1,-1,1);
291   aCamera->SetViewUp(0,0,1);
292   ::ResetCamera(m_Renderer,true);  
293   if(aTriedronIsVisible) m_Triedron->VisibilityOn();
294   else m_Triedron->VisibilityOff();
295   static float aCoeff = 3.0;
296   aCamera->SetParallelScale(aCoeff*aCamera->GetParallelScale());
297   Repaint();
298 }
299
300 /*!
301   Rotates the active view
302 */
303 void VTKViewer_ViewFrame::onViewRotate(){
304   m_RWInteractor->GetInteractorStyleSALOME()->startRotate();
305 }
306
307 /*!
308   Sets a new center of the active view
309 */
310 void VTKViewer_ViewFrame::onViewGlobalPan(){
311   if(m_Triedron->GetVisibleActorCount(m_Renderer))
312     m_RWInteractor->GetInteractorStyleSALOME()->startGlobalPan();
313 }
314
315 /*!
316   Zooms the active view
317 */
318 void VTKViewer_ViewFrame::onViewZoom(){
319   m_RWInteractor->GetInteractorStyleSALOME()->startZoom();
320 }
321
322 /*!
323   Moves the active view
324 */
325 void VTKViewer_ViewFrame::onViewPan(){
326   m_RWInteractor->GetInteractorStyleSALOME()->startPan();
327 }
328
329 /*!
330   Fits all obejcts within a rectangular area of the active view
331 */
332 void VTKViewer_ViewFrame::onViewFitArea(){
333   m_RWInteractor->GetInteractorStyleSALOME()->startFitArea();
334 }
335
336 /*!
337     Set background of the viewport
338 */
339 void VTKViewer_ViewFrame::setBackgroundColor( const QColor& color)
340 {
341   if ( m_Renderer )
342     m_Renderer->SetBackground( color.red()/255., color.green()/255., color.blue()/255. );
343 }
344
345 /*!
346     Returns background of the viewport
347 */
348 QColor VTKViewer_ViewFrame::backgroundColor() const
349 {
350   float backint[3];
351   if ( m_Renderer ) {
352     m_Renderer->GetBackground(backint);
353     return QColorDialog::getColor ( QColor(int(backint[0]*255), int(backint[1]*255), int(backint[2]*255)), NULL );
354   }
355   return QMainWindow::backgroundColor();
356 }
357
358
359 void VTKViewer_ViewFrame::SetSelectionMode( int mode )
360 {
361   m_RWInteractor->SetSelectionMode( mode );
362 }
363
364 void VTKViewer_ViewFrame::rename( const Handle(SALOME_InteractiveObject)& IObject, QString newName )
365 {
366   m_RWInteractor->rename(IObject, newName);
367 }
368
369 void VTKViewer_ViewFrame::unHighlightAll() 
370 {
371   m_RWInteractor->unHighlightAll();
372 }
373
374 void VTKViewer_ViewFrame::highlight( const Handle(SALOME_InteractiveObject)& IObject, 
375                                      bool highlight, 
376                                      bool update ) 
377 {
378   QAD_Study* ActiveStudy = QAD_Application::getDesktop()->getActiveStudy();
379   SALOME_Selection* Sel = SALOME_Selection::Selection( ActiveStudy->getSelection() );
380   if ( Sel->SelectionMode() == 4 )
381     m_RWInteractor->highlight(IObject, highlight, update);
382   else if ( Sel->SelectionMode() == 3 ) {
383     m_RWInteractor->highlight(IObject, highlight, update);
384     if ( Sel->HasIndex( IObject ) ) {
385       TColStd_MapOfInteger MapIndex;
386       Sel->GetIndex( IObject, MapIndex );
387       m_RWInteractor->highlightCell(IObject, highlight, MapIndex, update);
388     }
389   } 
390   else if ( Sel->SelectionMode() == 2 ) {
391     m_RWInteractor->highlight(IObject, highlight, update);
392     if ( Sel->HasIndex( IObject ) ) {
393       TColStd_MapOfInteger MapIndex;
394       Sel->GetIndex( IObject, MapIndex );
395       m_RWInteractor->highlightEdge(IObject, highlight, MapIndex, update);
396     }
397   }
398   else if ( Sel->SelectionMode() == 1 ) {
399     m_RWInteractor->highlight(IObject, highlight, update);
400     if ( Sel->HasIndex( IObject ) ) {
401       TColStd_MapOfInteger MapIndex;
402       Sel->GetIndex( IObject, MapIndex );
403       m_RWInteractor->highlightPoint(IObject, highlight, MapIndex, update);
404     }
405   }
406 }
407
408 bool VTKViewer_ViewFrame::isInViewer( const Handle(SALOME_InteractiveObject)& IObject ) 
409 {
410   return m_RWInteractor->isInViewer( IObject );
411 }
412
413 bool VTKViewer_ViewFrame::isVisible( const Handle(SALOME_InteractiveObject)& IObject ) 
414 {
415   return m_RWInteractor->isVisible( IObject );
416 }
417
418 void VTKViewer_ViewFrame::setPopupServer( QAD_Application* App )
419 {
420   m_RW->setPopupServer( App );
421 }
422
423 void VTKViewer_ViewFrame::undo(SALOMEDS::Study_var aStudy,
424                                const char* StudyFrameEntry)
425 {
426   vtkActorCollection* theActors = m_Renderer->GetActors();
427   theActors->InitTraversal();
428   vtkActor *ac = theActors->GetNextActor();
429   while(!(ac==NULL)) {
430     if ( ac->IsA("SALOME_Actor") ) {
431       SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( ac );
432       if ( anActor->hasIO() ) {
433         Handle(SALOME_InteractiveObject) IO = anActor->getIO();
434         if ( IO->hasEntry() ) { 
435           /*if (!QAD_ViewFrame::isInViewer(aStudy, IO->getEntry(), StudyFrameEntry)) {
436             m_RWInteractor->Erase(IO);
437             }*/
438         }
439       }
440     }
441     ac = theActors->GetNextActor();
442   }
443 }
444
445 void VTKViewer_ViewFrame::redo(SALOMEDS::Study_var aStudy,
446                                const char* StudyFrameEntry)
447 {
448   SALOMEDS::SObject_var RefSO;
449   SALOMEDS::SObject_var SO = aStudy->FindObjectID( StudyFrameEntry );
450   SALOMEDS::ChildIterator_var it = aStudy->NewChildIterator(SO);
451   for (; it->More();it->Next()){
452     SALOMEDS::SObject_var CSO= it->Value();
453     if (CSO->ReferencedObject(RefSO)) {
454       vtkActorCollection* theActors = m_Renderer->GetActors();
455       theActors->InitTraversal();
456       vtkActor *ac = theActors->GetNextActor();
457       while(!(ac==NULL)) {
458         if ( ac->IsA("SALOME_Actor") ) {
459           SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( ac );
460           if ( anActor->hasIO() ) {
461             Handle(SALOME_InteractiveObject) IO = anActor->getIO();
462             if ( IO->hasEntry() ) { 
463               /*if ( strcmp(IO->getEntry(),RefSO->GetID()) == 0 )
464                 m_RWInteractor->Display(IO);*/
465             }
466           }
467         }
468         ac = theActors->GetNextActor();
469       }
470     }
471   }
472 }
473
474
475 /* selection */
476 Handle(SALOME_InteractiveObject) VTKViewer_ViewFrame::FindIObject(const char* Entry)
477 {
478   Handle(SALOME_InteractiveObject) IO;
479   vtkActorCollection* theActors = m_Renderer->GetActors();
480   theActors->InitTraversal();
481   vtkActor *ac = theActors->GetNextActor();
482   while(!(ac==NULL)) {
483     if ( ac->IsA("SALOME_Actor") ) {
484       SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( ac );
485       if ( anActor->hasIO() ) {
486         IO = anActor->getIO();
487         if ( IO->hasEntry() ) {
488           if ( strcmp( IO->getEntry(), Entry ) == 0 ) {
489             return IO;
490           }
491         }
492       }
493     }
494     ac = theActors->GetNextActor();
495   }
496   return IO;
497 }
498
499 /* display */           
500 void VTKViewer_ViewFrame::Display(const Handle(SALOME_InteractiveObject)& IObject, bool update)
501 {
502   QAD_Study* myStudy = QAD_Application::getDesktop()->getActiveStudy();
503   SALOME_Selection* Sel
504     = SALOME_Selection::Selection( myStudy->getSelection() );
505
506   vtkActorCollection* theActors = m_Renderer->GetActors();
507   theActors->InitTraversal();
508   vtkActor *ac = theActors->GetNextActor();
509   while(!(ac==NULL))
510     {
511       if ( ac->IsA("SALOME_Actor") )
512         {
513           SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( ac );
514           if ( anActor->hasIO() ) 
515             {
516               Handle(SALOME_InteractiveObject) IO = anActor->getIO();
517               if ( IO->isSame(IObject) )
518                 {
519                   m_RWInteractor->Display(IO, false);
520                   Sel->AddIObject(IO, false);
521                   break;
522                 }
523             }
524         }
525       ac = theActors->GetNextActor();
526     }
527   if (update)
528     Repaint();
529 }
530
531
532 void VTKViewer_ViewFrame::DisplayOnly(const Handle(SALOME_InteractiveObject)& IObject)
533 {
534   QAD_Study* myStudy = QAD_Application::getDesktop()->getActiveStudy();
535   SALOME_Selection* Sel
536     = SALOME_Selection::Selection( myStudy->getSelection() );
537
538   vtkActorCollection* theActors = m_Renderer->GetActors();
539   theActors->InitTraversal();
540   vtkActor *ac = theActors->GetNextActor();
541   while(!(ac==NULL)) {
542     if ( ac->IsA("SALOME_Actor") ) {
543       SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( ac );
544       if ( anActor->hasIO() ) {
545         Handle(SALOME_InteractiveObject) IO = anActor->getIO();
546         if ( !IO->isSame(IObject) ) {
547           m_RWInteractor->Erase(IO, false);
548           Sel->RemoveIObject(IO, false);
549         } else {
550           anActor->SetVisibility(true);
551           Sel->AddIObject(IO, false);
552         }
553       }
554     }
555     ac = theActors->GetNextActor();
556   }
557   Repaint();
558 }
559
560 void VTKViewer_ViewFrame::Erase(const Handle(SALOME_InteractiveObject)& IObject, bool update)
561 {
562   QAD_Study* myStudy = QAD_Application::getDesktop()->getActiveStudy();
563   SALOME_Selection* Sel
564     = SALOME_Selection::Selection( myStudy->getSelection() );
565
566   vtkActorCollection* theActors = m_Renderer->GetActors();
567   theActors->InitTraversal();
568   vtkActor *ac = theActors->GetNextActor();
569   while(!(ac==NULL)) 
570     {
571       if ( ac->IsA("SALOME_Actor") )
572         {
573           SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( ac );
574           if ( anActor->hasIO() )
575             {
576               Handle(SALOME_InteractiveObject) IO = anActor->getIO();
577               if ( IO->isSame( IObject ) ) {
578                 m_RWInteractor->Erase(IO, false);
579                 Sel->RemoveIObject(IO, false);
580                 break;
581               }
582             }
583         }
584       ac = theActors->GetNextActor();
585     }
586   if (update)
587     Repaint();
588 }
589
590
591 void VTKViewer_ViewFrame::DisplayAll()
592 {
593   m_RWInteractor->DisplayAll();
594 }
595
596
597 void VTKViewer_ViewFrame::EraseAll()
598 {
599   m_RWInteractor->EraseAll();
600 }
601
602
603 void VTKViewer_ViewFrame::Repaint(bool theUpdateTrihedron)
604 {
605   if (theUpdateTrihedron) onAdjustTrihedron();
606   m_RW->update();
607 }
608
609 void VTKViewer_ViewFrame::GetScale(double theScale[3]){
610   m_Transform->GetScale(theScale);
611 }
612
613 void VTKViewer_ViewFrame::SetScale(double theScale[3]){
614   m_Transform->SetScale(theScale[0], theScale[1], theScale[2]);
615   m_RWInteractor->Render();
616   Repaint();
617 }
618
619 void VTKViewer_ViewFrame::AddActor( SALOME_Actor* theActor, bool update /*=false*/ ){
620   theActor->SetVisibility(true);
621   theActor->AddToRender(m_Renderer);
622   theActor->SetTransform(m_Transform);
623   if(update) Repaint();
624 }
625
626 void VTKViewer_ViewFrame::RemoveActor( SALOME_Actor* theActor, bool update /*=false*/ ){
627   theActor->RemoveFromRender(m_Renderer);
628   if(update) Repaint();
629 }
630
631