Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

vuSpectral Class Reference

A utility window for raycasting with a spectral color model. More...

#include <vuSpectral.h>

Inheritance diagram for vuSpectral:

Inheritance graph
[legend]
Collaboration diagram for vuSpectral:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 vuSpectral ()
 Constructor.
 ~vuSpectral ()
 Destructor.
bool init (const char *DataFile)
void notifyDataChanged ()
 external update trigger, virtual from some parent class
virtual vuCameragetCamera ()
 This function must return a pointer to the camera that is taking the picture of the scene.
virtual vuImagegetCurrentImage ()
 This function must return a pointer to the current vuImage buffer that the method can write to or read from.
virtual void DrawFromImage ()
 This function must take the data vuImage buffer from the last call to getCurrent Image and draw that on the screen.
virtual void DrawAgain ()
 This function must rerender the scene completely.
void handleGUIevent (wxCommandEvent &ev)
 handle some GUI events (idDOSPECULAR, idDRAWPREV)
virtual void addRight (wxSizer *sizer)
 This method adds controls to the bottom of the window.

Static Public Member Functions

const char * getFileType ()
 Returns the type of vu Datafile that the utility works with.

Protected Member Functions

bool glInit ()
 Initializes open gl for the utility.
void glRender ()
void glResize ()
 Resizes the gl viewport and renders the volume.
void onMouse (wxMouseEvent &ev)
 Handles mouse commands from the user.
void OnSlideLight (wxScrollEvent &event)
 event handler for the light property sliders.
void OnButtonRender (wxCommandEvent &event)
 initiate a refresh of the rendering
void OnButtonLoadSetup (wxCommandEvent &event)
 load a scene setup.
void OnButtonLightPos (wxCommandEvent &ev)
 set light direction from current observer to centre of the volume
vu1getVolume ()
 Returns a pointer to the volume object. (usually m_Data).

Private Types

enum  { idDOSPECULAR, idDRAWPREV }

Private Attributes

vu1112112m_Data
 The spectral raycaster owned by the utility.
vuTFDesignSpec m_TFunc
 The transfer function.
vuTFDialogSpec m_TFuncDlg
vuLightDial m_LightDial
wxSlider * m_LightColour
 Slider to control the properties of the light.
wxSlider * m_LightIntensity
 Slider to control the properties of the light.
int m_x
 The width of the window.
int m_y
 The height of the window.
vuPreviewWinm_Preview
 This is a handle for a preview box.

Detailed Description

A utility window for raycasting with a spectral color model.

This class provides a GUI for vu1112112 (aka vuVolumeRegularUnimodal3d1B1ValSpectral). It renders a dataset using a spectral color model. This allows modelling special physical properties of light like spectral absorption and metamerism.

Definition at line 26 of file vuSpectral.h.


Member Enumeration Documentation

anonymous enum [private]
 

Enumeration values:
idDOSPECULAR 
idDRAWPREV 

Definition at line 28 of file vuSpectral.h.


Constructor & Destructor Documentation

vuSpectral::vuSpectral  ) 
 

Constructor.

Definition at line 38 of file vuSpectral.cpp.

vuSpectral::~vuSpectral  ) 
 

Destructor.

Definition at line 48 of file vuSpectral.cpp.

References m_Data.


Member Function Documentation

void vuSpectral::addRight wxSizer *  sizer  )  [virtual]
 

This method adds controls to the bottom of the window.

Reimplemented from vuBasicUtility.

Definition at line 112 of file vuSpectral.cpp.

References idDOSPECULAR, idDRAWPREV, idLIGHTPOS, idRENDER, m_Data, m_Preview, ns_vu1112112::vu1112112::setDoSpecular(), and ns_vu1112112::vu1112112::setDrawPreview().

Here is the call graph for this function:

void vuSpectral::DrawAgain  )  [virtual]
 

This function must rerender the scene completely.

This is so that the key frame animator can set the camera, and then force a redraw by the method.

Implements vuBasicUtility.

Definition at line 287 of file vuSpectral.cpp.

References ns_vu1112112::vu1112112::doRefresh(), m_Data, and vuGLCanvas::redraw().

Here is the call graph for this function:

void vuSpectral::DrawFromImage  )  [virtual]
 

This function must take the data vuImage buffer from the last call to getCurrent Image and draw that on the screen.

