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

vuCellProjector Class Reference

A utility window for using Steve's more general cellProjectorter. More...

#include <vuCellProjector.h>

Inheritance diagram for vuCellProjector:

Inheritance graph
[legend]
Collaboration diagram for vuCellProjector:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 vuCellProjector ()
 Constructor.
 ~vuCellProjector ()
 Destructor.
void addRight (wxSizer *sizer)
 Adds some controls to a right hand panel in utility window.
bool init (const char *DataFile)
 Initializes the cellProjector utility.
void notifyDataChanged ()
 Updates the view by calling m_glCanvas->redraw().
void DrawAgain ()
 Rerenders the screen from the current camera position.
void DrawFromImage ()
 Draws on the screen the image contained in the image buffer.
vuImagegetCurrentImage ()
 This will return a pointer to the image buffer that is being used by the method to draw images to...
vuCameragetCamera ()
 This will return a poiunter to the camera that this class is using (note that this may be derived from vuCamera...).
bool IsReRendering ()
 This will return whether or not the cellProjector is rerendering to the screen.
void setIsReRendering (bool isit)
 This will set the state of rerendering to be the same as isit.

Static Public Member Functions

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

Protected Member Functions

bool glInit ()
 Initializes openGL for the cellProjector utility.
void glRender ()
 Calls on the cellProjectorter to render the volume.
void glResize ()
 Resizes the gl viewport and renders the volume.
void glOnMouse (wxMouseEvent &ev)
 Handles additional mouse commands from the user.
vu1getVolume ()
 Returns a parent pointer to the current algorithm.
void OnChar (wxKeyEvent &event)
 Overwritten keyboard handler from vuBasicUtility.
void onCheckBoxIsSort ()
 Controls whether the cell projector sorts and triangulates its tets.
void onListBoxSubdivScheme ()
 Controls which subdivision scheme to use.
void onButtonRender ()
 When user presses this button, renders the data set with current settings.
void addCheckBoxIsSort (wxSizer *sizer)
 Add checkbox for whether to sort and triangulate data set.
void addListBoxSubdivScheme (wxSizer *sizer)
 Add listbox for subdiv scheme.
void addButtonRender (wxSizer *sizer)
 Adds a button for whether or not to render the data set.

Private Attributes

vu111211am_Data
 The cellProjector owned by the utility.
vuCamera m_Camera
 A camera class for storing the user's current view.
float m_ViewScale
 The zoom magnification of the cellProjector.
vuTFDesign m_TFunc
 the transfer function
vuTransferDialog m_TFDialog
 The dialog to edit the transfer function.
int m_x
 The x click position of the mouse.
int m_y
 The y click position of the mouse.
wxCheckBox * m_checkBoxIsSort
 Whether or not to perform sorting and triangulation.
wxListBox * m_listBoxSubdivScheme
 List of subdivision algorithms currently available.

Detailed Description

A utility window for using Steve's more general cellProjectorter.

This class is a utility window wrapper for Steve's general cellProjectorter. This cellProjectorter is part of the vuVolume tree, and is meant to be as general as possible. (see the included header files). The utility displays an OpenGL window which lets users rotate the object, zoom it, as well as edit the transfer function. All these commands are done using the mouse.

The class is a good example of a general vuGui utility. It can be used as a model for building other utilities.

Definition at line 41 of file vuCellProjector.h.


Constructor & Destructor Documentation

vuCellProjector::vuCellProjector  ) 
 

Constructor.

Definition at line 47 of file vuCellProjector.cpp.

vuCellProjector::~vuCellProjector  ) 
 

Destructor.

Definition at line 61 of file vuCellProjector.cpp.

References m_Data.


Member Function Documentation

void vuCellProjector::addButtonRender wxSizer *  sizer  )  [protected]
 

Adds a button for whether or not to render the data set.

Since the cell projector is so slow, it is desirable to allow the user to rotate to a desired location, then render.

Definition at line 545 of file vuCellProjector.cpp.

References idButtonRender.

Referenced by addRight().

void vuCellProjector::addCheckBoxIsSort wxSizer *  sizer  )  [protected]
 

Add checkbox for whether to sort and triangulate data set.

Definition at line 498 of file vuCellProjector.cpp.

References idCheckBoxIsSort, m_checkBoxIsSort, m_Data, and vu111211a::m_isSort.

Referenced by addRight().

void vuCellProjector::addListBoxSubdivScheme wxSizer *  sizer  )  [protected]
 

Add listbox for subdiv scheme.

Definition at line 517 of file vuCellProjector.cpp.

References idListBoxSubdivScheme, m_Data, m_listBoxSubdivScheme, and vu111211a::m_subdivScheme.

Referenced by addRight().

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

