Back to index

salome-gui  6.5.0
SVTK_Renderer.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  SALOME VTKViewer : build VTK viewer into Salome desktop
00024 //  File   :
00025 //  Author :
00026 
00027 #include "SVTK_Renderer.h"
00028 
00029 #include "SVTK_Trihedron.h"
00030 #include "SVTK_CubeAxesActor2D.h"
00031 #include "SVTK_RectPicker.h"
00032 
00033 #include "SALOME_Actor.h"
00034 #include "VTKViewer_Actor.h"
00035 #include "VTKViewer_Algorithm.h"
00036 #include "VTKViewer_Transform.h"
00037 #include "VTKViewer_Utilities.h"
00038 #include "VTKViewer_OpenGLRenderer.h"
00039 
00040 #include <vtkCamera.h>
00041 #include <vtkTextProperty.h>
00042 #include <vtkObjectFactory.h>
00043 #include <vtkCallbackCommand.h>
00044 
00045 #include <vtkPicker.h>
00046 #include <vtkPointPicker.h>
00047 #include <vtkCellPicker.h>
00048 
00049 #include <vtkProperty.h>
00050 
00051 // undefining min and max because CASCADE's defines them and
00052 // it clashes with std::min(), std::max() included in utilities.h
00053 #undef min
00054 #undef max
00055 
00056 
00057 vtkStandardNewMacro(SVTK_Renderer);
00058 
00062 SVTK_Renderer
00063 ::SVTK_Renderer():
00064   myDevice(VTKViewer_OpenGLRenderer::New()),
00065   myInteractor(NULL),
00066   myPriority(0.0),
00067   myEventCallbackCommand(vtkCallbackCommand::New()),
00068   myPointPicker(vtkPointPicker::New()),
00069   myCellPicker(vtkCellPicker::New()),
00070   myPointRectPicker(SVTK_RectPicker::New()),
00071   myCellRectPicker(SVTK_RectPicker::New()),
00072   myPreHighlightProperty(vtkProperty::New()),
00073   myHighlightProperty(vtkProperty::New()),
00074   myTransform(VTKViewer_Transform::New()),
00075   myCubeAxes(SVTK_CubeAxesActor2D::New()),
00076   myTrihedron(SVTK_Trihedron::New()),
00077   myTrihedronSize(105),
00078   myIsTrihedronRelative(true)
00079 {
00080   myDevice->Delete();
00081   myTransform->Delete();
00082 
00083   myPointPicker->Delete();
00084   myCellPicker->Delete();
00085 
00086   myPointRectPicker->Delete();
00087   myPointRectPicker->PickFromListOn();
00088 
00089   myCellRectPicker->Delete();
00090   myCellRectPicker->PickFromListOn();
00091   myCellRectPicker->PickPointsOff();
00092 
00093   //SetPreselectionProp();
00094   myPreHighlightProperty->Delete();
00095   myPreHighlightProperty->SetColor(0,1,1);
00096   myPreHighlightProperty->SetPointSize(SALOME_POINT_SIZE+2);
00097   myPreHighlightProperty->SetLineWidth(SALOME_LINE_WIDTH+2);
00098   myPreHighlightProperty->SetRepresentationToPoints();
00099 
00100   //SetSelectionProp();
00101   myHighlightProperty->Delete();
00102   myHighlightProperty->SetColor(1,1,0);
00103   myHighlightProperty->SetPointSize(SALOME_POINT_SIZE+2);
00104   myHighlightProperty->SetLineWidth(SALOME_LINE_WIDTH+2);
00105   myHighlightProperty->SetRepresentationToPoints();
00106 
00107   // Bug 0020123, note 0005217 - Problem with zoom
00108   GetDevice()->SetNearClippingPlaneTolerance( 0.00001 );
00109 
00110   myTrihedron->Delete();
00111   myCubeAxes->Delete();
00112   myEventCallbackCommand->Delete();
00113 
00114   myTrihedron->AddToRender(GetDevice());
00115   GetDevice()->AddViewProp(GetCubeAxes());
00116 
00117   myBndBox[0] = myBndBox[2] = myBndBox[4] = 0;
00118   myBndBox[1] = myBndBox[3] = myBndBox[5] = myTrihedron->GetSize();
00119 
00120   myCubeAxes->SetBounds(myBndBox);
00121   myCubeAxes->SetCamera(GetDevice()->GetActiveCamera());
00122 
00123   myCubeAxes->SetLabelFormat("%6.4g");
00124   myCubeAxes->SetFlyModeToOuterEdges(); // ENK remarks: it must bee
00125   myCubeAxes->SetFontFactor(0.8);
00126   myCubeAxes->SetCornerOffset(0);
00127   myCubeAxes->SetScaling(0);
00128   myCubeAxes->SetNumberOfLabels(5);
00129   myCubeAxes->VisibilityOff();
00130   myCubeAxes->SetTransform(GetTransform());
00131 
00132   vtkTextProperty* aTextProp = vtkTextProperty::New();
00133   aTextProp->SetColor(1, 1, 1);
00134   aTextProp->ShadowOn();
00135   myCubeAxes->SetAxisTitleTextProperty(aTextProp);
00136   myCubeAxes->SetAxisLabelTextProperty(aTextProp);
00137   aTextProp->Delete();
00138 
00139   GetDevice()->GetActiveCamera()->ParallelProjectionOn();
00140   GetDevice()->LightFollowCameraOn();
00141   GetDevice()->TwoSidedLightingOn();
00142 
00143   myEventCallbackCommand->SetClientData(this);
00144   myEventCallbackCommand->SetCallback(SVTK_Renderer::ProcessEvents);
00145   GetDevice()->AddObserver(vtkCommand::ConfigureEvent,
00146                            myEventCallbackCommand.GetPointer(), 
00147                            myPriority);
00148   GetDevice()->AddObserver(vtkCommand::ResetCameraEvent,
00149                            myEventCallbackCommand.GetPointer(), 
00150                            myPriority);
00151   GetDevice()->AddObserver(vtkCommand::ResetCameraClippingRangeEvent,
00152                            myEventCallbackCommand.GetPointer(), 
00153                            myPriority);
00154 }
00155 
00159 SVTK_Renderer
00160 ::~SVTK_Renderer()
00161 {
00162   VTK::ActorCollectionCopy aCopy(GetDevice()->GetActors());
00163   vtkActorCollection* anActors = aCopy.GetActors();
00164   vtkActorCollection* anActors2 = vtkActorCollection::New();
00165 
00166   anActors->InitTraversal();
00167   while(vtkActor* anAct = anActors->GetNextActor()){
00168     if(SALOME_Actor* anActor = dynamic_cast<SALOME_Actor*>(anAct)){
00169       anActors2->AddItem(anActor);
00170     }
00171   }
00172 
00173   anActors2->InitTraversal();
00174   while(vtkActor* anAct = anActors2->GetNextActor()){
00175     if(SALOME_Actor* anActor = dynamic_cast<SALOME_Actor*>(anAct)){
00176       RemoveActor(anActor);
00177     }
00178   }
00179 
00180   anActors2->Delete();
00181 }
00182 
00183 
00187 void 
00188 SVTK_Renderer
00189 ::ProcessEvents(vtkObject* vtkNotUsed(theObject), 
00190                 unsigned long theEvent,
00191                 void* theClientData, 
00192                 void* vtkNotUsed(theCallData))
00193 {
00194   SVTK_Renderer* self = reinterpret_cast<SVTK_Renderer*>(theClientData);
00195 
00196   switch(theEvent){
00197   case vtkCommand::ConfigureEvent:
00198     self->OnResetView();
00199     break;
00200   case vtkCommand::ResetCameraEvent:
00201     self->OnFitAll();
00202     break;
00203   case vtkCommand::ResetCameraClippingRangeEvent:
00204     self->OnResetClippingRange();
00205     break;
00206   }
00207 }
00208 
00212 vtkRenderer* 
00213 SVTK_Renderer
00214 ::GetDevice()
00215 {
00216   return myDevice.GetPointer();
00217 }
00218 
00222 void 
00223 SVTK_Renderer
00224 ::Initialize(vtkRenderWindowInteractor* theInteractor,
00225              SVTK_Selector* theSelector)
00226 {
00227   myInteractor = theInteractor;
00228   mySelector = theSelector;
00229   SetSelectionTolerance();
00230 }
00231 
00235 void
00236 SVTK_Renderer
00237 ::AddActor(VTKViewer_Actor* theActor, bool theIsAdjustActors)
00238 {
00239   if(SALOME_Actor* anActor = dynamic_cast<SALOME_Actor*>(theActor)){
00240     anActor->SetInteractor(myInteractor);
00241     anActor->SetTransform(GetTransform());
00242     anActor->SetSelector(mySelector.GetPointer());
00243 
00244     anActor->SetPointPicker(myPointPicker.GetPointer());
00245     anActor->SetCellPicker(myCellPicker.GetPointer());
00246 
00247     anActor->SetPointRectPicker(myPointRectPicker.GetPointer());
00248     anActor->SetCellRectPicker(myCellRectPicker.GetPointer());
00249 
00250     anActor->SetPreHighlightProperty(myPreHighlightProperty.GetPointer());
00251     anActor->SetHighlightProperty(myHighlightProperty.GetPointer());
00252 
00253     anActor->AddToRender(GetDevice());
00254     anActor->UpdateNameActors();
00255 
00256     if(theIsAdjustActors)
00257       AdjustActors();
00258   }
00259 }
00260 
00264 void
00265 SVTK_Renderer
00266 ::RemoveActor(VTKViewer_Actor* theActor, bool theIsAdjustActors)
00267 {
00268   if(SALOME_Actor* anActor = dynamic_cast<SALOME_Actor*>(theActor)){
00269     // Order of the calls are important because VTKViewer_Actor::RemoveFromRender
00270     //   can leads do destruction of the actor
00271     anActor->SetInteractor(NULL);
00272     anActor->SetTransform(NULL);
00273     anActor->SetSelector(NULL);
00274 
00275     anActor->SetPointPicker(NULL);
00276     anActor->SetCellPicker(NULL);
00277 
00278     anActor->SetPointRectPicker(NULL);
00279     anActor->SetCellRectPicker(NULL);
00280 
00281     anActor->SetPreHighlightProperty(NULL);
00282     anActor->SetHighlightProperty(NULL);
00283 
00284     anActor->RemoveFromRender(GetDevice());
00285 
00286     if(theIsAdjustActors)
00287       AdjustActors();
00288   }
00289 }
00290 
00294 VTKViewer_Transform* 
00295 SVTK_Renderer
00296 ::GetTransform()
00297 {
00298   return myTransform.GetPointer();
00299 }
00300 
00304 void
00305 SVTK_Renderer
00306 ::GetScale( double theScale[3] ) 
00307 {
00308   myTransform->GetMatrixScale( theScale );
00309 }
00310 
00314 void
00315 SVTK_Renderer
00316 ::SetScale( double theScale[3] ) 
00317 {
00318   myTransform->SetMatrixScale( theScale[0], theScale[1], theScale[2] );
00319   AdjustActors();
00320 
00321   VTK::ActorCollectionCopy aCopy(GetDevice()->GetActors());
00322   vtkActorCollection* anActors = aCopy.GetActors();
00323   anActors->InitTraversal();
00324   while(vtkActor* anAct = anActors->GetNextActor())
00325     if(SALOME_Actor* anActor = dynamic_cast<SALOME_Actor*>(anAct))
00326       if(anActor->isHighlighted() && !anActor->IsInfinitive())
00327         anActor->highlight(true);
00328 }
00329 
00333 void
00334 SVTK_Renderer
00335 ::SetSelectionProp(const double& theRed, 
00336                    const double& theGreen, 
00337                    const double& theBlue, 
00338                    const int& theWidth) 
00339 {
00340   myHighlightProperty->SetColor( theRed, theGreen, theBlue );
00341   myHighlightProperty->SetLineWidth( theWidth );
00342   myHighlightProperty->SetPointSize( theWidth );
00343 }
00344 
00348 void
00349 SVTK_Renderer
00350 ::SetPreselectionProp(const double& theRed, 
00351                       const double& theGreen, 
00352                       const double& theBlue, 
00353                       const int& theWidth) 
00354 {
00355   myPreHighlightProperty->SetColor( theRed, theGreen, theBlue );
00356   myPreHighlightProperty->SetLineWidth( theWidth );
00357   myPreHighlightProperty->SetPointSize( theWidth );
00358 }
00359 
00363 void
00364 SVTK_Renderer
00365 ::SetSelectionTolerance(const double& theTolNodes, 
00366                         const double& theTolCell,
00367                         const double& theTolObjects)
00368 {
00369   myPointPicker->SetTolerance( theTolNodes );
00370   myCellPicker->SetTolerance( theTolCell );
00371 
00372   myPointRectPicker->SetTolerance( theTolNodes );
00373   myCellRectPicker->SetTolerance( theTolCell );
00374 
00375   mySelector->SetTolerance( theTolObjects );
00376 }
00377 
00378 
00383 inline
00384 bool
00385 CheckBndBox(const vtkFloatingPointType theBounds[6])
00386 {
00387   if(theBounds[0] > -VTK_LARGE_FLOAT && theBounds[1] < VTK_LARGE_FLOAT &&
00388      theBounds[2] > -VTK_LARGE_FLOAT && theBounds[3] < VTK_LARGE_FLOAT &&
00389      theBounds[4] > -VTK_LARGE_FLOAT && theBounds[5] < VTK_LARGE_FLOAT)
00390     return true;
00391   return false;
00392 }
00393 
00397 bool
00398 SVTK_Renderer
00399 ::OnAdjustActors()
00400 {
00401   bool aTDisplayed = IsTrihedronDisplayed();
00402   bool aCDisplayed = IsCubeAxesDisplayed();
00403 
00404   vtkFloatingPointType aNewBndBox[6];
00405   aNewBndBox[ 0 ] = aNewBndBox[ 2 ] = aNewBndBox[ 4 ] = VTK_LARGE_FLOAT;
00406   aNewBndBox[ 1 ] = aNewBndBox[ 3 ] = aNewBndBox[ 5 ] = -VTK_LARGE_FLOAT;
00407 
00408   int aVisibleNum = myTrihedron->GetVisibleActorCount(GetDevice());
00409   if(aVisibleNum){
00410     if(aTDisplayed)
00411       myTrihedron->VisibilityOff();
00412 
00413     if(aCDisplayed) 
00414       myCubeAxes->VisibilityOff();
00415 
00416     // if the new trihedron size have sufficient difference, then apply the value
00417     vtkFloatingPointType aSize = myTrihedron->GetSize();
00418     if ( IsTrihedronRelative() )
00419       {
00420         ComputeTrihedronSize(GetDevice(),aSize,aSize,myTrihedronSize);
00421         myTrihedron->SetSize(aSize);
00422       }
00423     else
00424       myTrihedron->SetSize( myTrihedronSize );
00425 
00426     // iterate through displayed objects and set size if necessary
00427     VTK::ActorCollectionCopy aCopy(GetDevice()->GetActors());
00428     vtkActorCollection* anActors = aCopy.GetActors();
00429     anActors->InitTraversal();
00430     while(vtkActor* anAct = anActors->GetNextActor()){
00431       if(SALOME_Actor* anActor = dynamic_cast<SALOME_Actor*>(anAct)){
00432         if(anActor->IsResizable())
00433           anActor->SetSize(0.5*aSize);
00434         if(anActor->GetVisibility() && !anActor->IsInfinitive()){
00435           vtkFloatingPointType *aBounds = anActor->GetBounds();
00436           if(CheckBndBox(aBounds))
00437             for(int i = 0; i < 5; i = i + 2){
00438               if(aBounds[i] < aNewBndBox[i]) 
00439                 aNewBndBox[i] = aBounds[i];
00440               if(aBounds[i+1] > aNewBndBox[i+1]) 
00441                 aNewBndBox[i+1] = aBounds[i+1];
00442             }
00443         }
00444       }
00445     }
00446 
00447     if(aTDisplayed) 
00448       myTrihedron->VisibilityOn();
00449 
00450     if(aCDisplayed) 
00451       myCubeAxes->VisibilityOn();
00452     
00453   }else{
00454     double aSize = myTrihedron->GetSize();
00455     aNewBndBox[0] = aNewBndBox[2] = aNewBndBox[4] = 0;
00456     aNewBndBox[1] = aNewBndBox[3] = aNewBndBox[5] = aSize;
00457   }
00458   
00459   if(CheckBndBox(aNewBndBox)){
00460     for(int i = 0; i < 6; i++)
00461       myBndBox[i] = aNewBndBox[i];
00462     myCubeAxes->SetBounds(myBndBox);
00463     return true;
00464   }
00465 
00466   return false;
00467 }
00468 
00472 void
00473 SVTK_Renderer
00474 ::AdjustActors()
00475 {
00476   if(OnAdjustActors())
00477     ::ResetCameraClippingRange(GetDevice());
00478 }
00479 
00486 void
00487 SVTK_Renderer
00488 ::SetTrihedronSize(vtkFloatingPointType theSize, const bool theRelative)
00489 {
00490   if(myTrihedronSize != theSize || myIsTrihedronRelative != theRelative){
00491     myTrihedronSize = theSize;
00492     myIsTrihedronRelative = theRelative;
00493     AdjustActors();
00494   }
00495 }
00496 
00500 vtkFloatingPointType
00501 SVTK_Renderer
00502 ::GetTrihedronSize() const
00503 {
00504   return myTrihedronSize;
00505 }
00506 
00510 bool 
00511 SVTK_Renderer
00512 ::IsTrihedronRelative() const
00513 {
00514   return myIsTrihedronRelative;
00515 }
00516 
00520 VTKViewer_Trihedron* 
00521 SVTK_Renderer
00522 ::GetTrihedron()
00523 {
00524   return myTrihedron.GetPointer();
00525 }
00526 
00530 bool
00531 SVTK_Renderer
00532 ::IsTrihedronDisplayed()
00533 {
00534   return myTrihedron->GetVisibility() == VTKViewer_Trihedron::eOn;
00535 }
00536 
00540 void 
00541 SVTK_Renderer
00542 ::OnViewTrihedron()
00543 {
00544   if(IsTrihedronDisplayed())
00545     myTrihedron->VisibilityOff();
00546   else
00547     myTrihedron->VisibilityOn();
00548 }
00549 
00553 void
00554 SVTK_Renderer
00555 ::OnAdjustTrihedron()
00556 {   
00557   AdjustActors();
00558 }
00559 
00563 SVTK_CubeAxesActor2D* 
00564 SVTK_Renderer
00565 ::GetCubeAxes()
00566 {
00567   return myCubeAxes.GetPointer();
00568 }
00569 
00573 bool
00574 SVTK_Renderer
00575 ::IsCubeAxesDisplayed()
00576 {
00577   return myCubeAxes->GetVisibility() == 1;
00578 }
00579 
00583 void
00584 SVTK_Renderer
00585 ::OnViewCubeAxes()
00586 {
00587   if(IsCubeAxesDisplayed())
00588     myCubeAxes->VisibilityOff();
00589   else
00590     myCubeAxes->VisibilityOn();
00591 }
00592 
00596 void
00597 SVTK_Renderer
00598 ::OnAdjustCubeAxes()
00599 {   
00600   AdjustActors();
00601 }
00602 
00606 void
00607 SVTK_Renderer
00608 ::OnResetView()
00609 {
00610   int aTrihedronIsVisible = IsTrihedronDisplayed();
00611   int aCubeAxesIsVisible = IsCubeAxesDisplayed();
00612 
00613   myTrihedron->SetVisibility( VTKViewer_Trihedron::eOnlyLineOn );
00614   myCubeAxes->SetVisibility(0);
00615 
00616   ::ResetCamera(GetDevice(),true);  
00617   vtkCamera* aCamera = GetDevice()->GetActiveCamera();
00618   aCamera->SetPosition(1,-1,1);
00619   aCamera->SetViewUp(0,0,1);
00620   ::ResetCamera(GetDevice(),true);  
00621 
00622   if(aTrihedronIsVisible) 
00623     myTrihedron->VisibilityOn();
00624   else
00625     myTrihedron->VisibilityOff();
00626 
00627   if(aCubeAxesIsVisible) 
00628     myCubeAxes->VisibilityOn();
00629   else
00630     myCubeAxes->VisibilityOff();
00631 
00632   static vtkFloatingPointType aCoeff = 3.0;
00633   aCamera->SetParallelScale(aCoeff*aCamera->GetParallelScale());
00634 }
00635 
00639 void
00640 SVTK_Renderer
00641 ::OnFitAll()
00642 {
00643   int aTrihedronWasVisible = false;
00644   int aCubeAxesWasVisible = false;
00645 
00646   aTrihedronWasVisible = IsTrihedronDisplayed();
00647   if(aTrihedronWasVisible)
00648     myTrihedron->VisibilityOff();
00649 
00650   aCubeAxesWasVisible = IsCubeAxesDisplayed();
00651   if(aCubeAxesWasVisible)
00652     myCubeAxes->VisibilityOff();
00653 
00654   if(myTrihedron->GetVisibleActorCount(GetDevice())){
00655     myTrihedron->VisibilityOff();
00656     myCubeAxes->VisibilityOff();
00657     ::ResetCamera(GetDevice());
00658   }else{
00659     myTrihedron->SetVisibility(VTKViewer_Trihedron::eOnlyLineOn);
00660     myCubeAxes->SetVisibility(2);
00661     ::ResetCamera(GetDevice(),true);
00662   }
00663 
00664   if(aTrihedronWasVisible)
00665     myTrihedron->VisibilityOn();
00666   else
00667     myTrihedron->VisibilityOff();
00668   
00669   if(aCubeAxesWasVisible)
00670     myCubeAxes->VisibilityOn();
00671   else
00672     myCubeAxes->VisibilityOff();
00673 
00674   ::ResetCameraClippingRange(GetDevice());
00675 }
00676 
00680 void
00681 SVTK_Renderer
00682 ::OnResetClippingRange()
00683 {
00684   return;
00685   ::ResetCameraClippingRange(GetDevice());
00686 }
00687 
00691 void
00692 SVTK_Renderer
00693 ::OnFrontView()
00694 {
00695   vtkCamera* aCamera = GetDevice()->GetActiveCamera();
00696   aCamera->SetPosition(1,0,0);
00697   aCamera->SetViewUp(0,0,1);
00698   aCamera->SetFocalPoint(0,0,0);
00699   this->OnFitAll();
00700 }
00701 
00705 void
00706 SVTK_Renderer
00707 ::OnBackView()
00708 {
00709   vtkCamera* aCamera = GetDevice()->GetActiveCamera();
00710   aCamera->SetPosition(-1,0,0);
00711   aCamera->SetViewUp(0,0,1);
00712   aCamera->SetFocalPoint(0,0,0);
00713   this->OnFitAll();
00714 }
00715 
00719 void
00720 SVTK_Renderer
00721 ::OnTopView()
00722 {
00723   vtkCamera* aCamera = GetDevice()->GetActiveCamera();
00724   aCamera->SetPosition(0,0,1);
00725   aCamera->SetViewUp(0,1,0);
00726   aCamera->SetFocalPoint(0,0,0);
00727   this->OnFitAll();
00728 }
00729 
00733 void
00734 SVTK_Renderer
00735 ::OnBottomView()
00736 {
00737   vtkCamera* aCamera = GetDevice()->GetActiveCamera();
00738   aCamera->SetPosition(0,0,-1);
00739   aCamera->SetViewUp(0,1,0);
00740   aCamera->SetFocalPoint(0,0,0);
00741   this->OnFitAll();
00742 }
00743 
00747 void
00748 SVTK_Renderer
00749 ::OnLeftView()
00750 {
00751   vtkCamera* aCamera = GetDevice()->GetActiveCamera(); 
00752   aCamera->SetPosition(0,-1,0);
00753   aCamera->SetViewUp(0,0,1);
00754   aCamera->SetFocalPoint(0,0,0);
00755   this->OnFitAll();
00756 }
00757 
00758 
00762 void
00763 SVTK_Renderer
00764 ::onClockWiseView()
00765 {
00766   vtkCamera* aCamera = GetDevice()->GetActiveCamera(); 
00767   aCamera->Roll(-90);
00768   aCamera->OrthogonalizeViewUp();
00769 }
00770 
00774 void
00775 SVTK_Renderer
00776 ::onAntiClockWiseView()
00777 {
00778   vtkCamera* aCamera = GetDevice()->GetActiveCamera(); 
00779   aCamera->Roll(90);
00780   aCamera->OrthogonalizeViewUp();
00781 }
00782 
00786 void
00787 SVTK_Renderer
00788 ::OnRightView()
00789 {
00790   vtkCamera* aCamera = GetDevice()->GetActiveCamera();
00791   aCamera->SetPosition(0,1,0);
00792   aCamera->SetViewUp(0,0,1);
00793   aCamera->SetFocalPoint(0,0,0);
00794   this->OnFitAll();
00795 }