]> SALOME platform Git repositories - modules/gui.git/blob - src/SVTK/SVTK_MainWindow.cxx
Salome HOME
Join modifications from branch OCC_debug_for_3_2_0b1
[modules/gui.git] / src / SVTK / SVTK_MainWindow.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   : 
25 //  Author : 
26 //  Module : SALOME
27 //  $Header$
28
29 #include "SALOME_Actor.h"
30
31 #include <vtkGenericRenderWindowInteractor.h>
32 #include <vtkRenderer.h>
33
34 #include "QtxAction.h"
35
36 #include "SUIT_ToolButton.h"
37 #include "SUIT_MessageBox.h"
38 #include "SUIT_ViewWindow.h"
39
40 #include "SUIT_Tools.h"
41 #include "SUIT_ResourceMgr.h"
42 #include "SVTK_NonIsometricDlg.h"
43 #include "SVTK_UpdateRateDlg.h"
44 #include "SVTK_CubeAxesDlg.h"
45
46 #include "SVTK_MainWindow.h"
47 #include "SVTK_Event.h"
48 #include "SVTK_Renderer.h"
49 #include "SVTK_RenderWindowInteractor.h"
50
51 #include "SVTK_Selector.h"
52
53 #include <qimage.h>
54
55 /*!
56   Constructor
57 */
58 SVTK_MainWindow
59 ::SVTK_MainWindow(QWidget* theParent, 
60                   const char* theName,
61                   SUIT_ResourceMgr* theResourceMgr,
62                   SUIT_ViewWindow* theViewWindow) :
63   QMainWindow(theParent,theName,0),
64   myViewWindow(theViewWindow)
65 {
66   myToolBar = new QToolBar(this);
67   myToolBar->setCloseMode(QDockWindow::Undocked);
68   myToolBar->setLabel(tr("LBL_TOOLBAR_LABEL"));
69
70   createActions(theResourceMgr);
71   createToolBar();
72 }
73
74 /*!
75   To initialize the class
76 */
77 void
78 SVTK_MainWindow
79 ::Initialize(SVTK_RenderWindowInteractor* theInteractor)
80 {
81   myInteractor = theInteractor;
82   SetEventDispatcher(myInteractor->GetDevice());
83
84   setCentralWidget(myInteractor);
85   myInteractor->setBackgroundMode(Qt::NoBackground);
86
87   myInteractor->setFocusPolicy(StrongFocus);
88   myInteractor->setFocus();
89   setFocusProxy(myInteractor);
90
91   myUpdateRateDlg = new SVTK_UpdateRateDlg(myActionsMap[UpdateRate],this,"SVTK_UpdateRateDlg");
92   myNonIsometricDlg = new SVTK_NonIsometricDlg(myActionsMap[NonIsometric],this,"SVTK_NonIsometricDlg");
93   myCubeAxesDlg = new SVTK_CubeAxesDlg(myActionsMap[GraduatedAxes],this,"SVTK_CubeAxesDlg");
94 }
95
96 /*!
97   Destructor
98 */
99 SVTK_MainWindow
100 ::~SVTK_MainWindow()
101 {
102 }
103
104 /*!
105   \return used SVTK_RenderWindowInteractor
106 */
107 SVTK_RenderWindowInteractor*
108 SVTK_MainWindow
109 ::GetInteractor()
110 {
111   return myInteractor;
112 }
113
114 /*!
115   \return used #vtkRenderWindowInteractor (obsolete)
116 */
117 vtkRenderWindowInteractor*
118 SVTK_MainWindow
119 ::getInteractor()
120 {
121   return GetInteractor()->GetDevice();
122 }
123
124 /*!
125   \return used vtkRenderWindow (obsolete)
126 */
127 vtkRenderWindow*
128 SVTK_MainWindow
129 ::getRenderWindow()
130 {
131   return GetInteractor()->getRenderWindow();
132 }
133
134 /*!
135   To repaint the view
136   \param theUpdateTrihedron - adjust trihedron
137 */
138 void
139 SVTK_MainWindow
140 ::Repaint(bool theUpdateTrihedron)
141 {
142   if(theUpdateTrihedron) 
143     GetRenderer()->OnAdjustTrihedron();
144
145   GetInteractor()->update();
146 }
147
148 /*!
149   To invoke a VTK event on SVTK_RenderWindowInteractor instance
150 */
151 void
152 SVTK_MainWindow
153 ::InvokeEvent(unsigned long theEvent, void* theCallData)
154 {
155   GetInteractor()->InvokeEvent(theEvent,theCallData);
156 }
157
158 /*!
159   Redirect the request to SVTK_RenderWindowInteractor::GetInteractorStyle
160 */
161 vtkInteractorStyle*
162 SVTK_MainWindow
163 ::GetInteractorStyle()
164 {
165   return GetInteractor()->GetInteractorStyle();
166 }
167
168 /*!
169   Redirect the request to SVTK_RenderWindowInteractor::PushInteractorStyle
170 */
171 void
172 SVTK_MainWindow
173 ::PushInteractorStyle(vtkInteractorStyle* theStyle)
174 {
175   GetInteractor()->PushInteractorStyle(theStyle);
176 }
177
178 /*!
179   Redirect the request to SVTK_RenderWindowInteractor::PopInteractorStyle
180 */
181 void
182 SVTK_MainWindow
183 ::PopInteractorStyle()
184 {
185   GetInteractor()->PopInteractorStyle();
186 }
187
188 /*!
189   Redirect the request to SVTK_RenderWindowInteractor::GetSelector
190 */
191 SVTK_Selector*
192 SVTK_MainWindow
193 ::GetSelector()
194 {
195   return GetInteractor()->GetSelector();
196 }
197
198 /*!
199   Redirect the request to SVTK_RenderWindowInteractor::SelectionMode
200 */
201 Selection_Mode
202 SVTK_MainWindow
203 ::SelectionMode()
204 {
205   return GetSelector()->SelectionMode();
206 }
207
208 /*!
209   Redirect the request to SVTK_RenderWindowInteractor::SetSelectionMode
210 */
211 void
212 SVTK_MainWindow
213 ::SetSelectionMode(Selection_Mode theMode)
214 {
215   GetSelector()->SetSelectionMode(theMode);
216 }
217
218 /*!
219   Redirect the request to SVTK_RenderWindowInteractor::GetRenderer
220 */
221 SVTK_Renderer* 
222 SVTK_MainWindow
223 ::GetRenderer()
224 {
225   return GetInteractor()->GetRenderer();
226 }
227
228 /*!
229   Redirect the request to SVTK_RenderWindowInteractor::getRenderer
230 */
231 vtkRenderer* 
232 SVTK_MainWindow
233 ::getRenderer()
234 {
235   return GetInteractor()->getRenderer();
236 }
237
238 /*!
239   Sets background color of the view
240   \param theColor - new background color
241 */
242 void
243 SVTK_MainWindow
244 ::SetBackgroundColor(const QColor& theColor)
245 {
246   getRenderer()->SetBackground(theColor.red()/255.0, 
247                                theColor.green()/255.0,
248                                theColor.blue()/255.0);
249 }
250
251 /*!
252   \return background color of the view
253 */
254 QColor
255 SVTK_MainWindow
256 ::BackgroundColor()
257 {
258   vtkFloatingPointType aBackgroundColor[3];
259   getRenderer()->GetBackground(aBackgroundColor);
260   return QColor(int(aBackgroundColor[0]*255), 
261                 int(aBackgroundColor[1]*255), 
262                 int(aBackgroundColor[2]*255));
263 }
264
265 /*!
266   Redirect the request to SVTK_Renderer::GetScale
267 */
268 void
269 SVTK_MainWindow
270 ::GetScale( double theScale[3] ) 
271 {
272   GetRenderer()->GetScale( theScale );
273 }
274
275 /*!
276   Redirect the request to SVTK_Renderer::SetScale
277 */
278 void
279 SVTK_MainWindow
280 ::SetScale( double theScale[3] ) 
281 {
282   GetRenderer()->SetScale( theScale );
283   Repaint();
284 }
285
286 /*!
287   Redirect the request to SVTK_Renderer::AddActor
288 */
289 void
290 SVTK_MainWindow
291 ::AddActor(VTKViewer_Actor* theActor, 
292            bool theIsUpdate)
293 {
294   GetRenderer()->AddActor(theActor);
295   if(theIsUpdate) 
296     Repaint();
297 }
298
299 /*!
300   Redirect the request to SVTK_Renderer::RemoveActor
301 */
302 void
303 SVTK_MainWindow
304 ::RemoveActor(VTKViewer_Actor* theActor, 
305               bool theIsUpdate)
306 {
307   GetRenderer()->RemoveActor(theActor);
308   if(theIsUpdate) 
309     Repaint();
310 }
311
312 /*!
313   Redirect the request to SVTK_Renderer::GetTrihedronSize
314 */
315 int
316 SVTK_MainWindow
317 ::GetTrihedronSize()
318 {
319   return GetRenderer()->GetTrihedronSize();
320 }
321
322 /*!
323   Redirect the request to SVTK_Renderer::SetTrihedronSize
324 */
325 void 
326 SVTK_MainWindow
327 ::SetTrihedronSize( const int theSize, const bool theRelative )
328 {
329   GetRenderer()->SetTrihedronSize(theSize, theRelative);
330   Repaint();
331 }
332
333
334 /*! If parameter theIsForcedUpdate is true, recalculate parameters for
335  *  trihedron and cube axes, even if trihedron and cube axes is invisible.
336  */
337 void
338 SVTK_MainWindow
339 ::AdjustActors()
340 {
341   GetRenderer()->AdjustActors();
342   Repaint();
343 }
344
345 /*!
346   Redirect the request to SVTK_Renderer::IsTrihedronDisplayed
347 */
348 bool
349 SVTK_MainWindow
350 ::IsTrihedronDisplayed()
351 {
352   return GetRenderer()->IsTrihedronDisplayed();
353 }
354
355 /*!
356   Redirect the request to SVTK_Renderer::IsCubeAxesDisplayed
357 */
358 bool
359 SVTK_MainWindow
360 ::IsCubeAxesDisplayed()
361 {
362   return GetRenderer()->IsCubeAxesDisplayed();
363 }
364
365 /*!
366   Redirect the request to SVTK_Renderer::GetTrihedron
367 */
368 VTKViewer_Trihedron*  
369 SVTK_MainWindow
370 ::GetTrihedron() 
371
372   return GetRenderer()->GetTrihedron(); 
373 }
374
375 /*!
376   Redirect the request to SVTK_Renderer::GetCubeAxes
377 */
378 SVTK_CubeAxesActor2D* 
379 SVTK_MainWindow
380 ::GetCubeAxes() 
381
382   return GetRenderer()->GetCubeAxes(); 
383 }
384
385 /*!
386   \return toolbar of svtk main window
387 */
388 QToolBar* 
389 SVTK_MainWindow
390 ::getToolBar()
391 {
392   return myToolBar;
393 }
394
395 void
396 SVTK_MainWindow
397 ::SetEventDispatcher(vtkObject* theDispatcher)
398 {
399   myEventDispatcher = theDispatcher;
400 }
401
402 #if defined(WIN32) && !defined(_DEBUG)
403 #pragma optimize( "", off )
404 #endif
405
406 /*!
407   Creates all actions of svtk main window
408 */
409 void
410 SVTK_MainWindow
411 ::createActions(SUIT_ResourceMgr* theResourceMgr)
412 {
413   if(!myActionsMap.isEmpty()) 
414     return;
415   
416   QtxAction* anAction;
417
418   // Dump view
419   anAction = new QtxAction(tr("MNU_DUMP_VIEW"), 
420                            theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_DUMP" ) ),
421                            tr( "MNU_DUMP_VIEW" ), 0, this);
422   anAction->setStatusTip(tr("DSC_DUMP_VIEW"));
423   connect(anAction, SIGNAL(activated()), myViewWindow, SLOT(onDumpView()));
424   myActionsMap[ DumpId ] = anAction;
425
426   // FitAll
427   anAction = new QtxAction(tr("MNU_FITALL"), 
428                            theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITALL" ) ),
429                            tr( "MNU_FITALL" ), 0, this);
430   anAction->setStatusTip(tr("DSC_FITALL"));
431   connect(anAction, SIGNAL(activated()), this, SLOT(onFitAll()));
432   myActionsMap[ FitAllId ] = anAction;
433
434   // FitRect
435   anAction = new QtxAction(tr("MNU_FITRECT"), 
436                            theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITAREA" ) ),
437                            tr( "MNU_FITRECT" ), 0, this);
438   anAction->setStatusTip(tr("DSC_FITRECT"));
439   connect(anAction, SIGNAL(activated()), this, SLOT(activateWindowFit()));
440   myActionsMap[ FitRectId ] = anAction;
441
442   // Zoom
443   anAction = new QtxAction(tr("MNU_ZOOM_VIEW"), 
444                            theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ZOOM" ) ),
445                            tr( "MNU_ZOOM_VIEW" ), 0, this);
446   anAction->setStatusTip(tr("DSC_ZOOM_VIEW"));
447   connect(anAction, SIGNAL(activated()), this, SLOT(activateZoom()));
448   myActionsMap[ ZoomId ] = anAction;
449
450   // Panning
451   anAction = new QtxAction(tr("MNU_PAN_VIEW"), 
452                            theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_PAN" ) ),
453                            tr( "MNU_PAN_VIEW" ), 0, this);
454   anAction->setStatusTip(tr("DSC_PAN_VIEW"));
455   connect(anAction, SIGNAL(activated()), this, SLOT(activatePanning()));
456   myActionsMap[ PanId ] = anAction;
457
458   // Global Panning
459   anAction = new QtxAction(tr("MNU_GLOBALPAN_VIEW"), 
460                            theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_GLOBALPAN" ) ),
461                            tr( "MNU_GLOBALPAN_VIEW" ), 0, this);
462   anAction->setStatusTip(tr("DSC_GLOBALPAN_VIEW"));
463   connect(anAction, SIGNAL(activated()), this, SLOT(activateGlobalPanning()));
464   myActionsMap[ GlobalPanId ] = anAction;
465
466   // Rotation
467   anAction = new QtxAction(tr("MNU_ROTATE_VIEW"), 
468                            theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ROTATE" ) ),
469                            tr( "MNU_ROTATE_VIEW" ), 0, this);
470   anAction->setStatusTip(tr("DSC_ROTATE_VIEW"));
471   connect(anAction, SIGNAL(activated()), this, SLOT(activateRotation()));
472   myActionsMap[ RotationId ] = anAction;
473
474   // Projections
475   anAction = new QtxAction(tr("MNU_FRONT_VIEW"), 
476                            theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FRONT" ) ),
477                            tr( "MNU_FRONT_VIEW" ), 0, this);
478   anAction->setStatusTip(tr("DSC_FRONT_VIEW"));
479   connect(anAction, SIGNAL(activated()), this, SLOT(onFrontView()));
480   myActionsMap[ FrontId ] = anAction;
481
482   anAction = new QtxAction(tr("MNU_BACK_VIEW"), 
483                            theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_BACK" ) ),
484                            tr( "MNU_BACK_VIEW" ), 0, this);
485   anAction->setStatusTip(tr("DSC_BACK_VIEW"));
486   connect(anAction, SIGNAL(activated()), this, SLOT(onBackView()));
487   myActionsMap[ BackId ] = anAction;
488
489   anAction = new QtxAction(tr("MNU_TOP_VIEW"), 
490                            theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TOP" ) ),
491                            tr( "MNU_TOP_VIEW" ), 0, this);
492   anAction->setStatusTip(tr("DSC_TOP_VIEW"));
493   connect(anAction, SIGNAL(activated()), this, SLOT(onTopView()));
494   myActionsMap[ TopId ] = anAction;
495
496   anAction = new QtxAction(tr("MNU_BOTTOM_VIEW"), 
497                            theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_BOTTOM" ) ),
498                            tr( "MNU_BOTTOM_VIEW" ), 0, this);
499   anAction->setStatusTip(tr("DSC_BOTTOM_VIEW"));
500   connect(anAction, SIGNAL(activated()), this, SLOT(onBottomView()));
501   myActionsMap[ BottomId ] = anAction;
502
503   anAction = new QtxAction(tr("MNU_LEFT_VIEW"), 
504                            theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_LEFT" ) ),
505                            tr( "MNU_LEFT_VIEW" ), 0, this);
506   anAction->setStatusTip(tr("DSC_LEFT_VIEW"));
507   connect(anAction, SIGNAL(activated()), this, SLOT(onLeftView()));
508   myActionsMap[ LeftId ] = anAction;
509
510   anAction = new QtxAction(tr("MNU_RIGHT_VIEW"), 
511                            theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RIGHT" ) ),
512                            tr( "MNU_RIGHT_VIEW" ), 0, this);
513   anAction->setStatusTip(tr("DSC_RIGHT_VIEW"));
514   connect(anAction, SIGNAL(activated()), this, SLOT(onRightView()));
515   myActionsMap[ RightId ] = anAction;
516
517   // Reset
518   anAction = new QtxAction(tr("MNU_RESET_VIEW"), 
519                            theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RESET" ) ),
520                            tr( "MNU_RESET_VIEW" ), 0, this);
521   anAction->setStatusTip(tr("DSC_RESET_VIEW"));
522   connect(anAction, SIGNAL(activated()), this, SLOT(onResetView()));
523   myActionsMap[ ResetId ] = anAction;
524
525   // onViewTrihedron: Shows - Hides Trihedron
526   anAction = new QtxAction(tr("MNU_SHOW_TRIHEDRON"), 
527                            theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TRIHEDRON" ) ),
528                            tr( "MNU_SHOW_TRIHEDRON" ), 0, this);
529   anAction->setStatusTip(tr("DSC_SHOW_TRIHEDRON"));
530   connect(anAction, SIGNAL(activated()), this, SLOT(onViewTrihedron()));
531   myActionsMap[ ViewTrihedronId ] = anAction;
532
533   // onNonIsometric: Manage non-isometric params
534   anAction = new QtxAction(tr("MNU_SVTK_SCALING"), 
535                            theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_SCALING" ) ),
536                            tr( "MNU_SVTK_SCALING" ), 0, this);
537   anAction->setStatusTip(tr("DSC_SVTK_SCALING"));
538   anAction->setToggleAction(true);
539   connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onNonIsometric(bool)));
540   myActionsMap[ NonIsometric ] = anAction;
541
542   // onGraduatedAxes: Manage graduated axes params
543   anAction = new QtxAction(tr("MNU_SVTK_GRADUATED_AXES"), 
544                            theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_GRADUATED_AXES" ) ),
545                            tr( "MNU_SVTK_GRADUATED_AXES" ), 0, this);
546   anAction->setStatusTip(tr("DSC_SVTK_GRADUATED_AXES"));
547   anAction->setToggleAction(true);
548   connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onGraduatedAxes(bool)));
549   myActionsMap[ GraduatedAxes ] = anAction;
550
551   // onGraduatedAxes: Manage graduated axes params
552   anAction = new QtxAction(tr("MNU_SVTK_UPDATE_RATE"), 
553                            theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_UPDATE_RATE" ) ),
554                            tr( "MNU_SVTK_UPDATE_RATE" ), 0, this);
555   anAction->setStatusTip(tr("DSC_SVTK_UPDATE_RATE"));
556   anAction->setToggleAction(true);
557   connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onUpdateRate(bool)));
558   myActionsMap[ UpdateRate ] = anAction;
559 }
560
561 #if defined(WIN32) && !defined(_DEBUG)
562 #pragma optimize( "", on )
563 #endif
564
565 /*!
566   Creates toolbar of svtk main window
567 */
568 void
569 SVTK_MainWindow
570 ::createToolBar()
571 {
572   myActionsMap[DumpId]->addTo(myToolBar);
573   myActionsMap[ViewTrihedronId]->addTo(myToolBar);
574
575   SUIT_ToolButton* aScaleBtn = new SUIT_ToolButton(myToolBar);
576   aScaleBtn->AddAction(myActionsMap[FitAllId]);
577   aScaleBtn->AddAction(myActionsMap[FitRectId]);
578   aScaleBtn->AddAction(myActionsMap[ZoomId]);
579
580   SUIT_ToolButton* aPanningBtn = new SUIT_ToolButton(myToolBar);
581   aPanningBtn->AddAction(myActionsMap[PanId]);
582   aPanningBtn->AddAction(myActionsMap[GlobalPanId]);
583
584   myActionsMap[RotationId]->addTo(myToolBar);
585
586   SUIT_ToolButton* aViewsBtn = new SUIT_ToolButton(myToolBar);
587   aViewsBtn->AddAction(myActionsMap[FrontId]);
588   aViewsBtn->AddAction(myActionsMap[BackId]);
589   aViewsBtn->AddAction(myActionsMap[TopId]);
590   aViewsBtn->AddAction(myActionsMap[BottomId]);
591   aViewsBtn->AddAction(myActionsMap[LeftId]);
592   aViewsBtn->AddAction(myActionsMap[RightId]);
593
594   myActionsMap[ResetId]->addTo(myToolBar);
595
596   myActionsMap[UpdateRate]->addTo(myToolBar);
597   myActionsMap[NonIsometric]->addTo(myToolBar);
598   myActionsMap[GraduatedAxes]->addTo(myToolBar);
599 }
600
601 /*!
602   Custom show event handler
603 */
604 void
605 SVTK_MainWindow
606 ::showEvent( QShowEvent * theEvent ) 
607 {
608   emit Show( theEvent );
609 }
610
611 /*!
612   Custom hide event handler
613 */
614 void
615 SVTK_MainWindow
616 ::hideEvent( QHideEvent * theEvent ) 
617 {
618   emit Hide( theEvent );
619 }
620
621 /*!
622   Starts zoom transformation
623 */
624 void
625 SVTK_MainWindow
626 ::activateZoom()
627 {
628   myEventDispatcher->InvokeEvent(SVTK::StartZoom,0);
629 }
630
631 /*!
632   Starts panning transformation
633 */
634 void
635 SVTK_MainWindow
636 ::activatePanning()
637 {
638   myEventDispatcher->InvokeEvent(SVTK::StartPan,0);
639 }
640
641 /*!
642   Starts rotation transformation
643 */
644 void
645 SVTK_MainWindow
646 ::activateRotation()
647 {
648   myEventDispatcher->InvokeEvent(SVTK::StartRotate,0);
649 }
650
651 /*!
652   Starts global panning transformation
653 */
654 void
655 SVTK_MainWindow
656 ::activateGlobalPanning()
657 {
658   myEventDispatcher->InvokeEvent(SVTK::StartGlobalPan,0);
659 }
660
661 /*!
662   Starts window fit transformation
663 */
664 void
665 SVTK_MainWindow
666 ::activateWindowFit()
667 {
668   myEventDispatcher->InvokeEvent(SVTK::StartFitArea,0);
669 }
670
671 /*!
672   Processes transformation "front view"
673 */
674 void
675 SVTK_MainWindow
676 ::onFrontView()
677 {
678   GetRenderer()->OnFrontView();
679   Repaint();
680 }
681
682 /*!
683   Processes transformation "back view"
684 */
685 void
686 SVTK_MainWindow
687 ::onBackView()
688 {
689   GetRenderer()->OnBackView();
690   Repaint();
691 }
692
693 /*!
694   Processes transformation "top view"
695 */
696 void
697 SVTK_MainWindow
698 ::onTopView()
699 {
700   GetRenderer()->OnTopView();
701   Repaint();
702 }
703
704 /*!
705   Processes transformation "bottom view"
706 */
707 void
708 SVTK_MainWindow
709 ::onBottomView()
710 {
711   GetRenderer()->OnBottomView();
712   Repaint();
713 }
714
715 /*!
716   Processes transformation "left view"
717 */
718 void
719 SVTK_MainWindow
720 ::onLeftView()
721 {
722   GetRenderer()->OnLeftView();
723   Repaint();
724 }
725
726 /*!
727   Processes transformation "right view"
728 */
729 void
730 SVTK_MainWindow
731 ::onRightView()
732 {
733   GetRenderer()->OnRightView();
734   Repaint();
735 }
736
737 /*!
738   Processes transformation "reset view": sets default orientation of viewport camera
739 */
740 void
741 SVTK_MainWindow
742 ::onResetView()
743 {
744   GetRenderer()->OnResetView();
745   Repaint();
746 }
747
748 /*!
749   Processes transformation "fit all"
750 */
751 void
752 SVTK_MainWindow
753 ::onFitAll()
754 {
755   GetRenderer()->OnFitAll();
756   Repaint();
757 }
758
759 /*!
760   Shows trihedron
761 */
762 void 
763 SVTK_MainWindow
764 ::onViewTrihedron()
765 {
766   GetRenderer()->OnViewTrihedron();
767   Repaint();
768 }
769
770 /*!
771   Shows cube axes
772 */
773 void
774 SVTK_MainWindow
775 ::onViewCubeAxes()
776 {
777   GetRenderer()->OnViewCubeAxes();
778   Repaint();
779 }
780
781 void
782 SVTK_MainWindow
783 ::onUpdateRate(bool theIsActivate)
784 {
785   if(theIsActivate){
786     myUpdateRateDlg->Update();
787     myUpdateRateDlg->show();
788   }else
789     myUpdateRateDlg->hide();
790 }
791
792 void
793 SVTK_MainWindow
794 ::onNonIsometric(bool theIsActivate)
795 {
796   if(theIsActivate){
797     myNonIsometricDlg->Update();
798     myNonIsometricDlg->show();
799   }else
800     myNonIsometricDlg->hide();
801 }
802
803 void
804 SVTK_MainWindow
805 ::onGraduatedAxes(bool theIsActivate)
806 {
807   if(theIsActivate){
808     myCubeAxesDlg->Update();
809     myCubeAxesDlg->show();
810   }else
811     myCubeAxesDlg->hide();
812 }
813
814 void
815 SVTK_MainWindow
816 ::onAdjustTrihedron()
817 {   
818   GetRenderer()->OnAdjustTrihedron();
819 }
820
821 void
822 SVTK_MainWindow
823 ::onAdjustCubeAxes()
824 {   
825   GetRenderer()->OnAdjustCubeAxes();
826 }
827
828 /*!
829   \return QImage, containing all scene rendering in window
830 */
831 QImage
832 SVTK_MainWindow
833 ::dumpView()
834 {
835   QPixmap px = QPixmap::grabWindow( GetInteractor()->winId() );
836   return px.convertToImage();
837 }