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

vu111211a Class Reference

#include <CellProjector.h>

Inheritance diagram for vu111211a:

Inheritance graph
[legend]
Collaboration diagram for vu111211a:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 vu111211a ()
 Default constructor creating an empty instance.
 vu111211a (const vu111211a &inst)
 Copy constructor which does a deep copy.
 ~vu111211a ()
 Destructor.
vu111211aoperator= (const vu111211a &rhs)
 Assignment operator which does a deep copy.
void setViewVectors (const vuVector &view, const vuVector &up, const vuVector &right)
 Sets the camera viewing position for the render method.
void initOpenGL () const
 Initializes open gl for rendering the volume data.
void render ()
 Implements the abstract render() method of the vuVolume base class.
void drawPic () const
 Draws on the screen the image contained in the image buffer.
vuImagegetBuffer ()
 Returns the currently rendered image.
bool read ()
 Reimplements the read() method to do some extra volume data processing.
virtual bool readRaw ()
 This method reads volume data stored using the .raw data type.

Private Member Functions

void drawVoxelsSorted () const
 Draws the voxels sorted.
void drawVoxelsUnsorted () const
 Draws the voxels unsorted.
void drawVoxel (int x, int y, int z) const
 Draws a voxel based on the location of its origin (bottom lower left corner).
void drawTet (const int TET_RELATIVE_INDICES[4], const int VOXEL_ORIGIN[3]) const
 Draws a tet based on the voxel subdivision info.
void drawTet (int tetVertexLocations[4][3]) const
 Draws a tet by the vertices given.
void drawTetNormals (int tetVertexLocations[4][3]) const
 Draws a normal given a triangle.
void getTetOrientation (int tetVertexLocations[4][3], char orientation[4]) const
 Gets the orientation of a tet.
void getTetNormals (int tetVertexLocations[4][3], vuVector normals[4]) const
 Gets the four normals for a tetrahedron one per face.
vuVector getNormal (vuVector *v[3]) const
 gets the normal of the triangle passed in.
byte getIntensity (int vertex[3]) const
 gets the intensity at a particular vertex of a tetrahedron.
void initGrid ()
 Initializes the grid to match the size of the data.
void writeImgBuffer ()
 Writes the current image buffer into m_ImgBuffer so that it will be accessible from outside this module.

Private Attributes

vuImage m_ImgBuffer
 The current image buffer.
vuVector m_View
 The view direction, which is updated as the user rotates the data set.
DebugEnum m_state
 Depending on the kind of data read in, different options become avail.
SubdivEnum m_subdivScheme
 Subdivision scheme to be used choosable by user.
bool m_isSort
 Whether or not to perform sorting and triangulation.
bool m_isRender
 Whether to render, only used when data size is large.
int m_tetIndex
 Indexes which tet in a voxel is to be rendered.
vuGrid m_grid
 A temporary grid used as visual aid.

Static Private Attributes

const int TETS_DEF_5_FOLD [10][4]
 5-fold subdivision.
const int TETS_DEF_6_FOLD [6][4]
 6-fold subdivision.
const int TRIANGLE_DEF [4][3]
 Triangle definition.
const int VOXEL_VERTEX_LOCATIONS [8][3]
 Voxel definition.

Friends

class vuCellProjector

Constructor & Destructor Documentation

vu111211a::vu111211a  ) 
 

Default constructor creating an empty instance.

Definition at line 45 of file CellProjector.cpp.

References NORMAL, and SIX_FOLD.

vu111211a::vu111211a const vu111211a inst  ) 
 

Copy constructor which does a deep copy.

Definition at line 56 of file CellProjector.cpp.

vu111211a::~vu111211a  ) 
 

Destructor.

Definition at line 65 of file CellProjector.cpp.


Member Function Documentation

void vu111211a::drawPic  )  const
 

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

Basically, it's a flush() function.

Definition at line 197 of file CellProjector.cpp.

References vuImage::get_rgb(), vuImage::getHeight(), vuImage::getWidth(), GL_BACK, GL_BLEND, GL_FRONT, glDisable(), glDrawBuffer(), glDrawPixels(), glEnable(), glFinish(), and m_ImgBuffer.

Referenced by vuCellProjector::DrawFromImage().

Here is the call graph for this function:

void vu111211a::drawTet int  tetVertexLocations[4][3]  )  const [private]
 

Draws a tet by the vertices given.

First calculate the intensities based on the tet locations.

Then, draw the four triangles as follows:

v2 /|\ / | \ / | \ / | \ / | \ /__________|__________\ v0 v1 v3

The triangles are defined as follows:

t0 = v0, v1, v2 t1 = v1, v3, v2 t2 = v0, v2, v3 t3 = v0, v3, v1

Definition at line 395 of file CellProjector.cpp.

References byte, drawTetNormals(), getIntensity(), getTetOrientation(), GL_TRIANGLES, glBegin(), glColor4f(), glEnd(), glVertex3iv(), m_state, and TRIANGLE_DEF.

Here is the call graph for this function:

void vu111211a::drawTet const int  TET_RELATIVE_INDICES[4],
const int  VOXEL_ORIGIN[3]
const [private]
 

