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

vu1512119 Class Reference

Implements a shear-warp algorithm (based on BCC-grids) for this leaf of the tree. More...

#include <shearWarp.h>

Inheritance diagram for vu1512119:

Inheritance graph
[legend]
Collaboration diagram for vu1512119:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 vu1512119 ()
 The constructor. Sets up a new ShearWarp instance.
virtual ~vu1512119 ()
 The Destructor. Destroys the ShearWarp instance.
void setCanvasSize (int width, int height)
 Sets the size for the canvas.
void setOrthogonalWarpOpenGL (int useOpenGL)
 Turns on/off OpenGL-warping.
void runlengthEncode ()
 Computes the runlength encoding of the volume.
void removeRunlengthEncoding ()
 Removes the runlength encoding.
void setSpecular (int spec)
 Turn on/off the specular light.
void setViewing (int mode)
 Set the projection mode (orthogonal is default).
int getFastClassification ()
 Fast classification currently used?
void setViewVectors (const vuVector &view, const vuVector &up, const vuVector &right)
 Sets the camera viewing position for the render method.
void getDimensions (int &x, int &y, int &z)
 Returns the Dimensions of the volume data.
int getMaxSize (void)
 Returns the Maximum Size of the Volume.
void zoom (float zoomValue)
 Zooms the volume.
void initOpenGL (void)
 Initializes OpenGL.
void render (void)
 Implements the abstract render() method of the vuVolume base class.
virtual bool read (void)
 Reimplements the read() method to do some extra volume data processing.
virtual bool readRaw (void)
 This method reads volume data stored using the .raw data type.
float getMinEyeDistance (void)
 Returns the minimum allowed distance between eye and projection-plane.
void setEyeDistance (float distance)
 Sets the current distance between eye and projection-plane.

Private Member Functions

void computeMaxSize (void)
 Computes the maximum stretch out of the volume and saves the value in attribute maxSize.
void computeNormals (void)
 Precomputes the normals of the voxels.
void computeMainViewingDirection (void)
 Computes the main viewing direction.
void computePermutationMatrix (void)
 Computes the correct permutation matrix.
void computeViewMatrix (void)
 Computes the view matrix for coordinates in standard object space.
void computeEyePoint (void)
 Computes the position of the eye point (needed for perspective projection).
void computeRunlengthSizes (void)
 Determines width, height and depth of the Volume and saves these values in runlengthWidth...
void computeShearAndWarpFactorsOrtho (void)
 Computes the Shear and Warp Factors for parallel projection.
void shearOrtho (void)
 Shearing the runlength encoded data for parallel projection.
float computeZNormalizedViewingVectorLength (void)
 Compute the length of the Z-normalized viewing vector.
void computeInvWarpOrtho (void)
 Computes the inverse 2D-warp-matrix.
void warpOrthoInv (float x, float y, float &x_result, float &y_result)
 Inverse warping for orthogonal viewing for a single point with x- and y-coordinates.
void warpOrtho ()
 The total orthogonal warping from intermediate image to OpenGL-texture.
void makeIntermediateImageOrtho (void)
 Creating the intermediate image for parallel projection.
void changeFormatIntermediate (void)
 change the format of the intermediate image to OpenGL-format
void drawWarpOpenGL (void)
 draw the final image using OpenGL for warping
byte getSample (dword x, dword y, dword z)
 Returns the value of the sample at the given coordinates.
void computeShearPerspective (void)
 Computes the Shear Matrix for perspective projection.
void computeWarpPerspective (void)
 Computes the Warp Matrix for perspective projection.
void computeSlicePositionScale (float &pos_i, float &pos_j, float &scale, int slice)
 Computes position and the scaling for a single slice.
void shearPerspective (void)
 Shears the runlength encoded data for perspective projection.
void warpPerspectiveInv (float x, float y, float &x_result, float &y_result)
 Performs an inverse perspective warp.
void warpPerspective (void)
 The total perspective warping from intermediate image to OpenGL-texture.
void makeIntermediateImagePerspective (void)
 Creating the intermediate image for perspective projection.
void drawOpenGL (void)
 Draws the final image with openGL.
void createGLImage (void)
 Assign memory for the OpenGL-image.

Private Attributes

floatm_Normals
 Stores an array of normal vectors.
vuVector m_View
 The viewing direction of the camera.
vuVector m_Up
 The up direction of the camera.
vuVector m_Right
 The right direction of the camera.
vuMatrix viewMatrix
 The view matrix.
vuMatrix permMatrix
 The permutation matrix.
vuMatrix worldMatrix
 The world matrix.
vuMatrix shearMatrix
 The shear matrix.
vuMatrix warpMatrix
 The warp matrix.
