RTVolumeRenderer Class Reference

Renders voulme data sets in an interactive window. More...

#include "RTVolumeRenderer.h"

Inheritance diagram for RTVolumeRenderer:

Inheritance graph
[legend]
Collaboration diagram for RTVolumeRenderer:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 RTVolumeRenderer (wxWindow *parent, int w, int h)
 Constructor.
void ResizeRenderer (int w, int h)
 Resizes the renderer window.
void Draw ()
void ShouldDrawCube (bool yn)
 Tells the renderer if it should draw the bounding cube or not.
void ShouldDrawCubeOutline (bool yn)
 Tells the renderer if it should draw the bounding cube outline or not.
void ShouldDrawPlanes (bool yn)
 Tells the renderer if it should draw the rendering planes.
void UseVolumeTexture (bool yn)
 Tells the renderer if it should draw using the volume data.
void SetPlanes (int n)
 Sets the number of planes to draw.
void SetLightDirection (const Vector3f &dir)
 Sets the direction of the light.
void SetLightDiffuseColor (const Color4f &c)
 Sets the diffuse color of the light.
void MouseMove (wxMouseEvent &m)
 Called when the mouse moves.
void MouseLeftUp (wxMouseEvent &m)
 Called when the left mouse button is released.
void MouseLeftDown (wxMouseEvent &m)
 Called when the left mouse button is pressed.
void MouseWheel (wxMouseEvent &m)
 Called when the mouse wheel is moved.
void KeyDown (wxKeyEvent &k)
 Called when a key is pressed.
void SetFrameTime (float t)
 Sets the current frame time.
void SetBackgroundColor (const Color4f &c)
 Sets the background color.
void SetCubeColor (const Color4f &c)
 Sets the cube color.
void SetOutlineColor (const Color4f &c)
 Sets the cube outline color.
void SetPlaneColor (const Color4f &c)
 Sets the plane color.
void ToggleCameraAttachment ()
 Toggles the attachment of the camera to the plane slices.
void SetQuickMovmentRendering (bool quick)
 Enables/Disables simplified rendering when the camera is being moved.
bool LoadVolumeDataSet (const char *name, const char *path, VTInfo &info)
 Loads a volume data set from a *.vt file.
int CopyHistogram (unsigned int *data, int n)
 Copies the specified number of elements of the volume data sets histogram.
virtual void TransferPlotChanged (TransferFunctionPlot *plot)
 Called when the transfer function plot changes.

Protected Member Functions

void Clear ()
 Clears the back buffer to black.


Detailed Description

Renders voulme data sets in an interactive window.

Definition at line 27 of file RTVolumeRenderer.h.


Constructor & Destructor Documentation

RTVolumeRenderer::RTVolumeRenderer ( wxWindow *  parent,
int  w,
int  h 
)

Constructor.

Parameters:
[in] parent the parent window the volume renderer should reside in.
[in] w the width of the opengl frame buffer.
[in] h the height of the opengl frame buffer.
NOTE: The parent window must be visable [by calling Show(true)] before creating a RTVolumeRenderer.

Definition at line 39 of file RTVolumeRenderer.cpp.

References CubeDef::c, CreateFrame(), and CubeDef::dim.


Member Function Documentation

void RTVolumeRenderer::ResizeRenderer ( int  w,
int  h 
)

Resizes the renderer window.

Parameters:
[in] w the width of frame buffer.
[in] h the height of frame buffer.

Definition at line 85 of file RTVolumeRenderer.cpp.

References Matrix< T >::GetOpenGLMatrix(), and Matrix< T >::MakePerspective().

Referenced by MainWindow::OnResolutionSelection().

void RTVolumeRenderer::Draw (  ) 

void RTVolumeRenderer::ShouldDrawCube ( bool  yn  ) 

Tells the renderer if it should draw the bounding cube or not.

Parameters:
[in] yn set to true to draw the cube, set to false to disable drawing the cube.

Definition at line 160 of file RTVolumeRenderer.cpp.

Referenced by MainWindow::OnDrawCubeClick().

void RTVolumeRenderer::ShouldDrawCubeOutline ( bool  yn  ) 

Tells the renderer if it should draw the bounding cube outline or not.

Parameters:
[in] yn set to true to draw the cube outline, set to false to disable drawing the cube outline.

Definition at line 167 of file RTVolumeRenderer.cpp.

Referenced by MainWindow::OnDrawOutlineClick().

void RTVolumeRenderer::ShouldDrawPlanes ( bool  yn  ) 

Tells the renderer if it should draw the rendering planes.

Parameters:
[in] yn set to true to draw the rendering planes, set to false to disable drawing the rendering planes.

Definition at line 174 of file RTVolumeRenderer.cpp.

Referenced by MainWindow::OnDrawPlanesClick().

void RTVolumeRenderer::UseVolumeTexture ( bool  yn  ) 

Tells the renderer if it should draw using the volume data.

Parameters:
[in] yn set to true to draw the rendering planes with the volume texture enabled, set to false to disable drawing the rendering with the volume texture.

Definition at line 181 of file RTVolumeRenderer.cpp.

Referenced by MainWindow::OnUseTexClick().

void RTVolumeRenderer::SetPlanes ( int  n  ) 

Sets the number of planes to draw.

Parameters:
[in] n the number of planes. Should be in the range [1, MAX_PLANES].

Definition at line 188 of file RTVolumeRenderer.cpp.

References Cube::SetNumberOfPlanes().

Referenced by MainWindow::OnPlanesSliderScroll().

