VolumeCanvas Class Reference

OpenGL canvas which is used to display the volume data graphically. More...

#include <volume_canvas.h>

Collaboration diagram for VolumeCanvas:

Collaboration graph
VolProgram
[legend]

List of all members.

Public Member Functions

 VolumeCanvas (wxWindow *parent, wxWindowID id=wxID_ANY)
 ~VolumeCanvas ()
void OpenFile (const char *filename)
 Opens a volume data file.
Viewmode GetViewmode () const
 Returns the current viewmode.
void SetViewmode (Viewmode viewmode)
 Set the new viewmode.
int GetSizeX () const
 Returns the size of the dataset in the X dimension.
int GetSizeY () const
 Returns the size of the dataset in the Y dimension.
int GetSizeZ () const
 Returns the size of the dataset in the Z dimension.
void SetSlice (int value)
 Set the slice that should be displayed.
int GetSlice () const
 Return the currently displayed slice.
void Set3dOrientation (float rx, float ry, float rz)
 Set the 3d orientation angles (in degrees).
void Get3dOrientation (float *rx, float *ry, float *rz)
 Retrieve the currently set 3d orientation.
const HistogramDataGetHistogramData () const
 Get the histogram data.
void UpdateTransferFunction (TransferFunctionSampler *sampler)
void RenderToFile (const wxString &file_name, int width, int height)

Protected Member Functions

Event handling
void OnPaint (wxPaintEvent &)
 Called when a repaint is needed.
void OnSize (wxSizeEvent &)
 Called when the client area is resized.
void OnEraseBackground (wxEraseEvent &)
 Called when the background should be redrawn. Does nothing to prevent flickering.

Private Types

enum  GLStatus { GLS_INIT_PENDING, GLS_INIT_FAILED, GLS_OK }
 Enum used to determine the OpenGL initialisation status. More...

Private Member Functions

void Render () const
 Does the rendering.
void Render3dView () const
 Renders the 3d view.
void RenderSliceView () const
 Renders the slice view.
bool InitGL ()
 Initialises OpenGL. Returns false on failure.
bool CheckGL ()
 Initialises OpenGL if not yet done and returns true on success.

Private Attributes

GLStatus m_glstatus
 Initialisation status.
GLuint m_volume_texture
 The loaded OpenGL volume texture.
GLuint m_transfer_texture
 Texture representing the transfer funtion.
VolProgramm_volprog
 Shader program used for rendering.
GLint m_viewport_width
 Determines the Width to witch the data is rendered.
GLint m_viewport_height
 Determines the Height to witch the data is rendered.
Viewmode m_viewmode
std::auto_ptr< HistogramDatam_histogramdata
Slice data
int m_sizex
int m_sizey
int m_sizez
int m_slice
Rotation
float m_rotx
float m_roty
float m_rotz


Detailed Description

OpenGL canvas which is used to display the volume data graphically.

Definition at line 34 of file volume_canvas.h.


Member Enumeration Documentation

enum VolumeCanvas::GLStatus [private]

Enum used to determine the OpenGL initialisation status.

Enumerator:
GLS_INIT_PENDING 
GLS_INIT_FAILED 
GLS_OK 

Definition at line 135 of file volume_canvas.h.


Constructor & Destructor Documentation

VolumeCanvas::VolumeCanvas ( wxWindow *  parent,
wxWindowID  id = wxID_ANY 
)

Definition at line 30 of file volume_canvas.cpp.

VolumeCanvas::~VolumeCanvas (  )  [inline]

Definition at line 38 of file volume_canvas.h.

References m_volprog.


Member Function Documentation

bool VolumeCanvas::CheckGL (  )  [private]

Initialises OpenGL if not yet done and returns true on success.

Definition at line 340 of file volume_canvas.cpp.

References GLS_INIT_FAILED, GLS_INIT_PENDING, GLS_OK, InitGL(), and m_glstatus.

Referenced by OnPaint(), OpenFile(), and RenderToFile().

void VolumeCanvas::Get3dOrientation ( float *  rx,
float *  ry,
float *  rz 
) [inline]

Retrieve the currently set 3d orientation.

Definition at line 99 of file volume_canvas.h.

References m_rotx, m_roty, and m_rotz.

const HistogramData* VolumeCanvas::GetHistogramData (  )  const [inline]

Get the histogram data.

Definition at line 107 of file volume_canvas.h.

References m_histogramdata.

Referenced by VisLUFrame::OnOpenTraFu().

int VolumeCanvas::GetSizeX (  )  const [inline]

Returns the size of the dataset in the X dimension.

Definition at line 61 of file volume_canvas.h.

References m_sizex.

Referenced by Render3dView(), RenderSliceView(), and VisLUFrame::SyncUIState().

int VolumeCanvas::GetSizeY (  )  const [inline]

Returns the size of the dataset in the Y dimension.

Definition at line 67 of file volume_canvas.h.

References m_sizey.

Referenced by Render3dView(), RenderSliceView(), and VisLUFrame::SyncUIState().

int VolumeCanvas::GetSizeZ (  )  const [inline]

Returns the size of the dataset in the Z dimension.

Definition at line 73 of file volume_canvas.h.

References m_sizez.

Referenced by Render3dView(), RenderSliceView(), and VisLUFrame::SyncUIState().

int VolumeCanvas::GetSlice (  )  const [inline]

Return the currently displayed slice.

Definition at line 85 of file volume_canvas.h.

References m_slice.

Referenced by RenderSliceView().

Viewmode VolumeCanvas::GetViewmode (  )  const [inline]

Returns the current viewmode.

