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

mitkCUDADeltaAccStateVRScene.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 __mitkCUDADeltaAccStateVRScene_h
00011 #define __mitkCUDADeltaAccStateVRScene_h
00012 
00013 #include "mitkRCPtr.h"
00014 #include "mitkVis2Scene3D.h"
00015 #include "mitkCUDAVolumeRenderingIncludes.h"
00016 
00017 #include "modules/StateRayCaster/mitkCUDADeltaAccStateVR.h"
00018 #include "modules/StateRayCaster/mitkCUDADeltaAccBackwardsTest.h"
00019 
00020 #include "mitkICVolume.h"
00021 #include "mitkRGBATransferFunction1D.h"
00022 #include "modules/mitkCUDASegmentedVolumeLut.h"
00023 
00024 #include "mitkPerformanceCounter.h"
00025 
00026 class mitkSegmentedVolumeLut;
00027 
00031 class MITK_CUDA_VOLUME_RENDERING_API mitkCUDADeltaAccStateVRScene : public mitkVis2Scene3D
00032 {
00033 public:
00034     MITK_TYPE(mitkCUDADeltaAccStateVRScene,mitkVis2Scene3D)
00035     mitkCUDADeltaAccStateVRScene();
00036 
00040     virtual void RenderGL();
00041 
00046     void SetData(mitkICVolume *data);
00047 
00051     void SetDataModified();
00052 
00059     void SetBackGroundColor(float r,float g, float b);
00060 
00067     void GetBackGroundColor(float &r,float &g, float &b);
00068 
00069     void SetMaxLayer(int maxLayer);
00070     int GetMaxLayer();
00071     void SetStateController(int id, float value);
00072     void GetStateController(int id, float &value);
00073 
00078     mitkRGBATransferFunction1D* GetTransferFunction(int index);
00079 
00084     void SetTransferFunction(int index, mitkRGBATransferFunction1D* tf);
00085 
00091     void SetStdSampleDistance(float stdSampleDistance);
00092 
00098     float GetStdSampleDistance();
00099 
00104     void SetShade(bool shade);
00105     
00110     bool GetShade();
00111 
00115     void ShadeOn();
00116     
00120     void ShadeOff();
00121 
00128     void SetLightDirection(float x,float y,float z);
00129     
00136     void GetLightDirection(float &x,float &y,float &z);
00137 
00142     void SetLightIntensity(float intensity);
00143     
00150     void SetLightColor(float r,float g,float b);
00151 
00156     void SetAmbient(float value);
00157     
00162     float GetAmbient();
00163 
00168     void SetDiffuse(float value);
00169     
00174     float GetDiffuse();
00175 
00180     void SetSpecular(float value);
00181     
00186     float GetSpecular();
00187 
00192     void SetSpecularPower(float value);
00193     
00198     float GetSpecularPower();
00199 
00204     void RotateLightDirection(bool turnOn);
00205 
00209     virtual void OnMouseDown(int mouseButton, bool ctrlDown, bool shiftDown, int xPos, int yPos);
00213     virtual void OnMouseUp(int mouseButton, bool ctrlDown, bool shiftDown, int xPos, int yPos);
00217     virtual void OnMouseMove(bool ctrlDown, bool shiftDown, int xPos, int yPos);
00218 
00223     void SetIllustrativeShading(int illustrative);
00224 
00229     bool GetIllustrativeShading();
00230 
00236     void SetLayerShadingMode(int layer, ShadingMode mode);
00237 
00242     void SetCroppingBounds(const float CroppingBounds[6]);
00243 
00248     void GetCroppingBounds(float CroppingBounds[6]);
00249 
00254     void SetBackwardsTest(bool test) { m_BackwardsTest=test; }
00255 
00260     bool GetBackwardsTest() { return m_BackwardsTest; }
00261 
00262     mitkCUDADeltaAccStateVR& GetKernelModule() { return m_module; }
00263 
00264 protected:
00265     virtual ~mitkCUDADeltaAccStateVRScene();
00266     virtual void GetSize3D(float size[3]);
00267 
00268 private:
00269     mitkCUDADeltaAccStateVRScene(const mitkCUDADeltaAccStateVRScene&);
00270     void operator = (const mitkCUDADeltaAccStateVRScene&);
00271 
00272 private:
00273     mitkRCPtr<mitkICVolume> m_Data;
00274     mitkRCPtr<mitkRGBATransferFunction1D>* m_TFs;
00275     mitkLocalVersion* m_TFVersions;
00276 
00277     int m_SampleNumber;
00278 
00279     mitkSegmentedVolumeLut *m_CPU_LUT;
00280 
00281     // control
00282     float* m_value;
00283     
00284     mitkCUDADeltaAccStateVR m_module;
00285     mitkCUDADeltaAccBackwardsTest m_backwards;
00286     
00287     bool m_glewInit;
00288     bool m_dataModified;
00289     bool m_controllerModified;
00290 
00291     bool m_RotateLightDirection;
00292     bool m_RotatingLightDirection;
00293 
00294     mitkVis2Vector4 m_OldLightDirection;
00295 
00296     bool m_BackwardsTest;
00297 
00298     TimeAverager m_TimeAverager1,m_TimeAverager2;
00299 };
00300 
00301 #endif

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