Adds some controls to a right hand panel in utility window.

Reimplemented from vuBasicUtility.

Definition at line 80 of file vuCellProjector.cpp.

References addButtonRender(), addCheckBoxIsSort(), and addListBoxSubdivScheme().

Here is the call graph for this function:

void vuCellProjector::DrawAgain  )  [virtual]
 

Rerenders the screen from the current camera position.

Implements vuBasicUtility.

Definition at line 146 of file vuCellProjector.cpp.

References vuGLCanvas::redraw().

Referenced by OnChar().

Here is the call graph for this function:

void vuCellProjector::DrawFromImage  )  [virtual]
 

Draws on the screen the image contained in the image buffer.

Can't have const qualifier coz the original pure virtual function doesn't have it and if this does the compilor will choke. Overridden virtual functions have to have the exact same scope, prototype and qualifiers in order for polymorphism to work.

Implements vuBasicUtility.

Definition at line 156 of file vuCellProjector.cpp.

References vu111211a::drawPic(), and m_Data.

Here is the call graph for this function:

vuCamera * vuCellProjector::getCamera  )  [virtual]
 

This will return a poiunter to the camera that this class is using (note that this may be derived from vuCamera...).

Implements vuBasicUtility.

Definition at line 177 of file vuCellProjector.cpp.

vuImage * vuCellProjector::getCurrentImage  )  [virtual]
 

This will return a pointer to the image buffer that is being used by the method to draw images to...

Implements vuBasicUtility.

Definition at line 167 of file vuCellProjector.cpp.

References vu111211a::getBuffer(), and m_Data.

Here is the call graph for this function:

const char * vuCellProjector::getFileType  )  [static]
 

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

Reimplemented from vuBasicUtility.

Definition at line 70 of file vuCellProjector.cpp.

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

Returns a parent pointer to the current algorithm.

Reimplemented from vuBasicUtility.

Definition at line 401 of file vuCellProjector.cpp.

bool vuCellProjector::glInit  )  [protected, virtual]
 

Initializes openGL for the cellProjector utility.

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

Reimplemented from vuBasicUtility.

Definition at line 208 of file vuCellProjector.cpp.

References GL_LIGHT0, GL_LIGHT_MODEL_TWO_SIDE, GL_LIGHTING, GL_TRUE, glClearColor(), glEnable(), GLfloat, glLightModeli(), vu111211a::initOpenGL(), and m_Data.

Here is the call graph for this function:

void vuCellProjector::glOnMouse wxMouseEvent &  ev  )  [protected, virtual]
 

Handles additional mouse commands from the user.

onMouse() is the one that vuBasicUtility asks client programmers to override, not glOnMouse. But vuBasicUtility::glOnMouse doesn't work.

Reimplemented from vuBasicUtility.

Definition at line 346 of file vuCellProjector.cpp.

References vuCamera::getPosition(), glResize(), m_Camera, m_TFDialog, m_ViewScale, m_x, m_y, vuVector::norm(), vuGLCanvas::redraw(), vuCamera::rotateAboutRight(), vuCamera::rotateAboutUp(), and vuCamera::translateXYZ().

Here is the call graph for this function:

void vuCellProjector::glRender  )  [protected, virtual]
 

Calls on the cellProjectorter to render the volume.

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

Reimplemented from vuBasicUtility.

Definition at line 239 of file vuCellProjector.cpp.

References vu1112::getDim1Size(), vu1112::getDim2Size(), vu1112::getDim3Size(), vuCamera::getLookAtVector(), vuCamera::getRightVector(), vuCamera::getUpVector(), GL_COLOR_BUFFER_BIT, GL_MODELVIEW, glClear(), glLoadIdentity(), glMatrixMode(), glTranslatef(), vuCamera::gluLookAt(), m_Camera, m_Data, m_TFunc, vu111211a::render(), vu111211::setTransferFunc(), and vu111211a::setViewVectors().

Here is the call graph for this function:

void vuCellProjector::glResize  )  [protected, virtual]
 

Resizes the gl viewport and renders the volume.

Reimplemented from vuBasicUtility.

Definition at line 277 of file vuCellProjector.cpp.

References dword, vu1112::getDim1Size(), vu1112::getDim2Size(), vu1112::getDim3Size(), vuGLCanvas::getHeight(), vuGLCanvas::getWidth(), GL_MODELVIEW, GL_PROJECTION, GLfloat, GLint, glLoadIdentity(), glMatrixMode(), glOrtho(), glViewport(), m_Data, m_ViewScale, and max.

Referenced by glOnMouse().

Here is the call graph for this function:

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

Initializes the cellProjector utility.

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

Reimplemented from vuBasicUtility.

