00001
00002
00003
00004
00005
00006
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);
00053
00054 void Move(float dx, float dy, float dz);
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