This is so that prerendered video animation can be displayed by the key frame animator by simply setting the vuImage returned by getCurrentImage and then calling this function.

Implements vuBasicUtility.

Definition at line 294 of file vuSpectral.cpp.

References vuGLCanvas::redraw().

Here is the call graph for this function:

vuCamera * vuSpectral::getCamera  )  [virtual]
 

This function must return a pointer to the camera that is taking the picture of the scene.

This is so that the key frame animator can read the camera when it needs to take a snapshot and change the camera when it wants the method to rerender the scene from a predetermined camera position.

Implements vuBasicUtility.

Definition at line 275 of file vuSpectral.cpp.

References vu1::getCameraPtr(), and m_Data.

Referenced by OnButtonLightPos().

Here is the call graph for this function:

vuImage * vuSpectral::getCurrentImage  )  [virtual]
 

This function must return a pointer to the current vuImage buffer that the method can write to or read from.

This is how the key framer will update the screen.

Implements vuBasicUtility.

Definition at line 280 of file vuSpectral.cpp.

References ns_vu1112112::vu1112112::getImage(), and m_Data.

Here is the call graph for this function:

const char * vuSpectral::getFileType  )  [static]
 

Returns the type of vu Datafile that the utility works with.

Reimplemented from vuBasicUtility.

Definition at line 57 of file vuSpectral.cpp.

vu1 * vuSpectral::getVolume  )  [protected, virtual]
 

Returns a pointer to the volume object. (usually m_Data).

Reimplemented from vuBasicUtility.

Definition at line 322 of file vuSpectral.cpp.

bool vuSpectral::glInit  )  [protected, virtual]
 

Initializes open gl for the utility.

The method calls the initgl() method so it can do the proper initialization.

Reimplemented from vuBasicUtility.

Definition at line 193 of file vuSpectral.cpp.

References GL_DEPTH_TEST, GL_LESS, glDepthFunc(), glEnable(), ns_vu1112112::vu1112112::initOpenGL(), and m_Data.

Here is the call graph for this function:

void vuSpectral::glRender  )  [protected, virtual]
 

The method calls the render() method, setting it up to render to the window's gl canvas.

It "automagically" creates a preview now -ms-.

Reimplemented from vuBasicUtility.

Definition at line 215 of file vuSpectral.cpp.

References vuGLCanvas::getHeight(), vuTFIntensity::getLight(), vuGLCanvas::getWidth(), GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_MODELVIEW, GL_PROJECTION, glClear(), glLoadIdentity(), glMatrixMode(), glOrtho(), vuLightDial::isUpdated(), vuTransferDialog::isUpdated(), ns_vu1112112::light, m_Data, m_LightDial, m_TFunc, m_TFuncDlg, vu1112::preview(), ns_vu1112112::vu1112112::render(), ns_vu1112112::vu1112112::setLight(), vu111211::setTransferFunc(), vuTransferDialog::unsetUpdated(), vuLightDial::updateSliders(), and vuTFDialogSpec::updateSliders().

Here is the call graph for this function:

void vuSpectral::glResize  )  [protected, virtual]
 

Resizes the gl viewport and renders the volume.

Reimplemented from vuBasicUtility.

Definition at line 254 of file vuSpectral.cpp.

References vuGLCanvas::getHeight(), vuGLCanvas::getWidth(), m_Data, and ns_vu1112112::vu1112112::setImageSize().

Here is the call graph for this function:

void vuSpectral::handleGUIevent wxCommandEvent &  ev  ) 
 

handle some GUI events (idDOSPECULAR, idDRAWPREV)

Definition at line 302 of file vuSpectral.cpp.

References idDOSPECULAR, idDRAWPREV, m_Data, ns_vu1112112::vu1112112::setDoSpecular(), and ns_vu1112112::vu1112112::setDrawPreview().

Here is the call graph for this function:

bool vuSpectral::init const char *  DataFile  )  [virtual]
 

Initializes the utility window. A object is created and the volume data is read. The window appears when finished.

Reimplemented from vuBasicUtility.

Definition at line 66 of file vuSpectral.cpp.