vuMatrix invWarpMatrix
 The inverse of the warp matrix.
vuMatrix projMatrix
 The perspective projection matrix (needed only for perspective viewing.
vuMatrix invWorldMatrix
 The inverse of the worldMatrix.
float invWarpOrtho00
 Element 00 of the inverse 2D-Warp-Matrix for orthogonal projection.
float invWarpOrtho01
 Element 01 of the inverse 2D-Warp-Matrix for orthogonal projection.
float invWarpOrtho10
 Element 10 of the inverse 2D-Warp-Matrix for orthogonal projection.
float invWarpOrtho11
 Element 11 of the inverse 2D-Warp-Matrix for orthogonal projection.
vuVector eye_o
 The eye point (for perspective projection) in object-space.
vuVector eye_s
 The eye point (for perspective projection) in sheared space.
int mainViewingDir
 The current main viewing direction.
int canvasWidth
 The width of the canvas.
int canvasHeight
 The height of the canvas.
GLuint m_GLShearWarp
 Needed for OpenGL-texturing.
int viewingMode
 Orthogonal or perspective viewing?
int specular
 Use specular light for shading?
int orthoWarpOpenGL
 Use OpenGL for orthogonal warping.
RLEslice_bccdataX
 Runlength encoded data for main viewing direction X.
RLEslice_bccdataY
 Runlength encoded data for main viewing direction Y.
RLEslice_bccdataZ
 Runlength encoded data for main viewing direction Z.
RLEslice_bcccurr
 The currently used runlength encoded data.
byte direction
 Holds the direction in which the volume shall be traversed.
dword maxSize
 The maximum stretch-out of the volume.
dword volumeDepth
 The depth of the volume.
dword volumeWidth
 The width of the volume.
dword volumeHeight
 The height of the volume.
double si
 The shearing in dimension i.
double sj
 The shearing in dimension j.
float ti
 The value about which the front slice of the data is shifted in the intermediate image horizontally.
float tj
 The value about which the front slice of the data is shifted in the intermediate image vertically.
intermediatePixel_bccintermediate
 The intermediate image.
float eye_distance
int left
 The left, right, up and down limits of the intermediate image.
int right
int up
int down
float scale_total
 The perspective scaling factor.
float zoomValue
 Current zoom-value.
GLubyteglImage
 The image that later is processed by OpenGL.
int glImageWidth
 The width of the OpenGL image.
int glImageHeight
 The height of the OpenGL image.

Detailed Description

Implements a shear-warp algorithm (based on BCC-grids) for this leaf of the tree.

This class renders the volume using a shear-warp algorithm implemented within the scope of an "Informatikpraktikum 1" by Sebastian Zambal. The shear warp algorithm shears the slices of pixels of a given volume to achive different views of the volume. Unfortunately the projection of the slices results in a skew image. This intermediate image then has to be warped to get the correct final image.

Definition at line 141 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.


Constructor & Destructor Documentation

vu1512119::vu1512119  ) 
 

The constructor. Sets up a new ShearWarp instance.

The constructor sets up a new ShearWarp instance and resets the zoom value, the normal vector table, the pointer to the runlength encoded data, the pointer to the currently used runlength encoded data, the intermediate image, the viewing mode (orthogonal, perspective) and the OpenGL-texture.

Definition at line 21 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References curr, dataX, dataY, dataZ, intermediate, m_GLShearWarp, m_Normals, orthoWarpOpenGL, specular, viewingMode, and zoomValue.

vu1512119::~vu1512119  )  [virtual]
 

The Destructor. Destroys the ShearWarp instance.

The destructor frees all occupied memory: the OpenGL-Image, the normal vector table and the runlength encoded data.

Definition at line 52 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References dataX, dataY, dataZ, dword, glImage, RLEslice_bcc::runlength, RLEslice_bcc::size, and RLEslice_bcc::voxel.


Member Function Documentation

void vu1512119::changeFormatIntermediate void   )  [private]
 

change the format of the intermediate image to OpenGL-format

Definition at line 1376 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References intermediatePixel_bcc::blue, dword, glImage, glImageHeight, glImageWidth, GLubyte, intermediatePixel_bcc::green, intermediate, maxSize, intermediatePixel_bcc::red, si, sj, and word.

Referenced by render().

void vu1512119::computeEyePoint void   )  [private]
 

Computes the position of the eye point (needed for perspective projection).

Definition at line 1625 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References eye_o, vuMatrix::inverse(), invWorldMatrix, and worldMatrix.

Referenced by render().

Here is the call graph for this function:

void vu1512119::computeInvWarpOrtho void   )  [private]
 

Computes the inverse 2D-warp-matrix.