Draws a tet based on the voxel subdivision info.

The relative indices are indices of the vertices.

Definition at line 371 of file CellProjector.cpp.

References VOXEL_VERTEX_LOCATIONS.

Referenced by drawVoxel().

void vu111211a::drawTetNormals int  tetVertexLocations[4][3]  )  const [private]
 

Draws a normal given a triangle.

Definition at line 446 of file CellProjector.cpp.

References vuVector::getData(), getTetNormals(), GL_LINES, glBegin(), glColor4f(), glEnd(), and glVertex3fv().

Referenced by drawTet().

Here is the call graph for this function:

void vu111211a::drawVoxel int  x,
int  y,
int  z
const [private]
 

Draws a voxel based on the location of its origin (bottom lower left corner).

Definition at line 314 of file CellProjector.cpp.

References drawTet(), FIVE_FOLD, GL_BLEND, GL_DEPTH_BUFFER_BIT, GL_DEPTH_TEST, GL_LIGHTING, glClear(), glDisable(), glEnable(), m_state, m_tetIndex, SIX_FOLD, TETS_DEF_5_FOLD, and TETS_DEF_6_FOLD.

Referenced by drawVoxelsUnsorted().

Here is the call graph for this function:

void vu111211a::drawVoxelsSorted  )  const [private]
 

Draws the voxels sorted.

Definition at line 287 of file CellProjector.cpp.

Referenced by render().

void vu111211a::drawVoxelsUnsorted  )  const [private]
 

Draws the voxels unsorted.

Definition at line 295 of file CellProjector.cpp.

References drawVoxel().

Referenced by render().

Here is the call graph for this function:

vuImage * vu111211a::getBuffer  ) 
 

Returns the currently rendered image.

Definition at line 222 of file CellProjector.cpp.

Referenced by vuCellProjector::getCurrentImage().

byte vu111211a::getIntensity int  vertex[3]  )  const [private]
 

gets the intensity at a particular vertex of a tetrahedron.

Definition at line 554 of file CellProjector.cpp.

References byte.

Referenced by drawTet().

vuVector vu111211a::getNormal vuVector v[3]  )  const [private]
 

gets the normal of the triangle passed in.

Definition at line 543 of file CellProjector.cpp.

References vuVector::cross.

Referenced by getTetNormals().

void vu111211a::getTetNormals int  tetVertexLocations[4][3],
vuVector  normals[4]
const [private]
 

Gets the four normals for a tetrahedron one per face.

Definition at line 509 of file CellProjector.cpp.

References getNormal(), and TRIANGLE_DEF.

Referenced by drawTetNormals(), and getTetOrientation().

Here is the call graph for this function:

void vu111211a::getTetOrientation int  tetVertexLocations[4][3],
char  orientation[4]
const [private]
 

Gets the orientation of a tet.

Definition at line 484 of file CellProjector.cpp.

References vuVector::dot, getTetNormals(), and m_View.

Referenced by drawTet().

Here is the call graph for this function:

void vu111211a::initGrid  )  [private]
 

Initializes the grid to match the size of the data.

Definition at line 575 of file CellProjector.cpp.

References m_grid.

Referenced by read().

void vu111211a::initOpenGL  )  const
 

Initializes open gl for rendering the volume data.

Definition at line 105 of file CellProjector.cpp.

References GL_ALPHA_TEST, GL_AMBIENT_AND_DIFFUSE, GL_BLEND, GL_COLOR_MATERIAL, GL_CULL_FACE, GL_DEPTH_TEST, GL_FILL, GL_FRONT_AND_BACK, GL_NORMALIZE, GL_ONE_MINUS_SRC_ALPHA, GL_SHININESS, GL_SMOOTH, GL_SPECULAR, GL_SRC_ALPHA, glBlendFunc(), glClearColor(), glClearDepth(), glColorMaterial(), glDisable(), glEnable(), GLfloat, glMaterialf(), glMaterialfv(), glPolygonMode(), and glShadeModel().

Referenced by vuCellProjector::glInit().

Here is the call graph for this function:

vu111211a & vu111211a::operator= const vu111211a rhs  ) 
 

Assignment operator which does a deep copy.

Definition at line 73 of file CellProjector.cpp.

References m_grid, m_ImgBuffer, m_isRender, m_isSort, m_state, m_subdivScheme, m_tetIndex, m_View, and vu1112::operator=().

Here is the call graph for this function:

bool vu111211a::read  )  [virtual]
 

Reimplements the read() method to do some extra volume data processing.

Reimplemented from vu11121.

Definition at line 231 of file CellProjector.cpp.

References initGrid(), and vu11121::read().

Referenced by vuCellProjector::init().

Here is the call graph for this function:

bool vu111211a::readRaw  )  [virtual]
 

This method reads volume data stored using the .raw data type.

Definition at line 250 of file CellProjector.cpp.

References byte, and dword.

void vu111211a::render  )  [virtual]
 

Implements the abstract render() method of the vuVolume base class.

Not const becuase render() calls writeImgBuffer() which modifies attribute m_ImgBuffer.

Reimplemented from vu11121.