References vuTFDesign::addColour(), vuTFDesign::addOpacity(), vuPreviewWin::attachCamera(), vuTFDesignSpec::generateFunction(), vu1::getCamera(), vu1112::getDim1Size(), vu1112::getDim2Size(), vu1112::getDim3Size(), vu1::getErrorMessage(), m_Data, m_Preview, m_TFunc, ns_vu1112112::vu1112112::read(), vuTFDesign::setColourSmoothing(), vuPreviewWin::setCubeSize(), vu1::setFileName(), vuTFDesign::setOpacitySmoothing(), and vu111211::setTransferFunc().

Here is the call graph for this function:

void vuSpectral::notifyDataChanged  )  [virtual]
 

external update trigger, virtual from some parent class

Reimplemented from vuBasicUtility.

Definition at line 184 of file vuSpectral.cpp.

References vuGLCanvas::redraw().

Here is the call graph for this function:

void vuSpectral::OnButtonLightPos wxCommandEvent &  ev  )  [protected]
 

set light direction from current observer to centre of the volume

Definition at line 314 of file vuSpectral.cpp.

References getCamera(), ns_vu1112112::vu1112112::getCenter(), vuCamera::getPosition(), m_Data, vuVector::makeUnit(), and ns_vu1112112::vu1112112::setLightDir().

Here is the call graph for this function:

void vuSpectral::OnButtonLoadSetup wxCommandEvent &  event  )  [protected]
 

load a scene setup.

This opens a wxFileDialog.

Definition at line 166 of file vuSpectral.cpp.

References ns_vu1112112::vu1112112::load_scene(), and m_Data.

Here is the call graph for this function:

void vuSpectral::OnButtonRender wxCommandEvent &  event  )  [protected]
 

initiate a refresh of the rendering

Definition at line 154 of file vuSpectral.cpp.

References ns_vu1112112::vu1112112::doRefresh(), m_Data, and vuGLCanvas::redraw().

Here is the call graph for this function:

void vuSpectral::onMouse wxMouseEvent &  ev  )  [protected, virtual]
 

Handles mouse commands from the user.

The mouse is the main interface between the user and the utility at the moment. This method receives mouse events from the window, and carries out commands.

Reimplemented from vuBasicUtility.

Definition at line 263 of file vuSpectral.cpp.

References m_LightDial, and m_TFuncDlg.

void vuSpectral::OnSlideLight wxScrollEvent &  event  )  [protected]
 

event handler for the light property sliders.

Definition at line 143 of file vuSpectral.cpp.

References vuGLCanvas::redraw().

Here is the call graph for this function:


Member Data Documentation

vu1112112* vuSpectral::m_Data [private]
 

The spectral raycaster owned by the utility.

Definition at line 96 of file vuSpectral.h.

Referenced by addRight(), DrawAgain(), getCamera(), getCurrentImage(), glInit(), glRender(), glResize(), handleGUIevent(), init(), OnButtonLightPos(), OnButtonLoadSetup(), OnButtonRender(), and ~vuSpectral().

wxSlider* vuSpectral::m_LightColour [private]
 

Slider to control the properties of the light.

Calls the event handler OnSlideLight().

Definition at line 106 of file vuSpectral.h.

vuLightDial vuSpectral::m_LightDial [private]
 

Definition at line 101 of file vuSpectral.h.

Referenced by glRender(), and onMouse().

wxSlider * vuSpectral::m_LightIntensity [private]
 

Slider to control the properties of the light.

Calls the event handler OnSlideLight().

Definition at line 106 of file vuSpectral.h.

vuPreviewWin* vuSpectral::m_Preview [private]
 

This is a handle for a preview box.

Definition at line 114 of file vuSpectral.h.

Referenced by addRight(), and init().

vuTFDesignSpec vuSpectral::m_TFunc [private]
 

The transfer function.

This is not yet used because the TF don't yet operate on spectral colours.

Reimplemented from vuBasicUtility.

Definition at line 99 of file vuSpectral.h.

Referenced by glRender(), and init().

vuTFDialogSpec vuSpectral::m_TFuncDlg [private]
 

Definition at line 100 of file vuSpectral.h.

Referenced by glRender(), and onMouse().

int vuSpectral::m_x [private]
 

The width of the window.

Definition at line 109 of file vuSpectral.h.

int vuSpectral::m_y [private]
 

The height of the window.

Definition at line 111 of file vuSpectral.h.


The documentation for this class was generated from the following files:
Generated on Wed Dec 15 21:22:03 2004 for vuVolume by  doxygen 1.3.9.1