Definition at line 1489 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References invWarpOrtho00, invWarpOrtho01, invWarpOrtho10, invWarpOrtho11, and viewMatrix.

Referenced by render().

void vu1512119::computeMainViewingDirection void   )  [private]
 

Computes the main viewing direction.

Definition at line 803 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References m_View, and mainViewingDir.

Referenced by render().

void vu1512119::computeMaxSize void   )  [private]
 

Computes the maximum stretch out of the volume and saves the value in attribute maxSize.

Definition at line 119 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References maxSize.

Referenced by read().

void vu1512119::computeNormals void   )  [private]
 

Precomputes the normals of the voxels.

Definition at line 692 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References dword, and m_Normals.

Referenced by read(), and readRaw().

void vu1512119::computePermutationMatrix void   )  [private]
 

Computes the correct permutation matrix.

Definition at line 822 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References permMatrix, XDIR, YDIR, and ZDIR.

Referenced by render().

void vu1512119::computeRunlengthSizes void   )  [private]
 

Determines width, height and depth of the Volume and saves these values in runlengthWidth...

Definition at line 934 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References volumeDepth, volumeHeight, volumeWidth, XDIR, YDIR, and ZDIR.

Referenced by render().

void vu1512119::computeShearAndWarpFactorsOrtho void   )  [private]
 

Computes the Shear and Warp Factors for parallel projection.

Definition at line 962 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References si, sj, ti, tj, and viewMatrix.

Referenced by render().

void vu1512119::computeShearPerspective void   )  [private]
 

Computes the Shear Matrix for perspective projection.

Definition at line 1642 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References eye_o, vuMatrix::makeIdentity(), and shearMatrix.

Referenced by render().

Here is the call graph for this function:

void vu1512119::computeSlicePositionScale float pos_i,
float pos_j,
float scale,
int  slice
[private]
 

Computes position and the scaling for a single slice.

Parameters:
pos_i the x-coordinate of the result
pos_j the y-coordinate of the result
scale the scaling factor for this slice
the slice for which computations are to be done

Definition at line 1657 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References scale_total, volumeHeight, and volumeWidth.

Referenced by shearPerspective().

void vu1512119::computeViewMatrix void   )  [private]
 

Computes the view matrix for coordinates in standard object space.

Definition at line 855 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References vuVector::cross, cross(), vuMatrix::makeIdentity(), vuMatrix::makeRotate(), vuMatrix::makeRotateZ(), vuVector::makeUnit(), projMatrix, up, viewingMode, viewMatrix, worldMatrix, YDIR, and ZDIR.

Referenced by render().

Here is the call graph for this function:

void vu1512119::computeWarpPerspective void   )  [private]
 

Computes the Warp Matrix for perspective projection.

Definition at line 1761 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References vuMatrix::inverse(), invWarpMatrix, vuMatrix::makeIdentity(), vuMatrix::makeScale(), permMatrix, scale_total, shearMatrix, and warpMatrix.

Referenced by render().

Here is the call graph for this function:

float vu1512119::computeZNormalizedViewingVectorLength void   )  [private]
 

Compute the length of the Z-normalized viewing vector.

Returns:
the length of the Z-normalized viewing vector.

Definition at line 1063 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References m_View, mainViewingDir, and vuVector::makeUnit().

Referenced by makeIntermediateImageOrtho(), and makeIntermediateImagePerspective().

Here is the call graph for this function:

void vu1512119::createGLImage void   )  [private]
 

Assign memory for the OpenGL-image.

Definition at line 104 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References glImage, glImageHeight, glImageWidth, GLubyte, maxSize, and word.

Referenced by read().

void vu1512119::drawOpenGL void   )  [private]
 

Draws the final image with openGL.

Definition at line 2154 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References GL_CLAMP, GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_LINEAR, GL_MODELVIEW, GL_PROJECTION, GL_QUADS, GL_REPLACE, GL_RGBA, GL_TEXTURE_2D, GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_TEXTURE_MAG_FILTER, GL_TEXTURE_MIN_FILTER, GL_TEXTURE_WRAP_S, GL_TEXTURE_WRAP_T, GL_UNSIGNED_BYTE, glBegin(), glClear(), glDisable(), glEnable(), glEnd(), glFlush(), glImage, glImageHeight, glImageWidth, glLoadIdentity(), glMatrixMode(), glOrtho(), glTexCoord2f(), glTexEnvf(), glTexImage2D(), glTexParameteri(), glVertex3f(), and zoomValue.

Referenced by render().

Here is the call graph for this function:

void vu1512119::drawWarpOpenGL void   )  [private]
 

draw the final image using OpenGL for warping

