00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef __mitkCUDADecomposedIsosurfaceVRScene_h
00011 #define __mitkCUDADecomposedIsosurfaceVRScene_h
00012
00013 #include "mitkRCPtr.h"
00014 #include "mitkVis2Scene3D.h"
00015 #include "mitkCUDAVolumeRenderingIncludes.h"
00016 #include "modules/mitkCUDADecomposedSurfaceVR.h"
00017 #include "mitkICVolume.h"
00018 #include "mitkRGBATransferFunction1D.h"
00019
00023 class MITK_CUDA_VOLUME_RENDERING_API mitkCUDADecomposedIsosurfaceVRScene : public mitkVis2Scene3D
00024 {
00025 struct PeelingWidget;
00026 class PeelingWidgetList;
00027 public:
00028 MITK_TYPE(mitkCUDADecomposedIsosurfaceVRScene,mitkVis2Scene3D)
00029 mitkCUDADecomposedIsosurfaceVRScene();
00030
00034 virtual void RenderGL();
00035
00036 void SetBlockSize(int bsizeX, int bsizeY, int bsizeZ);
00037
00042 void SetData(mitkICVolume *data);
00043
00047 void SetDataModified();
00048
00055 void SetBackGroundColor(float r,float g, float b);
00056
00063 void GetBackGroundColor(float& r,float& g,float& b);
00064
00069 void SetIsovalue(float isovalue);
00070
00075 float GetIsovalue();
00076
00083 void SetLightDirection(float x,float y,float z);
00084
00091 void GetLightDirection(float &x,float &y,float &z);
00092
00097 void SetLightIntensity(float intensity);
00098
00105 void SetLightColor(float r,float g,float b);
00106
00111 void SetAmbient(float value);
00112
00117 float GetAmbient();
00118
00123 void SetDiffuse(float value);
00124
00129 float GetDiffuse();
00130
00135 void SetSpecular(float value);
00136
00141 float GetSpecular();
00142
00147 void SetSpecularPower(float value);
00148
00153 float GetSpecularPower();
00154
00159 void SetDensityFactor(float densityFactor);
00160
00165 float GetDensityFactor();
00166
00171 mitkRGBATransferFunction1D* GetTransferFunction();
00172
00177 void SetTransferFunction(mitkRGBATransferFunction1D* tf);
00178
00183 void RotateLightDirection(bool turnOn);
00184
00188 virtual void OnMouseDown(int mouseButton, bool ctrlDown, bool shiftDown, int xPos, int yPos);
00192 virtual void OnMouseUp(int mouseButton, bool ctrlDown, bool shiftDown, int xPos, int yPos);
00196 virtual void OnMouseMove(bool ctrlDown, bool shiftDown, int xPos, int yPos);
00197
00201 void BeginAddPeelingWidget();
00205 int GetCurrentWidgetLayerNumber();
00209 void SetCurrentWidgetLayerNumber(int number);
00213 void RemoveCurrentPeelingWidget();
00214
00219 void SetCroppingBounds(const float CroppingBounds[6]);
00220
00225 void GetCroppingBounds(float CroppingBounds[6]);
00226
00227 mitkCUDADecomposedSurfaceVR& GetKernelModule() { return m_module; }
00228
00229
00230 protected:
00231 virtual ~mitkCUDADecomposedIsosurfaceVRScene();
00232 virtual void GetSize3D(float size[3]);
00233
00234 private:
00235 mitkCUDADecomposedIsosurfaceVRScene(const mitkCUDADecomposedIsosurfaceVRScene&);
00236 void operator = (const mitkCUDADecomposedIsosurfaceVRScene&);
00237
00238 void _setIsovalue(float isovalue);
00239
00240 void _renderPeelWidget(const PeelingWidget& widget);
00241 void _renderPickedPeelWidget(const PeelingWidget& widget);
00242
00243 void _updatePeelBuffer();
00244 void _pick(int x,int y);
00245
00246 private:
00247 mitkRCPtr<mitkICVolume> m_Data;
00248 mitkRCPtr<mitkRGBATransferFunction1D> m_TF;
00249
00250 mitkLocalVersion m_TFVersion;
00251
00252
00253
00254 mitkCUDADecomposedSurfaceVR m_module;
00255
00256 bool m_glewInit;
00257 bool m_dataModified;
00258
00259 bool m_RotateLightDirection;
00260 bool m_RotatingLightDirection;
00261
00262 mitkVis2Vector4 m_OldLightDirection;
00263
00264 unsigned char* m_OccupyMask;
00265
00267 PeelingWidgetList *m_PeelingWidgetList;
00268 bool m_AddPeelingWidget;
00269 bool m_AddingPeelingWidget;
00270
00271 bool m_PeelDraging;
00272 int m_PickedPeelingWidgetID;
00273 int m_PeelDragVertexID;
00274
00275 };
00276
00277 #endif