Definition at line 92 of file vuCellProjector.cpp.

References vuTFDesign::generateFunction(), vu1::getErrorMessage(), vuTFDesign::loadTF(), m_Data, m_TFunc, vu111211a::read(), vuTFDesign::setColourSmoothing(), vu1::setFileName(), vuTFDesign::setOpacitySmoothing(), and vu111211::setTransferFunc().

Here is the call graph for this function:

bool vuCellProjector::IsReRendering  )  [virtual]
 

This will return whether or not the cellProjector is rerendering to the screen.

Reimplemented from vuBasicUtility.

Definition at line 188 of file vuCellProjector.cpp.

References vu1::IsReRendering(), and m_Data.

Here is the call graph for this function:

void vuCellProjector::notifyDataChanged  )  [virtual]
 

Updates the view by calling m_glCanvas->redraw().

Reimplemented from vuBasicUtility.

Definition at line 136 of file vuCellProjector.cpp.

References vuGLCanvas::redraw().

Here is the call graph for this function:

void vuCellProjector::onButtonRender  )  [protected]
 

When user presses this button, renders the data set with current settings.

Definition at line 485 of file vuCellProjector.cpp.

void vuCellProjector::OnChar wxKeyEvent &  event  )  [protected, virtual]
 

Overwritten keyboard handler from vuBasicUtility.

If data size is 8, the keys 0~4 will display 5 tets If data size is 12, the keys 0~9 will display the 10 tets.

onKeyboard should be the one overridden, according to vuBasicUtility. But vuBasicUtility::OnChar doesn't work.

Reimplemented from vuBasicUtility.

Definition at line 413 of file vuCellProjector.cpp.

References DrawAgain(), dword, m_Data, vu1::m_DataSize, vu111211a::m_state, vu111211a::m_subdivScheme, vu111211a::m_tetIndex, and SIX_FOLD.

Here is the call graph for this function:

void vuCellProjector::onCheckBoxIsSort  )  [protected]
 

Controls whether the cell projector sorts and triangulates its tets.

Definition at line 457 of file vuCellProjector.cpp.

References vu111211a::m_isSort.

void vuCellProjector::onListBoxSubdivScheme  )  [protected]
 

Controls which subdivision scheme to use.

Definition at line 471 of file vuCellProjector.cpp.

void vuCellProjector::setIsReRendering bool  isit  )  [virtual]
 

This will set the state of rerendering to be the same as isit.

Reimplemented from vuBasicUtility.

Definition at line 198 of file vuCellProjector.cpp.

References m_Data, and vu1::setIsReRendering().

Here is the call graph for this function:


Member Data Documentation

vuCamera vuCellProjector::m_Camera [private]
 

A camera class for storing the user's current view.

Definition at line 171 of file vuCellProjector.h.

Referenced by glOnMouse(), and glRender().

wxCheckBox* vuCellProjector::m_checkBoxIsSort [private]
 

Whether or not to perform sorting and triangulation.

For render-timing comparative purposes.

Definition at line 192 of file vuCellProjector.h.

Referenced by addCheckBoxIsSort().

vu111211a* vuCellProjector::m_Data [private]
 

The cellProjector owned by the utility.

Definition at line 168 of file vuCellProjector.h.

Referenced by addCheckBoxIsSort(), addListBoxSubdivScheme(), DrawFromImage(), getCurrentImage(), glInit(), glRender(), glResize(), init(), IsReRendering(), OnChar(), setIsReRendering(), and ~vuCellProjector().

wxListBox* vuCellProjector::m_listBoxSubdivScheme [private]
 

List of subdivision algorithms currently available.

5-fold, 6-fold, more to come later. Should become auto-scrollable if a lot of entries go in here.

Definition at line 199 of file vuCellProjector.h.

Referenced by addListBoxSubdivScheme().

vuTransferDialog vuCellProjector::m_TFDialog [private]
 

The dialog to edit the transfer function.

Definition at line 180 of file vuCellProjector.h.

Referenced by glOnMouse().

vuTFDesign vuCellProjector::m_TFunc [private]
 

the transfer function

Reimplemented from vuBasicUtility.

Definition at line 177 of file vuCellProjector.h.

Referenced by glRender(), and init().

float vuCellProjector::m_ViewScale [private]
 

The zoom magnification of the cellProjector.

Definition at line 174 of file vuCellProjector.h.

Referenced by glOnMouse(), and glResize().

int vuCellProjector::m_x [private]
 

The x click position of the mouse.

Definition at line 183 of file vuCellProjector.h.

Referenced by glOnMouse().

int vuCellProjector::m_y [private]
 

The y click position of the mouse.

Definition at line 185 of file vuCellProjector.h.

Referenced by glOnMouse().


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