Definition at line 1414 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References GL_CLAMP, GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_LINEAR, GL_MODELVIEW, GL_PROJECTION, GL_QUADS, GL_REPLACE, GL_RGBA, GL_TEXTURE_2D, GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_TEXTURE_MAG_FILTER, GL_TEXTURE_MIN_FILTER, GL_TEXTURE_WRAP_S, GL_TEXTURE_WRAP_T, GL_UNSIGNED_BYTE, glBegin(), glClear(), glDisable(), glEnable(), glEnd(), glFlush(), glImage, glImageHeight, glImageWidth, glLoadIdentity(), glMatrixMode(), glOrtho(), glTexCoord2f(), glTexEnvf(), glTexImage2D(), glTexParameteri(), glVertex3f(), viewMatrix, XDIR, YDIR, and zoomValue.

Referenced by render().

Here is the call graph for this function:

void vu1512119::getDimensions int &  x,
int &  y,
int &  z
 

Returns the Dimensions of the volume data.

Definition at line 95 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

Referenced by vuBCCShearWarp::init().

int vu1512119::getFastClassification  ) 
 

Fast classification currently used?

Returns whether fast classification currently is used.

Returns:
0 = currently not using fast classification, 1 = using fast classification

int vu1512119::getMaxSize void   ) 
 

Returns the Maximum Size of the Volume.

Definition at line 1603 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

Referenced by vuBCCShearWarp::OnScrollPerspective().

float vu1512119::getMinEyeDistance void   ) 
 

Returns the minimum allowed distance between eye and projection-plane.

Definition at line 1611 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References maxSize.

Referenced by vuBCCShearWarp::OnScrollPerspective(), and read().

byte vu1512119::getSample dword  x,
dword  y,
dword  z
[private]
 

Returns the value of the sample at the given coordinates.

Definition at line 1590 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References byte, and dword.

void vu1512119::initOpenGL void   ) 
 

Initializes OpenGL.

OpenGL is used for graphics output.

Definition at line 2200 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References GL_LINEAR, GL_REPEAT, GL_RGBA, GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_TEXTURE_MIN_FILTER, GL_TEXTURE_WRAP_S, GL_TEXTURE_WRAP_T, GL_UNPACK_ALIGNMENT, GL_UNSIGNED_BYTE, glBindTexture(), glClearColor(), glGenTextures(), glImage, glImageHeight, glImageWidth, glPixelStorei(), glTexImage2D(), glTexParameteri(), and m_GLShearWarp.

Referenced by vuBCCShearWarp::glInit().

Here is the call graph for this function:

void vu1512119::makeIntermediateImageOrtho void   )  [private]
 

Creating the intermediate image for parallel projection.

Definition at line 1076 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References RLEvoxel_bcc::blue, intermediatePixel_bcc::blue, RLEvoxel_bcc::blue_shaded, byte, computeZNormalizedViewingVectorLength(), curr, RLEslice_bcc::dim1_pos, RLEslice_bcc::dim2_pos, direction, vuVector::dot, dword, RLEvoxel_bcc::green, intermediatePixel_bcc::green, RLEvoxel_bcc::green_shaded, intermediate, m_View, vuVector::makeUnit(), maxSize, RLEvoxel_bcc::normal, intermediatePixel_bcc::offset, RLEvoxel_bcc::opacity_corr, pow(), RLEvoxel_bcc::red, intermediatePixel_bcc::red, RLEvoxel_bcc::red_shaded, RLEslice_bcc::runlength, RLEslice_bcc::size, specular, intermediatePixel_bcc::trans, volumeDepth, and RLEslice_bcc::voxel.

Referenced by render().

Here is the call graph for this function:

void vu1512119::makeIntermediateImagePerspective void   )  [private]
 

Creating the intermediate image for perspective projection.

Definition at line 1865 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References RLEvoxel_bcc::blue, intermediatePixel_bcc::blue, RLEvoxel_bcc::blue_shaded, byte, computeZNormalizedViewingVectorLength(), curr, RLEslice_bcc::dim1_pos, RLEslice_bcc::dim2_pos, direction, vuVector::dot, dword, RLEvoxel_bcc::green, intermediatePixel_bcc::green, RLEvoxel_bcc::green_shaded, intermediate, m_View, vuVector::makeUnit(), maxSize, RLEvoxel_bcc::normal, intermediatePixel_bcc::offset, RLEvoxel_bcc::opacity_corr, pow(), RLEvoxel_bcc::red, intermediatePixel_bcc::red, RLEvoxel_bcc::red_shaded, RLEslice_bcc::runlength, RLEslice_bcc::scale, RLEslice_bcc::size, specular, intermediatePixel_bcc::trans, volumeDepth, RLEslice_bcc::voxel, and word.

Referenced by render().

