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

mitkSceneParam.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 #ifndef __mitkSceneParam_h
00011 #define __mitkSceneParam_h
00012 
00013 #include "mitkVisualization2Includes.h"
00014 #include "mitkVis2Quaternion.h"
00015 
00019 class MITK_VISUALIZATION2_API mitkSceneParam
00020 {
00021 public:
00022     float m_Fovy, m_AspectRatio;
00023     float m_Near, m_Far;
00024     
00025     float m_ZTranslateBase;
00026     float m_Translate[3];
00027     float m_Scale;
00028     mitkVis2Quaternion m_Rotation;  
00029 
00030 
00031     mitkSceneParam();
00032     mitkSceneParam(float fovy, float aspectRatio, const float* size3D);
00033 
00034     ~mitkSceneParam(){}
00035 
00037     void InitSceneParam(const float* size3D);
00038     void InitSceneParam(float radius);
00039 
00040     void InitSceneParam(float fovy, float aspectRatio, const float* size3D);
00041 
00042     void CalculateViewMatrix(mitkVis2Matrix4x4* ViewMatrix) const;
00043     void CalculateProjectionMatrix(mitkVis2Matrix4x4* ProjectionMatrix) const;
00044     void CalculateMatrix(mitkVis2Matrix4x4* ViewMatrix, mitkVis2Matrix4x4* ProjectionMatrix) const;
00045 
00046     void MakeReference();
00047 
00048     void Translate(int dx, int dy, const int* viewportSize);
00049     void Rotate(int dx, int dy, float radPerPixel);
00050     void Scale(int dy, float scaleRatePerPixel);
00051 
00052     void MoveTo(float x,float y, float z, const float* size3D); // volume coordinate
00053 
00054     void Move(float dx, float dy, float dz); // view coordinate, volume scale
00055     void Turn(float dx, float dy);
00056     void Roll(float rad);
00057 
00058 private:
00059     float m_OldTranslate[3];
00060     float m_OldScale;
00061     mitkVis2Quaternion m_OldRotation;   
00062 
00063 };
00064 
00065 #endif

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