vtkInteractorStyleBaseView3D.cxx

Go to the documentation of this file.
00001 
00002 #include "vtkInteractorStyleBaseView3D.h"
00003 
00004 #include "vtkObjectFactory.h"
00005 
00006 vtkStandardNewMacro(vtkInteractorStyleBaseView3D);
00007 
00008 //---------------------------------------------------------------------------
00009 vtkInteractorStyleBaseView3D::vtkInteractorStyleBaseView3D(){
00010 }
00011 //---------------------------------------------------------------------------
00012 vtkInteractorStyleBaseView3D::~vtkInteractorStyleBaseView3D(){
00013 }
00014 //---------------------------------------------------------------------------
00015 void  vtkInteractorStyleBaseView3D::OnRightButtonDown ()
00016 {    
00017         vtkInteractorStyleBaseView::OnRightButtonDown();
00018 
00019 /*
00020                 if (GetInteractor()->GetControlKey()==1 ){
00021                         this->vtkInteractorStyleTrackballCamera::OnRightButtonDown();
00022                 }
00023 */
00024   this->FindPokedRenderer(this->Interactor->GetEventPosition()[0], 
00025                           this->Interactor->GetEventPosition()[1]);
00026 
00027   if (this->CurrentRenderer == NULL)
00028     {
00029     return;
00030     }
00031 
00032   if (this->Interactor->GetControlKey()) {
00033       this->StartDolly();
00034   }
00035 
00036 }
00037 //---------------------------------------------------------------------------
00038 void  vtkInteractorStyleBaseView3D::OnRightButtonUp () 
00039 {
00040         vtkInteractorStyleBaseView::OnRightButtonUp();
00041 
00042 /*
00043                 if (GetInteractor()->GetControlKey()==1 ){
00044                         this->vtkInteractorStyleTrackballCamera::OnRightButtonUp();
00045                 }
00046 */
00047 
00048                 
00049   switch (this->State) 
00050     {
00051     case VTKIS_DOLLY:
00052       this->EndDolly();
00053       break;
00054     }
00055 }
00056 //---------------------------------------------------------------------------
00057 void  vtkInteractorStyleBaseView3D::OnMouseMove () 
00058 {
00059         vtkInteractorStyleBaseView::OnMouseMove();
00060 
00061 //              this->vtkInteractorStyleTrackballCamera::OnMouseMove();
00062 
00063  // int x = this->Interactor->GetEventPosition()[0]; // JPRx
00064  // int y = this->Interactor->GetEventPosition()[1]; // JPRx
00065 
00066 
00067  // vtkRenderWindowInteractor *rwi = this->Interactor;
00068 
00069  // int lx =  rwi->GetLastEventPosition()[0]; // JPRx
00070  // int ly =  rwi->GetLastEventPosition()[1]; // JPRx
00071  // int dx = rwi->GetEventPosition()[0] ; // JPRx
00072  // int dy = rwi->GetEventPosition()[1] ; // JPRx
00073 
00074 
00075   switch (this->State) 
00076     {
00077     case VTKIS_ROTATE:
00078  //     this->FindPokedRenderer(x, y);
00079       this->Rotate();
00080  //     this->InvokeEvent(vtkCommand::InteractionEvent, NULL);
00081       break;
00082 
00083     case VTKIS_PAN:
00084  //     this->FindPokedRenderer(x, y);
00085       this->Pan();
00086  //     this->InvokeEvent(vtkCommand::InteractionEvent, NULL);
00087       break;
00088 
00089     case VTKIS_DOLLY:
00090  //     this->FindPokedRenderer(x, y);
00091       this->Dolly();
00092  //     this->InvokeEvent(vtkCommand::InteractionEvent, NULL);
00093       break;
00094 
00095     case VTKIS_SPIN:
00096  //     this->FindPokedRenderer(x, y);
00097       this->Spin();
00098  //     this->InvokeEvent(vtkCommand::InteractionEvent, NULL);
00099       break;
00100     }
00101 
00102 
00103 
00104 }
00105 //---------------------------------------------------------------------------
00106 void vtkInteractorStyleBaseView3D::OnLeftButtonDown()
00107 {
00108         printf("EED creaMaracasVisu::vtkInteractorStyleBaseView3D::OnLeftButtonDown \n");
00109         vtkInteractorStyleBaseView::OnLeftButtonDown();
00110 /*
00111                 if (GetInteractor()->GetControlKey()==1 ){
00112                         this->vtkInteractorStyleTrackballCamera::OnMiddleButtonDown();
00113                 } else {
00114                         this->vtkInteractorStyleTrackballCamera::OnLeftButtonDown();
00115                 }
00116 */
00117 
00118 
00119   this->FindPokedRenderer(this->Interactor->GetEventPosition()[0], 
00120                           this->Interactor->GetEventPosition()[1]);
00121   if (this->CurrentRenderer == NULL)
00122     {
00123     return;
00124     }
00125 
00126   if (this->Interactor->GetControlKey()) {
00127       this->StartPan();
00128   } else {
00129       this->StartRotate();
00130   }
00131 
00132  /* 
00133   if (this->Interactor->GetShiftKey()) 
00134     {
00135     if (this->Interactor->GetControlKey()) 
00136       {
00137       this->StartDolly();
00138       }
00139     else 
00140       {
00141       this->StartPan();
00142       }
00143     } 
00144   else 
00145     {
00146     if (this->Interactor->GetControlKey()) 
00147       {
00148       this->StartSpin();
00149       }
00150     else 
00151       {
00152       this->StartRotate();
00153       }
00154     }
00155 */
00156 
00157 
00158 }
00159 //---------------------------------------------------------------------------
00160 void  vtkInteractorStyleBaseView3D::OnLeftButtonUp () 
00161 {
00162         vtkInteractorStyleBaseView::OnLeftButtonUp();
00163 
00164 /*
00165                 if (GetInteractor()->GetControlKey()==1 ){
00166                         this->vtkInteractorStyleTrackballCamera::OnMiddleButtonUp();
00167                 } else {
00168                         this->vtkInteractorStyleTrackballCamera::OnLeftButtonUp();
00169                 }
00170 */
00171   switch (this->State) 
00172     {
00173 
00174     case VTKIS_PAN:
00175       this->EndPan();
00176       break;
00177 
00178     case VTKIS_ROTATE:
00179       this->EndRotate();
00180       break;
00181     }
00182 }
00183 //---------------------------------------------------------------------------
00184 void  vtkInteractorStyleBaseView3D::OnMiddleButtonDown () 
00185 {
00186         vtkInteractorStyleBaseView::OnMiddleButtonDown();
00187         //              this->vtkInteractorStyleTrackballCamera::OnMiddleButtonDown();
00188 }
00189 //---------------------------------------------------------------------------
00190 void  vtkInteractorStyleBaseView3D::OnMiddleButtonUp () 
00191 {
00192         vtkInteractorStyleBaseView::OnMiddleButtonUp();
00193 
00194         //              this->vtkInteractorStyleTrackballCamera::OnMiddleButtonUp();
00195 }

Generated on 20 Oct 2010 for creaMaracasVisu_lib by  doxygen 1.6.1