Here is the call graph for this function:

bool vu1512119::read void   )  [virtual]
 

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

Reimplemented from vu15121.

Definition at line 185 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References computeMaxSize(), computeNormals(), createGLImage(), eye_distance, getMinEyeDistance(), m_Normals, vu15121::read(), and runlengthEncode().

Referenced by vuBCCShearWarp::init().

Here is the call graph for this function:

bool vu1512119::readRaw void   )  [virtual]
 

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

Definition at line 211 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References byte, computeNormals(), dword, and m_Normals.

Here is the call graph for this function:

void vu1512119::removeRunlengthEncoding  ) 
 

Removes the runlength encoding.

Frees all memory that was allocated by the runlength encoded Data.

Definition at line 250 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References dataX, dataY, dataZ, dword, RLEslice_bcc::runlength, RLEslice_bcc::size, and RLEslice_bcc::voxel.

Referenced by runlengthEncode().

void vu1512119::render void   )  [virtual]
 

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

This method does the complete rendering by calling the steps of the algorithm (i.e. other methods) one by one.

Implements vu1.

Definition at line 2224 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References changeFormatIntermediate(), computeEyePoint(), computeInvWarpOrtho(), computeMainViewingDirection(), computePermutationMatrix(), computeRunlengthSizes(), computeShearAndWarpFactorsOrtho(), computeShearPerspective(), computeViewMatrix(), computeWarpPerspective(), drawOpenGL(), drawWarpOpenGL(), makeIntermediateImageOrtho(), makeIntermediateImagePerspective(), orthoWarpOpenGL, shearOrtho(), shearPerspective(), VIEWING_MODE_ORTHO, VIEWING_MODE_PERSPECTIVE, warpOrtho(), and warpPerspective().

Referenced by vuBCCShearWarp::glRender(), vuBCCShearWarp::OnButtonApplyViewing(), vuBCCShearWarp::OnButtonTransferFunction(), vuBCCShearWarp::OnRadioBoxProjection(), and vuBCCShearWarp::OnScrollPerspective().

Here is the call graph for this function:

void vu1512119::runlengthEncode  ) 
 

Computes the runlength encoding of the volume.

Does runlength encoding for each of the main viewing directions. After execution of this method the attributes dataX, dataY and dataZ hold the runlength encoded volume data according to the different main viewing directions.

Definition at line 285 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References RLEvoxel_bcc::blue, byte, dataX, dataY, dataZ, RLEslice_bcc::dim1_pos, RLEslice_bcc::dim2_pos, dword, RLEvoxel_bcc::green, intermediate, m_Normals, m_View, vuVector::makeUnit(), maxSize, RLEvoxel_bcc::normal, RLEvoxel_bcc::opacity, RLEvoxel_bcc::red, removeRunlengthEncoding(), RLEslice_bcc::runlength, RLEslice_bcc::scale, RLEslice_bcc::size, RLEvoxel_bcc::value, RLEslice_bcc::voxel, and word.

Referenced by vuBCCShearWarp::glOnMouse(), vuBCCShearWarp::OnButtonTransferFunction(), and read().

Here is the call graph for this function:

void vu1512119::setCanvasSize int  width,
int  height
 

Sets the size for the canvas.

This method must be called by vuShearWarp when then window is resized and the canvas gets a new size.

Parameters:
width the width of the canvas.
height the height of the canvas.

Definition at line 174 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References canvasHeight, and canvasWidth.

Referenced by vuBCCShearWarp::glResize().

void vu1512119::setEyeDistance float  distance  ) 
 

Sets the current distance between eye and projection-plane.

Parameters:
distance the distance between eye and projection-plane

Definition at line 1618 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References eye_distance.

Referenced by vuBCCShearWarp::OnScrollPerspective().

void vu1512119::setOrthogonalWarpOpenGL int  useOpenGL  ) 
 

Turns on/off OpenGL-warping.

With this method between warping with software and warping with OpenGL can be choosen.

Parameters:
userOpenGL 0 = warp with software, 1 = warp with OpenGL

Definition at line 165 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References orthoWarpOpenGL.

Referenced by vuBCCShearWarp::OnCheckBoxWarpOpenGL().

void vu1512119::setSpecular int  spec  ) 
 

Turn on/off the specular light.

This method must be called when the specular light is to be turned on/off

Parameters:
spec 0 for turn off specular light, 1 for turn on.

Definition at line 149 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References specular.

Referenced by vuBCCShearWarp::OnCheckBoxSpecular().

void vu1512119::setViewing int  mode  ) 
 

Set the projection mode (orthogonal is default).

Sets the viewing mode (i.e. the type of projection to the final image) to either orthogonal or perspective projection.

