vtkSlicerViewerInteractorStyle.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkInteractorStyleTrackballCamera.h,v $
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00019 //
00030 
00034 
00035 #ifndef __vtkSlicerViewerInteractorStyle_h
00036 #define __vtkSlicerViewerInteractorStyle_h
00037 
00038 #include "vtkSlicerBaseGUIWin32Header.h"
00039 
00040 #include "vtkObject.h"
00041 #include "vtkInteractorStyle.h"
00042 
00043 #include "vtkMRML.h"
00044 #include "vtkMRMLCameraNode.h"
00045 #include "vtkSlicerApplicationLogic.h"
00046 
00047 class vtkSlicerViewerWidget;
00048 class VTK_SLICER_BASE_GUI_EXPORT vtkSlicerViewerInteractorStyle : public vtkInteractorStyle
00049 {
00050 public:
00051   static vtkSlicerViewerInteractorStyle *New();
00052   vtkTypeRevisionMacro(vtkSlicerViewerInteractorStyle,vtkInteractorStyle);
00053   void PrintSelf(ostream& os, vtkIndent indent);
00054 
00055   vtkGetObjectMacro (ApplicationLogic, vtkSlicerApplicationLogic );
00056   vtkSetObjectMacro (ApplicationLogic, vtkSlicerApplicationLogic );
00057 
00061   virtual void OnMouseMove();
00062   virtual void OnLeftButtonDown();
00063   virtual void OnLeftButtonUp();
00064   virtual void OnMiddleButtonDown();
00065   virtual void OnMiddleButtonUp();
00066   virtual void OnRightButtonDown();
00067   virtual void OnRightButtonUp();
00068   virtual void OnMouseWheelForward();
00069   virtual void OnMouseWheelBackward();
00070 
00075   virtual void Rotate();
00076   virtual void Spin();
00077   virtual void Pan();
00078   virtual void Dolly();
00079   virtual void Dolly(double factor);
00080 
00081   virtual void OnEnter();
00082   virtual void OnLeave();
00083   virtual void OnExpose();
00084 
00085 
00088   vtkGetObjectMacro ( CameraNode, vtkMRMLCameraNode );
00089   vtkSetObjectMacro ( CameraNode, vtkMRMLCameraNode );
00090 
00091   // Description:
00092   // Get the number of mouse 'pick' events
00093   vtkGetMacro (NumberOfPicks, int);
00094 
00095   // Description:
00096   // Get the max number of 'pick' events 
00097   // allowed before interaction mode switches
00098   // back to 'transform'.
00099   vtkGetMacro (NumberOfTransientPicks, int );
00100 
00101   // Description:
00102   // Get the number of mouse 'place' events
00103   vtkGetMacro (NumberOfPlaces, int);
00104 
00105   // Description:
00106   // Get the max number of 'place' events 
00107   // allowed before interaction mode switches
00108   // back to 'transform'.
00109   vtkGetMacro ( NumberOfTransientPlaces, int );
00110 
00111   
00114   vtkGetObjectMacro(ViewerWidget, vtkSlicerViewerWidget);
00115   virtual void SetViewerWidget(vtkSlicerViewerWidget *viewerWidget);
00116 
00119   //BTX
00120   enum
00121   {
00122       PickEvent,
00123       PlaceEvent,
00124       SelectRegionEvent,
00125       PlotEvent,
00126   };
00127   //ETX
00128     
00129 protected:
00130   vtkSlicerViewerInteractorStyle();
00131   ~vtkSlicerViewerInteractorStyle();
00132 
00133   vtkMRMLCameraNode *CameraNode;
00134   vtkSlicerApplicationLogic *ApplicationLogic;
00135 
00136   double MotionFactor;
00137   // Description:
00138   // Keep track of the number of picks
00139   // so for resetting mouse modes when
00140   // transient pick or place mode has
00141   // been selected.
00142   int NumberOfPicks;
00143   int NumberOfPlaces;
00144   // Description:
00145   // The number of "clicks" the transient
00146   // mouse-modes come loaded with.
00147   // Currently makes sense to set this to
00148   // 1 -- but we can change it if appropriate.
00149   int NumberOfTransientPicks;
00150   int NumberOfTransientPlaces;
00151 
00154   vtkSlicerViewerWidget *ViewerWidget;
00155   
00156 private:
00157   vtkSlicerViewerInteractorStyle(const vtkSlicerViewerInteractorStyle&);  
00158   void operator=(const vtkSlicerViewerInteractorStyle&);  
00159 };
00160 
00161 #endif

Generated on 6 Apr 2011 for Slicer3 by  doxygen 1.6.1