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

mitkCUDAValueBasedStateVRScene.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 __mitkCUDAValueBasedStateVRScene_h
00011 #define __mitkCUDAValueBasedStateVRScene_h
00012 
00013 #include "mitkRCPtr.h"
00014 #include "mitkVis2Scene3D.h"
00015 #include "mitkCUDAVolumeRenderingIncludes.h"
00016 
00017 #include "modules/StateRayCaster/mitkCUDAValueBasedStateVR.h"
00018 #include "modules/StateRayCaster/mitkCUDAValueBasedBackwardsTest.h"
00019 #include "modules/mitkCUDASegmentedVolumeLut.h"
00020 
00021 #include "mitkICVolume.h"
00022 #include "mitkRGBATransferFunction1D.h"
00023 
00024 #include "mitkPerformanceCounter.h"
00025 
00026 class mitkSegmentedVolumeLut;
00027 
00031 class MITK_CUDA_VOLUME_RENDERING_API mitkCUDAValueBasedStateVRScene : public mitkVis2Scene3D
00032 {
00033 public:
00034     MITK_TYPE(mitkCUDAValueBasedStateVRScene,mitkVis2Scene3D)
00035     mitkCUDAValueBasedStateVRScene();
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 
00073     void SetMaxLayer(int maxLayer);
00074 
00079     int GetMaxLayer();
00080 
00087     void SetStateController(int id, int less_more, float value);
00088 
00095     void GetStateController(int id, int &less_more, float &value);
00096 
00101     void SetThicknessThreshold(float thincknessThresh);
00102 
00107     float GetThicknessThreshold();
00108 
00113     mitkRGBATransferFunction1D* GetTransferFunction(int index);
00114 
00119     void SetTransferFunction(int index, mitkRGBATransferFunction1D* tf);
00120 
00126     void SetStdSampleDistance(float stdSampleDistance);
00127 
00133     float GetStdSampleDistance();
00134 
00139     void SetShade(bool shade);
00140     
00145     bool GetShade();
00146 
00150     void ShadeOn();
00151     
00155     void ShadeOff();
00156 
00163     void SetLightDirection(float x,float y,float z);
00164     
00171     void GetLightDirection(float &x,float &y,float &z);
00172 
00177     void SetLightIntensity(float intensity);
00178     
00185     void SetLightColor(float r,float g,float b);
00186 
00191     void SetAmbient(float value);
00192     
00197     float GetAmbient();
00198 
00203     void SetDiffuse(float value);
00204     
00209     float GetDiffuse();
00210 
00215     void SetSpecular(float value);
00216     
00221     float GetSpecular();
00222 
00227     void SetSpecularPower(float value);
00228     
00233     float GetSpecularPower();
00234 
00239     void RotateLightDirection(bool turnOn);
00240 
00244     virtual void OnMouseDown(int mouseButton, bool ctrlDown, bool shiftDown, int xPos, int yPos);
00248     virtual void OnMouseUp(int mouseButton, bool ctrlDown, bool shiftDown, int xPos, int yPos);
00252     virtual void OnMouseMove(bool ctrlDown, bool shiftDown, int xPos, int yPos);
00253 
00258     void SetIllustrativeShading(int illustrative);
00259 
00264     bool GetIllustrativeShading();
00265 
00271     void SetLayerShadingMode(int layer, ShadingMode mode);
00272 
00277     void SetCroppingBounds(const float CroppingBounds[6]);
00278 
00283     void GetCroppingBounds(float CroppingBounds[6]);
00284 
00289     void SetBackwardsTest(bool test) { m_BackwardsTest=test; }
00290 
00295     bool GetBackwardsTest() { return m_BackwardsTest; }
00296 
00297     mitkCUDAValueBasedStateVR& GetKernelModule() { return m_module; }
00298 
00299 
00300 protected:
00301     virtual ~mitkCUDAValueBasedStateVRScene();
00302     virtual void GetSize3D(float size[3]);
00303 
00304 private:
00305     mitkCUDAValueBasedStateVRScene(const mitkCUDAValueBasedStateVRScene&);
00306     void operator = (const mitkCUDAValueBasedStateVRScene&);
00307 
00308 private:
00309     mitkRCPtr<mitkICVolume> m_Data;
00310     mitkRCPtr<mitkRGBATransferFunction1D>* m_TFs;
00311     mitkLocalVersion* m_TFVersions;
00312 
00313     int m_SampleNumber;
00314 
00315     mitkSegmentedVolumeLut *m_CPU_LUT;
00316 
00317     // control
00318     int* m_less_more;
00319     float* m_value;
00320 
00321     mitkCUDAValueBasedStateVR m_module;
00322     mitkCUDAValueBasedBackwardsTest m_backwards;
00323 
00324     
00325     bool m_glewInit;
00326     bool m_dataModified;
00327     bool m_controllerModified;
00328 
00329     bool m_RotateLightDirection;
00330     bool m_RotatingLightDirection;
00331 
00332     mitkVis2Vector4 m_OldLightDirection;
00333 
00334     bool m_BackwardsTest;
00335 
00336     TimeAverager m_TimeAverager1,m_TimeAverager2;
00337 };
00338 
00339 #endif

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