Parameters:
mode the viewing/projection mode. Possible values are VIEWING_MODE_ORTHO and VIEWING_MODE_PERSPECTIVE.

Definition at line 141 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References viewingMode.

Referenced by vuBCCShearWarp::OnRadioBoxProjection().

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

Sets the camera viewing position for the render method.

setViewVectors updates the viewing vector, the up vector and the right vector. In other words this method sets a new camera viewing position.

Implements vu1.

Definition at line 130 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References m_Right, m_Up, and m_View.

Referenced by vuBCCShearWarp::glRender(), and vuBCCShearWarp::OnButtonApplyViewing().

void vu1512119::shearOrtho void   )  [private]
 

Shearing the runlength encoded data for parallel projection.

Definition at line 981 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References curr, RLEslice_bcc::dim1_pos, RLEslice_bcc::dim2_pos, direction, dword, m_View, vuVector::makeUnit(), maxSize, orthoWarpOpenGL, si, sj, volumeHeight, volumeWidth, XDIR, YDIR, and ZDIR.

Referenced by render().

Here is the call graph for this function:

void vu1512119::shearPerspective void   )  [private]
 

Shears the runlength encoded data for perspective projection.

Definition at line 1699 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References computeSlicePositionScale(), curr, direction, m_View, vuVector::makeUnit(), scale_total, volumeDepth, XDIR, YDIR, and ZDIR.

Referenced by render().

Here is the call graph for this function:

void vu1512119::warpOrtho  )  [private]
 

The total orthogonal warping from intermediate image to OpenGL-texture.

Definition at line 1519 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References intermediatePixel_bcc::blue, glImage, glImageWidth, GLubyte, intermediatePixel_bcc::green, intermediate, maxSize, intermediatePixel_bcc::red, and warpOrthoInv().

Referenced by render().

Here is the call graph for this function:

void vu1512119::warpOrthoInv float  x,
float  y,
float x_result,
float y_result
[private]
 

Inverse warping for orthogonal viewing for a single point with x- and y-coordinates.

Definition at line 1509 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References invWarpOrtho00, invWarpOrtho01, invWarpOrtho10, and invWarpOrtho11.

Referenced by warpOrtho().

void vu1512119::warpPerspective void   )  [private]
 

The total perspective warping from intermediate image to OpenGL-texture.

Definition at line 1794 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References intermediatePixel_bcc::blue, glImage, glImageWidth, GLubyte, intermediatePixel_bcc::green, intermediate, maxSize, intermediatePixel_bcc::red, and warpPerspectiveInv().

Referenced by render().

Here is the call graph for this function:

void vu1512119::warpPerspectiveInv float  x,
float  y,
float x_result,
float y_result
[private]
 

Performs an inverse perspective warp.

Applies the inverse of perspective warping to a single point.

Parameters:
x the x-coordinate of the point that is to be transformed
y the y-coordinate of the point that is to be transformed
x_result the x-coordiante of the transformed point
y_result the y-coordinate of the transformed point

Definition at line 1775 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

Referenced by warpPerspective().

void vu1512119::zoom float  zoomValue  ) 
 

Zooms the volume.

Sets the zoom-value.

Definition at line 157 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.cpp.

References zoomValue.

Referenced by vuBCCShearWarp::glOnMouse().


Member Data Documentation

int vu1512119::canvasHeight [private]
 

The height of the canvas.

Holds the height of the used canvas. This value is needed for computing the vertical scaling factor of the final image.

Definition at line 469 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by setCanvasSize().

int vu1512119::canvasWidth [private]
 

The width of the canvas.

Holds the width of the used canvas. This value is needed for computing the horizontal scaling factor of the final image.

Definition at line 463 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by setCanvasSize().

RLEslice_bcc* vu1512119::curr [private]
 

The currently used runlength encoded data.

Points to the currently used runlength encoded data. This depends on the main viewing direction

Definition at line 493 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by makeIntermediateImageOrtho(), makeIntermediateImagePerspective(), shearOrtho(), shearPerspective(), and vu1512119().

RLEslice_bcc* vu1512119::dataX [private]
 

Runlength encoded data for main viewing direction X.

Definition at line 482 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by removeRunlengthEncoding(), runlengthEncode(), vu1512119(), and ~vu1512119().

RLEslice_bcc* vu1512119::dataY [private]
 

Runlength encoded data for main viewing direction Y.

Definition at line 484 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by removeRunlengthEncoding(), runlengthEncode(), vu1512119(), and ~vu1512119().

RLEslice_bcc* vu1512119::dataZ [private]
 

Runlength encoded data for main viewing direction Z.

Definition at line 486 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by removeRunlengthEncoding(), runlengthEncode(), vu1512119(), and ~vu1512119().

