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

mitkImageScene.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 __mitkImageScene_h
00012 #define __mitkImageScene_h
00013 
00014 #include "mitkScene.h"
00015 #include "mitkRCPtr.h"
00016 #include "mitkVolume.h"
00017 
00039 class MITK_VISUALIZATION_API mitkImageScene : public mitkScene
00040 {
00041 public:
00042     MITK_TYPE(mitkImageScene,mitkScene)
00043 
00044     mitkImageScene();
00045     mitkImageScene(mitkSceneContainer* container);
00046 
00050     virtual void InitGL();
00054     virtual void ResizeGL(int newX, int newY); 
00058     virtual void RenderGL();
00063     virtual mitkManipulator* CreateManipulator();   
00083     void GetDataValueAndCoordinate(int mIdx, int x, int y, int &vx, int &vy, int &vz, float &rValue, float &gValue, float &bValue);
00097     void GetVolumeCoordinate(int mIdx, int x, int y, int &vx, int &vy, int &vz);
00108     void GetViewCoordinate(int mIdx, int vx, int vy, int vz, int &sx, int &sy);
00114     void AdjustWidthCenter(float deltX, float deltY);
00119     float GetWindowWidth();
00124     float GetWindowCenter();
00129     void SetWindowWidth(float winWidth);
00134     void SetWindowCenter(float winCenter);
00138     void ResetWindowWidthCenter();
00143     void EnableCrossArrow() {m_CrossArrowEnabled = true;}
00148     void DisableCrossArrow() {m_CrossArrowEnabled = false;}
00155     void SetCrossArrow(bool isEnabled) {m_CrossArrowEnabled = isEnabled;}
00162     bool GetCrossArrow()  {return m_CrossArrowEnabled;}
00167     void SetCrossArrowWidth(int width) {m_CrossArrowWidth = width;}
00172     void SetCrossArrowHeight(int height) {m_CrossArrowHeight = height;}
00177     int GetCrossArrowWidth()  {return m_CrossArrowWidth;}
00182     int GetCrossArrowHeight() {return m_CrossArrowHeight;}  
00187     void SetCrossArrowPositionX(float xPos) {m_CrossArrowPosition[0] = xPos;}
00192     void SetCrossArrowPositionY(float yPos) {m_CrossArrowPosition[1] = yPos;}
00200     void SetCrossArrowPosition(int mIdx, int vx, int vy);
00205     float GetCrossArrowPositionX() {return m_CrossArrowPosition[0];}
00210     float GetCrossArrowPositionY() {return m_CrossArrowPosition[1];}    
00214     void ResetCrossArrowPosition();
00218     virtual void ResetScene();
00225     virtual void Translate(float deltX, float deltY, float deltZ = 0);
00233     virtual void Rotate(float deltX, float deltY, float deltZ);
00242     virtual void Rotate(float ax, float ay, float az, float angle) {};
00248     virtual void Rotate(const mitkQuaternion &q) {};
00255     virtual void SetRotation(float x, float y, float z);
00263     virtual void SetRotation(float ax, float ay, float az, float angle) {};
00268     virtual void SetRotation(const mitkQuaternion &q) {};
00274     virtual void Scale(float delt);
00275     
00276 protected:
00277     virtual ~mitkImageScene();   
00278     void    _drawCrossArrow();
00279 
00280     bool m_CrossArrowEnabled;
00281     int m_CrossArrowWidth;
00282     int m_CrossArrowHeight;
00283     float m_CrossArrowPosition[2];
00284     
00285 
00286 private:
00287     void _init();
00288     void _cleanUp();
00289     
00290 
00291     mitkImageScene(const mitkImageScene&);
00292     void operator=(const mitkImageScene&);
00293 
00294 };
00295 
00296 //inline void mitkImageScene::GetObjectCoordinate(int x, int y, float &ox, float &oy)
00297 //{
00298 //  float invScale = 1.0f / m_Scale;
00299 //  ox = (2.0f * (x - m_ScenePort[0]) / m_ScenePort[2] - 1.0f - m_TransX) * invScale;
00300 //  oy = (2.0f * (y - m_ScenePort[1]) / m_ScenePort[3] - 1.0f + m_TransY) * invScale;
00301 //}
00302 //
00303 //inline void mitkImageScene::GetObjectCoordinateDelta(int dx, int dy, float &odx, float &ody)
00304 //{
00305 //  float invScale = 1.0f / m_Scale;
00306 //  odx = 2.0f * dx * invScale / m_ScenePort[2];
00307 //  ody = - 2.0f * dy * invScale / m_ScenePort[3];
00308 //}
00309 
00310  
00311 //#define DEFINED_mitkImageScene
00312  
00313 
00314 
00315 #endif
00316 

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