void RTVolumeRenderer::SetLightDirection ( const Vector3f dir  ) 

Sets the direction of the light.

Parameters:
[in] dir the direction of the light.

Definition at line 146 of file RTVolumeRenderer.cpp.

References ShaderProgram::SetVector(), Vector3< T >::x, Vector3< T >::y, and Vector3< T >::z.

Referenced by MainWindow::OnResetLightDirButtonClick(), and MainWindow::OnSetLightDirButtonClick().

void RTVolumeRenderer::SetLightDiffuseColor ( const Color4f c  ) 

Sets the diffuse color of the light.

Parameters:
[in] c the diffuse color of the light
NOTE: The alpha component is ignored.

Definition at line 153 of file RTVolumeRenderer.cpp.

References Color4f::b, Color4f::g, Color4f::r, and ShaderProgram::SetVector().

Referenced by MainWindow::ColorChanged().

void RTVolumeRenderer::MouseMove ( wxMouseEvent &  m  ) 

Called when the mouse moves.

Parameters:
[in,out] m the mouse event.

Definition at line 236 of file RTVolumeRenderer.cpp.

References Camera::RotateRight(), and Camera::RotateUp().

void RTVolumeRenderer::MouseLeftUp ( wxMouseEvent &  m  ) 

Called when the left mouse button is released.

Parameters:
[in,out] m the mouse event.

Definition at line 255 of file RTVolumeRenderer.cpp.

void RTVolumeRenderer::MouseLeftDown ( wxMouseEvent &  m  ) 

Called when the left mouse button is pressed.

Parameters:
[in,out] m the mouse event.

Definition at line 262 of file RTVolumeRenderer.cpp.

void RTVolumeRenderer::MouseWheel ( wxMouseEvent &  m  ) 

Called when the mouse wheel is moved.

Parameters:
[in,out] m the mouse event.

Definition at line 275 of file RTVolumeRenderer.cpp.

References Camera::Zoom().

void RTVolumeRenderer::KeyDown ( wxKeyEvent &  k  ) 

Called when a key is pressed.

Parameters:
[in,out] k the key event.

Definition at line 292 of file RTVolumeRenderer.cpp.

References Camera::RotateRight(), Camera::RotateUp(), and Camera::Zoom().

void RTVolumeRenderer::SetFrameTime ( float  t  )  [inline]

Sets the current frame time.

Parameters:
[in] t the time in seconds since the last frame.

Definition at line 147 of file RTVolumeRenderer.h.

Referenced by MainWindow::OnIdle().

void RTVolumeRenderer::SetBackgroundColor ( const Color4f c  ) 

Sets the background color.

Parameters:
[in] c the color to use.

Definition at line 195 of file RTVolumeRenderer.cpp.

References Color4f::b, Color4f::g, and Color4f::r.

Referenced by MainWindow::ColorChanged().

void RTVolumeRenderer::SetCubeColor ( const Color4f c  ) 

Sets the cube color.

Parameters:
[in] c the color to use.

Definition at line 202 of file RTVolumeRenderer.cpp.

References Cube::SetCubeColor().

Referenced by MainWindow::ColorChanged().

void RTVolumeRenderer::SetOutlineColor ( const Color4f c  ) 

Sets the cube outline color.

Parameters:
[in] c the color to use.

Definition at line 209 of file RTVolumeRenderer.cpp.

References Cube::SetOutlineColor().

Referenced by MainWindow::ColorChanged().

void RTVolumeRenderer::SetPlaneColor ( const Color4f c  ) 

Sets the plane color.

Parameters:
[in] c the color to use.

Definition at line 216 of file RTVolumeRenderer.cpp.

References Cube::SetPlaneColor().

Referenced by MainWindow::ColorChanged().

void RTVolumeRenderer::SetQuickMovmentRendering ( bool  quick  )  [inline]

Enables/Disables simplified rendering when the camera is being moved.

Parameters:
[in] quick set to true to enable simplified rendering, set to false to disable it.

Definition at line 187 of file RTVolumeRenderer.h.

Referenced by MainWindow::OnRealTimeClick().

bool RTVolumeRenderer::LoadVolumeDataSet ( const char *  name,
const char *  path,
VTInfo info 
)

Loads a volume data set from a *.vt file.

Parameters:
[in] name the filename of the *.vt volume texture file.
[in] path the path to the *.vt description file.
[out] info the information describing the loaded texture.
Returns:
true if the dataset was loaded, false otherwise.

Definition at line 229 of file RTVolumeRenderer.cpp.

References VolumeTexture::Load().

Referenced by MainWindow::OnLoadDataSetButtonClick().

int RTVolumeRenderer::CopyHistogram ( unsigned int *  data,
int  n 
) [inline]

Copies the specified number of elements of the volume data sets histogram.

Parameters:
[out] data the loactoin to copy the historgram.
[in] n the number of elements to copy.
Returns:
the number of elements left in the historgam that were not copied.

Definition at line 208 of file RTVolumeRenderer.h.

References VolumeTexture::CopyHistogram().

Referenced by MainWindow::OnLoadDataSetButtonClick().

void RTVolumeRenderer::TransferPlotChanged ( TransferFunctionPlot plot  )  [virtual]

Called when the transfer function plot changes.

Parameters:
[in] plot the plot that changed.

Implements TransferPlotChangeListner.

Definition at line 285 of file RTVolumeRenderer.cpp.

References TransferFunctionPlot::UpdateTexture().


The documentation for this class was generated from the following files:

Generated on Thu Jan 15 00:58:04 2009 for RTVolumeRendering by  doxygen 1.5.6