byte vu1512119::direction [private]
 

Holds the direction in which the volume shall be traversed.

Shall the volume be traversed foreward or backward? The value 0 means that the volume has to be traversed backward, 1 means it has to be traversed foreward.

Definition at line 501 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by makeIntermediateImageOrtho(), makeIntermediateImagePerspective(), shearOrtho(), and shearPerspective().

int vu1512119::down [private]
 

Definition at line 557 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

float vu1512119::eye_distance [private]
 

Definition at line 551 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by read(), and setEyeDistance().

vuVector vu1512119::eye_o [private]
 

The eye point (for perspective projection) in object-space.

Definition at line 451 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by computeEyePoint(), and computeShearPerspective().

vuVector vu1512119::eye_s [private]
 

The eye point (for perspective projection) in sheared space.

Definition at line 453 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

GLubyte* vu1512119::glImage [private]
 

The image that later is processed by OpenGL.

Definition at line 569 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by changeFormatIntermediate(), createGLImage(), drawOpenGL(), drawWarpOpenGL(), initOpenGL(), warpOrtho(), warpPerspective(), and ~vu1512119().

int vu1512119::glImageHeight [private]
 

The height of the OpenGL image.

Definition at line 574 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by changeFormatIntermediate(), createGLImage(), drawOpenGL(), drawWarpOpenGL(), and initOpenGL().

int vu1512119::glImageWidth [private]
 

The width of the OpenGL image.

Definition at line 572 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by changeFormatIntermediate(), createGLImage(), drawOpenGL(), drawWarpOpenGL(), initOpenGL(), warpOrtho(), and warpPerspective().

intermediatePixel_bcc* vu1512119::intermediate [private]
 

The intermediate image.

An array that stores the pixels of the intermediate image.

Definition at line 548 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by changeFormatIntermediate(), makeIntermediateImageOrtho(), makeIntermediateImagePerspective(), runlengthEncode(), vu1512119(), warpOrtho(), and warpPerspective().

vuMatrix vu1512119::invWarpMatrix [private]
 

The inverse of the warp matrix.

When warping with software, for each point in the final image the corresponding point (actually 4 points which are then interpolated) in the intermediate image must be found. So we need the inverse of the warp matrix.

Definition at line 426 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by computeWarpPerspective().

float vu1512119::invWarpOrtho00 [private]
 

Element 00 of the inverse 2D-Warp-Matrix for orthogonal projection.

Definition at line 442 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by computeInvWarpOrtho(), and warpOrthoInv().

float vu1512119::invWarpOrtho01 [private]
 

Element 01 of the inverse 2D-Warp-Matrix for orthogonal projection.

Definition at line 444 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by computeInvWarpOrtho(), and warpOrthoInv().

float vu1512119::invWarpOrtho10 [private]
 

Element 10 of the inverse 2D-Warp-Matrix for orthogonal projection.

Definition at line 446 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by computeInvWarpOrtho(), and warpOrthoInv().

float vu1512119::invWarpOrtho11 [private]
 

Element 11 of the inverse 2D-Warp-Matrix for orthogonal projection.

Definition at line 448 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by computeInvWarpOrtho(), and warpOrthoInv().

vuMatrix vu1512119::invWorldMatrix [private]
 

The inverse of the worldMatrix.

Transforms from world coordinates to object coordinates.

Definition at line 439 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by computeEyePoint().

int vu1512119::left [private]
 

The left, right, up and down limits of the intermediate image.

Definition at line 554 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

GLuint vu1512119::m_GLShearWarp [private]
 

Needed for OpenGL-texturing.

Definition at line 472 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by initOpenGL(), and vu1512119().

float* vu1512119::m_Normals [private]
 

Stores an array of normal vectors.

Definition at line 371 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by computeNormals(), read(), readRaw(), runlengthEncode(), and vu1512119().

vuVector vu1512119::m_Right [private]
 

The right direction of the camera.

Definition at line 380 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by setViewVectors().

vuVector vu1512119::m_Up [private]
 

The up direction of the camera.

Definition at line 377 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by setViewVectors().

vuVector vu1512119::m_View [private]
 

The viewing direction of the camera.

Definition at line 374 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by computeMainViewingDirection(), computeZNormalizedViewingVectorLength(), makeIntermediateImageOrtho(), makeIntermediateImagePerspective(), runlengthEncode(), setViewVectors(), shearOrtho(), and shearPerspective().

int vu1512119::mainViewingDir [private]
 

The current main viewing direction.

Definition at line 456 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by computeMainViewingDirection(), and computeZNormalizedViewingVectorLength().

dword vu1512119::maxSize [private]
 

The maximum stretch-out of the volume.