Definition at line 150 of file CellProjector.cpp.

References vuGrid::drawInOpenGL(), drawVoxelsSorted(), drawVoxelsUnsorted(), vuVector::getData(), GL_COLOR_BUFFER_BIT, GL_LIGHT0, GL_LIGHTING, GL_MODELVIEW, GL_POSITION, glClear(), glDisable(), glEnable(), glLightfv(), glMatrixMode(), glPopMatrix(), glPushMatrix(), glTranslatef(), vu1::IsReRendering(), m_grid, m_isRender, m_View, and writeImgBuffer().

Referenced by vuCellProjector::glRender().

Here is the call graph for this function:

void vu111211a::setViewVectors const vuVector view,
const vuVector up,
const vuVector right
[virtual]
 

Sets the camera viewing position for the render method.

Reimplemented from vu11121.

Definition at line 94 of file CellProjector.cpp.

References m_View.

Referenced by vuCellProjector::glRender().

void vu111211a::writeImgBuffer  )  [private]
 

Writes the current image buffer into m_ImgBuffer so that it will be accessible from outside this module.

Although this function is not virtual, it could conceivably become virtual if more algorithsm implement it.

Definition at line 589 of file CellProjector.cpp.

References vuImage::get_rgb(), vuImage::getHeight(), vuImage::getWidth(), GL_FRONT, GL_VIEWPORT, glGetIntegerv(), glReadBuffer(), glReadPixels(), vuImage::init(), and m_ImgBuffer.

Referenced by render().

Here is the call graph for this function:


Friends And Related Function Documentation

friend class vuCellProjector [friend]
 

Definition at line 55 of file CellProjector.h.


Member Data Documentation

vuGrid vu111211a::m_grid [private]
 

A temporary grid used as visual aid.

Definition at line 226 of file CellProjector.h.

Referenced by initGrid(), operator=(), and render().

vuImage vu111211a::m_ImgBuffer [private]
 

The current image buffer.

Definition at line 195 of file CellProjector.h.

Referenced by drawPic(), operator=(), and writeImgBuffer().

bool vu111211a::m_isRender [private]
 

Whether to render, only used when data size is large.

Definition at line 217 of file CellProjector.h.

Referenced by operator=(), and render().

bool vu111211a::m_isSort [private]
 

Whether or not to perform sorting and triangulation.

Definition at line 214 of file CellProjector.h.

Referenced by vuCellProjector::addCheckBoxIsSort(), vuCellProjector::onCheckBoxIsSort(), and operator=().

DebugEnum vu111211a::m_state [private]
 

Depending on the kind of data read in, different options become avail.

Data sets of 8 or 12 bytes will enable manual display of tets for debugging purposes.

Definition at line 208 of file CellProjector.h.

Referenced by drawTet(), drawVoxel(), vuCellProjector::OnChar(), and operator=().

SubdivEnum vu111211a::m_subdivScheme [private]
 

Subdivision scheme to be used choosable by user.

Definition at line 211 of file CellProjector.h.

Referenced by vuCellProjector::addListBoxSubdivScheme(), vuCellProjector::OnChar(), and operator=().

int vu111211a::m_tetIndex [private]
 

Indexes which tet in a voxel is to be rendered.

Only used when state = MANUAL_TET

Definition at line 223 of file CellProjector.h.

Referenced by drawVoxel(), vuCellProjector::OnChar(), and operator=().

vuVector vu111211a::m_View [private]
 

The view direction, which is updated as the user rotates the data set.

Definition at line 199 of file CellProjector.h.

Referenced by getTetOrientation(), operator=(), render(), and setViewVectors().

const int vu111211a::TETS_DEF_5_FOLD [static, private]
 

Initial value:

 
  {{4,0,1,2}, {7,1,3,2}, {4,2,1,7}, {4,7,6,2}, {4,5,7,1}, 
   {6,0,3,2}, {5,0,1,3}, {5,6,0,3}, {4,5,6,0}, {5,7,6,3}}
5-fold subdivision.

Definition at line 26 of file CellProjector.cpp.

Referenced by drawVoxel().

const int vu111211a::TETS_DEF_6_FOLD [static, private]
 

Initial value:

 
    {{5,1,7,6}, {5,1,6,4}, {4,1,6,0}, {0,1,6,2}, {6,1,3,2}, {6,1,7,3}}
6-fold subdivision.

Definition at line 30 of file CellProjector.cpp.

Referenced by drawVoxel().

const int vu111211a::TRIANGLE_DEF [static, private]
 

Initial value:

 
  {{0,1,2}, {1,3,2}, {0,2,3}, {0,3,1}}
Triangle definition.

Definition at line 38 of file CellProjector.cpp.

Referenced by drawTet(), and getTetNormals().

const int vu111211a::VOXEL_VERTEX_LOCATIONS [static, private]
 

Initial value:

 
  {{0,0,0}, {1,0,0}, {0,1,0}, {1,1,0},
   {0,0,1}, {1,0,1}, {0,1,1}, {1,1,1}}
Voxel definition.

Definition at line 34 of file CellProjector.cpp.

Referenced by drawTet().


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