Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members

mitkManipulator.h

00001 /*=========================================================================
00002 
00003   Program:   3DMed
00004   Date:      $Date: 2014-02-25 18:30:00 +0800 $
00005   Version:   $Version: 4.6.0 $
00006   Copyright: MIPG, Institute of Automation, Chinese Academy of Sciences
00007 
00008 =========================================================================*/
00009 
00010 
00011 #ifndef __mitkManipulator_h
00012 #define __mitkManipulator_h
00013 
00014 #include "mitkObject.h"
00015 #include "mitkTrackBall.h"
00016 #include "mitkVisualizationIncludes.h"
00017 
00018 class mitkView;
00019 class mitkScene;
00020 
00028 class MITK_VISUALIZATION_API mitkManipulator : public mitkObject
00029 {
00030 public:
00031     MITK_TYPE(mitkManipulator,mitkObject)
00032 
00033     virtual void PrintSelf(ostream& os);    
00034 
00035     mitkManipulator();
00036     mitkManipulator(mitkScene *scene);
00037     mitkManipulator(mitkView *view);
00038 
00047     void OnMouseDown(int mouseButton, bool ctrlDown, bool shiftDown, int xPos, int yPos);
00048 
00057     void OnMouseUp(int mouseButton, bool ctrlDown, bool shiftDown, int xPos, int yPos);
00058 
00066     void OnMouseMove(bool ctrlDown, bool shiftDown, int xPos, int yPos);
00067 
00076     void OnMouseWheel(bool ctrlDown, bool shiftDown, int xPos, int yPos, int delta);
00077 
00082     void SetScene(mitkScene *scene);
00083 
00088     void SetView(mitkView *view);
00089 
00096     void EnableLoD(bool enable=true) { m_EnableLoD = enable; }
00097 
00102     bool IsLoDEnabled() { return m_EnableLoD; }
00103 
00104 protected:
00105     virtual ~mitkManipulator();
00106 
00107     // override these 3 functions in sub-classes
00108     virtual void _onMouseDown(int mouseButton, bool ctrlDown, bool shiftDown, int xPos, int yPos) = 0;
00109     virtual void _onMouseUp(int mouseButton, bool ctrlDown, bool shiftDown, int xPos, int yPos) = 0;
00110     virtual void _onMouseMove(bool ctrlDown, bool shiftDown, int xPos, int yPos) = 0;
00111     virtual void _onMouseWheel(bool ctrlDown, bool shiftDown, int xPos, int yPos, int delta) {}
00112     
00113     mitkTrackBall m_TrackBall;
00114 
00115     mitkView *m_View;
00116     mitkScene *m_Scene;
00117     int  m_OldX[3];
00118     int  m_OldY[3];
00119     bool m_ButtonDown[3];
00120     bool m_EnableLoD;
00121 
00122 private:
00123     mitkManipulator(const mitkManipulator&);
00124     void operator=(const mitkManipulator&);
00125 };
00126 
00127  
00128 //#define DEFINED_mitkManipulator
00129  
00130 
00131 
00132 #endif
00133 
00134 

Generated on Tue Feb 25 15:00:37 2014 for MITK (Medical Imaging ToolKit) by  doxygen 1.4.3