Holds the maximum stretch-out of all three dimensions of the volume

Definition at line 507 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by changeFormatIntermediate(), computeMaxSize(), createGLImage(), getMinEyeDistance(), makeIntermediateImageOrtho(), makeIntermediateImagePerspective(), runlengthEncode(), shearOrtho(), warpOrtho(), and warpPerspective().

int vu1512119::orthoWarpOpenGL [private]
 

Use OpenGL for orthogonal warping.

Definition at line 479 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by render(), setOrthogonalWarpOpenGL(), shearOrtho(), and vu1512119().

vuMatrix vu1512119::permMatrix [private]
 

The permutation matrix.

Represents the matrix that permutates the coordinates in such a way that the Z-axis becomes the main viewing direction.

Definition at line 396 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by computePermutationMatrix(), and computeWarpPerspective().

vuMatrix vu1512119::projMatrix [private]
 

The perspective projection matrix (needed only for perspective viewing.

This matrix represents a perspective projection.

Definition at line 433 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by computeViewMatrix().

int vu1512119::right [private]
 

Definition at line 555 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

float vu1512119::scale_total [private]
 

The perspective scaling factor.

The factor, by which the intermediate image must be scaled to get the right final size (only perspective projection).

Definition at line 563 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by computeSlicePositionScale(), computeWarpPerspective(), and shearPerspective().

vuMatrix vu1512119::shearMatrix [private]
 

The shear matrix.

This matrix performs the shearing step in the shear-warp algorithm.

Definition at line 410 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by computeShearPerspective(), and computeWarpPerspective().

double vu1512119::si [private]
 

The shearing in dimension i.

si holds the value about which the positions of two adjacent slices of the volume differ in horizontal direction.

Definition at line 530 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by changeFormatIntermediate(), computeShearAndWarpFactorsOrtho(), and shearOrtho().

double vu1512119::sj [private]
 

The shearing in dimension j.

sj holds the value about which the positions of two adjacent planes of the volume differ in vertical direction

Definition at line 536 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by changeFormatIntermediate(), computeShearAndWarpFactorsOrtho(), and shearOrtho().

int vu1512119::specular [private]
 

Use specular light for shading?

Definition at line 477 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by makeIntermediateImageOrtho(), makeIntermediateImagePerspective(), setSpecular(), and vu1512119().

float vu1512119::ti [private]
 

The value about which the front slice of the data is shifted in the intermediate image horizontally.

Definition at line 540 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by computeShearAndWarpFactorsOrtho().

float vu1512119::tj [private]
 

The value about which the front slice of the data is shifted in the intermediate image vertically.

Definition at line 543 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by computeShearAndWarpFactorsOrtho().

int vu1512119::up [private]
 

Definition at line 556 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by computeViewMatrix().

int vu1512119::viewingMode [private]
 

Orthogonal or perspective viewing?

Definition at line 475 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by computeViewMatrix(), setViewing(), and vu1512119().

vuMatrix vu1512119::viewMatrix [private]
 

The view matrix.

Represents the matrix that transforms a point in object space to its corresponding position in the final image. So this matrix represents the total viewing transformation.

Definition at line 388 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by computeInvWarpOrtho(), computeShearAndWarpFactorsOrtho(), computeViewMatrix(), and drawWarpOpenGL().

dword vu1512119::volumeDepth [private]
 

The depth of the volume.

The depth of the volume (depends on the main viewing direction!)

Definition at line 513 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by computeRunlengthSizes(), makeIntermediateImageOrtho(), makeIntermediateImagePerspective(), and shearPerspective().

dword vu1512119::volumeHeight [private]
 

The height of the volume.

The height of the volume (depends on the main viewing direction!)

Definition at line 523 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by computeRunlengthSizes(), computeSlicePositionScale(), and shearOrtho().

dword vu1512119::volumeWidth [private]
 

The width of the volume.

The width of the volume (depends on the main viewing direction!)

Definition at line 518 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by computeRunlengthSizes(), computeSlicePositionScale(), and shearOrtho().

vuMatrix vu1512119::warpMatrix [private]
 

The warp matrix.

This matrix performs the warping step in the shear-warp algorithm

Definition at line 417 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by computeWarpPerspective().

vuMatrix vu1512119::worldMatrix [private]
 

The world matrix.

Transforms a point from object coordinates to world coordinates.

Definition at line 403 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by computeEyePoint(), and computeViewMatrix().

float vu1512119::zoomValue [private]
 

Current zoom-value.

Definition at line 566 of file BCC/Unimodal/3d/1B/Intensity/ShearWarp/shearWarp.h.

Referenced by drawOpenGL(), drawWarpOpenGL(), vu1512119(), and zoom().


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