Definition at line 49 of file volume_canvas.h.

References m_viewmode.

Referenced by Render(), RenderSliceView(), and VisLUFrame::VisLUFrame().

bool VolumeCanvas::InitGL (  )  [private]

Initialises OpenGL. Returns false on failure.

Definition at line 320 of file volume_canvas.cpp.

References m_transfer_texture, and m_volprog.

Referenced by CheckGL().

void VolumeCanvas::OnEraseBackground ( wxEraseEvent &  event  )  [protected]

Called when the background should be redrawn. Does nothing to prevent flickering.

Definition at line 369 of file volume_canvas.cpp.

void VolumeCanvas::OnPaint ( wxPaintEvent &  event  )  [protected]

Called when a repaint is needed.

Definition at line 352 of file volume_canvas.cpp.

References CheckGL(), m_viewport_height, m_viewport_width, and Render().

void VolumeCanvas::OnSize ( wxSizeEvent &  event  )  [protected]

Called when the client area is resized.

Definition at line 363 of file volume_canvas.cpp.

void VolumeCanvas::OpenFile ( const char *  filename  ) 

Opens a volume data file.

Exceptions:
std::exception if an error occurs.

Definition at line 384 of file volume_canvas.cpp.

References CheckGL(), m_histogramdata, m_sizex, m_sizey, m_sizez, m_volume_texture, and value.

Referenced by VisLUFrame::OnOpen().

void VolumeCanvas::Render (  )  const [private]

Does the rendering.

Definition at line 305 of file volume_canvas.cpp.

References GetViewmode(), m_viewport_height, m_viewport_width, m_volume_texture, Render3dView(), RenderSliceView(), and VM_3D.

Referenced by OnPaint(), and RenderToFile().

void VolumeCanvas::Render3dView (  )  const [private]

void VolumeCanvas::RenderSliceView (  )  const [private]

void VolumeCanvas::RenderToFile ( const wxString &  file_name,
int  width,
int  height 
)

Definition at line 246 of file volume_canvas.cpp.

References CheckGL(), m_viewport_height, m_viewport_width, and Render().

Referenced by VisLUFrame::OnSave().

void VolumeCanvas::Set3dOrientation ( float  rx,
float  ry,
float  rz 
) [inline]

Set the 3d orientation angles (in degrees).

Definition at line 91 of file volume_canvas.h.

References m_rotx, m_roty, and m_rotz.

Referenced by VisLUFrame::SyncUIState().

void VolumeCanvas::SetSlice ( int  value  )  [inline]

Set the slice that should be displayed.

Definition at line 79 of file volume_canvas.h.

References m_slice.

Referenced by VisLUFrame::SyncUIState().

void VolumeCanvas::SetViewmode ( Viewmode  viewmode  )  [inline]

Set the new viewmode.

Definition at line 55 of file volume_canvas.h.

References m_viewmode.

Referenced by VisLUFrame::SyncUIState().

void VolumeCanvas::UpdateTransferFunction ( TransferFunctionSampler sampler  ) 


Member Data Documentation

Initialisation status.

Definition at line 141 of file volume_canvas.h.

Referenced by CheckGL().

std::auto_ptr<HistogramData> VolumeCanvas::m_histogramdata [private]

Definition at line 164 of file volume_canvas.h.

Referenced by GetHistogramData(), and OpenFile().

float VolumeCanvas::m_rotx [private]

Definition at line 161 of file volume_canvas.h.

Referenced by Get3dOrientation(), Render3dView(), and Set3dOrientation().

float VolumeCanvas::m_roty [private]

Definition at line 161 of file volume_canvas.h.

Referenced by Get3dOrientation(), Render3dView(), and Set3dOrientation().

float VolumeCanvas::m_rotz [private]

Definition at line 161 of file volume_canvas.h.

Referenced by Get3dOrientation(), Render3dView(), and Set3dOrientation().

int VolumeCanvas::m_sizex [private]

Definition at line 153 of file volume_canvas.h.

Referenced by GetSizeX(), and OpenFile().

int VolumeCanvas::m_sizey [private]

Definition at line 154 of file volume_canvas.h.

Referenced by GetSizeY(), and OpenFile().

int VolumeCanvas::m_sizez [private]

Definition at line 155 of file volume_canvas.h.

Referenced by GetSizeZ(), and OpenFile().

int VolumeCanvas::m_slice [private]

Definition at line 156 of file volume_canvas.h.

Referenced by GetSlice(), and SetSlice().

Texture representing the transfer funtion.

Definition at line 143 of file volume_canvas.h.

Referenced by InitGL(), Render3dView(), RenderSliceView(), and UpdateTransferFunction().

Definition at line 149 of file volume_canvas.h.

Referenced by GetViewmode(), and SetViewmode().

Determines the Height to witch the data is rendered.

Definition at line 147 of file volume_canvas.h.

Referenced by OnPaint(), Render(), Render3dView(), RenderSliceView(), and RenderToFile().

Determines the Width to witch the data is rendered.

Definition at line 146 of file volume_canvas.h.

Referenced by OnPaint(), Render(), Render3dView(), RenderSliceView(), and RenderToFile().

Shader program used for rendering.

Definition at line 144 of file volume_canvas.h.

Referenced by InitGL(), Render3dView(), RenderSliceView(), and ~VolumeCanvas().

The loaded OpenGL volume texture.

Definition at line 142 of file volume_canvas.h.

Referenced by OpenFile(), Render(), Render3dView(), and RenderSliceView().


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

Generated on Wed Dec 17 17:14:22 2008 for VisLU by  doxygen 1.5.7.1