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

vu1512112 Class Reference

Implements a sheet-based splatter for this leaf of the tree. More...

#include <SheetSplat.h>

Inheritance diagram for vu1512112:

Inheritance graph
[legend]
Collaboration diagram for vu1512112:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 vu1512112 ()
 Default constructor creating an empty instance.
virtual ~vu1512112 ()
 Destructor.
vu1512112operator= (const vu1512112 &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 setFootprintSize (float size)
 Sets the size of the splatting footprint.
float getFootprintSize () const
 Returns the size of the splatting footprint.
void setSliceWidth (const float size)
 sets the width of a slice
float getSliceWidth () const
 Returns the width of a slice.
void initOpenGL (void)
 Initializes open gl for rendering the volume data.
void render ()
 Implements the abstract render() method of the vuVolume base class.
virtual bool read ()
 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.
vuVector getCenter ()
bool setImageSize (int width, int height)
void setBGColour (float r, float g, float b)
void doRefresh ()
 recalculate image otherwise the existing framebuffer will be blitted to the screen

Private Member Functions

void run (int whatsup, void *data)
 overrides a virtual from vuThread allowing distributed rendering
void preprocess (void)
 Preprocesses volume data for rendering once it's been read.
void initSheets (float dist0, float ddist)
 allocates setup number of sheets without memory for entries
void prepareSheets ()
 allocates setup number of sheets without memory for entries
void clearSheets ()
 frees memory of bins
void sortByDistance ()
 sort voxels by distance uses the eye position of the camera, dimensions of the dataset, thickness of the slices and radius of splatting kernel to determine maximal number of slices
void drawSlice (RGBABuffer &sheet, int n)
 draws one slice to the back-buffer
void drawSlices ()
void showHistogram ()

Private Attributes

float m_SplatRadius
 size of a splat
float m_SliceWidth
 width of a slice
dword m_SpS_2
 ((slices per splat) / 2)_
float m_SplatCrop
 depth tolerance below which splat in slice is ignored
int m_NSlices
 number of slices
dword ** m_Slices
 index bucket for each slice ([0] is N of elements)
floatm_SliceDist
 distance of each single slice
floatm_SplatPos
 projected coordinates with distance in 3rd component
bool m_Exclude [256]
 exclude intensities from rendering
vuVectorm_Normals
 stores three normal components per voxel
floatm_Shading
 stores two shading coefficients per voxel first is diffuse l*n, second is specular (r*v)^shin
SplatSlicer m_Splat
int m_FBWidth
int m_FBHeight
RGBABuffer m_FrameBuffer
RGBABuffer m_SheetBuffer
vuVector m_Center
float m_BGColour [4]
 background colour
vuColourRGBa m_LightSpecular
 specular colour with alpha weight
float m_LightDiffuse
 weight for diffuse relection
float m_LightAmbient
 weight for ambient
unsigned int m_LightShininess
 exponent for shininess
vuVector m_LightDir
 direction for parallel light
int m_CurrentSheet
vuMutex m_FBMutex
bool m_DataPrepared
bool m_Refresh
 calculate new image

Detailed Description

Implements a sheet-based splatter for this leaf of the tree.

Definition at line 23 of file SheetSplat.h.


Constructor & Destructor Documentation

vu1512112::vu1512112  ) 
 

Default constructor creating an empty instance.

Definition at line 50 of file SheetSplat.cpp.

References m_DataPrepared, m_LightAmbient, m_LightDiffuse, m_LightDir, m_LightShininess, m_LightSpecular, m_Normals, m_Shading, m_SliceDist, m_Slices, m_SplatPos, setBGColour(), setFootprintSize(), setImageSize(), setSliceWidth(), SHSP_SHEETWIDTH, and SHSP_SPLATRADIUS.

Here is the call graph for this function:

vu1512112::~vu1512112  )  [virtual]
 

Destructor.

Definition at line 78 of file SheetSplat.cpp.

References clearSheets().

Here is the call graph for this function:


Member Function Documentation

void vu1512112::clearSheets  )  [private]
 

frees memory of bins

Definition at line 454 of file SheetSplat.cpp.

References m_SliceDist, and m_Slices.

Referenced by initSheets(), sortByDistance(), and ~vu1512112().

void vu1512112::doRefresh  )  [inline]
 

recalculate image otherwise the existing framebuffer will be blitted to the screen

Definition at line 67 of file SheetSplat.h.

References m_Refresh.

Referenced by vuBCCSheetSplatter::OnButtonRender().

void vu1512112::drawSlice RGBABuffer sheet,
int  n
[private]
 

draws one slice to the back-buffer

Definition at line 611 of file SheetSplat.cpp.

References FrameBuffer< N >::addColourWithM1subM2(), byte, vuColour< S >::clampTo01(), dword, vuCamera::getHeight(), SplatSlicer::getSpla(), vuCamera::getWidth(), m_Shading, m_SliceDist, m_Slices, m_Splat, m_SplatPos, and RGBABuffer.

Referenced by drawSlices().

Here is the call graph for this function:

void vu1512112::drawSlices  )  [private]
 

Definition at line 319 of file SheetSplat.cpp.

References FrameBuffer< N >::blendUnder(), FrameBuffer< N >::clear(), drawSlice(), vuMutex::lock(), m_CurrentSheet, m_FBHeight, m_FBMutex, m_FBWidth, m_FrameBuffer, RGBABuffer, FrameBuffer< N >::setSize(), and vuMutex::unlock().

Referenced by render(), and run().

Here is the call graph for this function:

vuVector vu1512112::getCenter  )  [inline]
 

Definition at line 58 of file SheetSplat.h.

Referenced by vuBCCSheetSplatter::glOnMouse(), and vuBCCSheetSplatter::glRender().

float vu1512112::getFootprintSize  )  const
 

Returns the size of the splatting footprint.

Definition at line 104 of file SheetSplat.cpp.

float vu1512112::getSliceWidth  )  const
 

Returns the width of a slice.

Definition at line 121 of file SheetSplat.cpp.

void vu1512112::initOpenGL void   ) 
 

Initializes open gl for rendering the volume data.

Definition at line 424 of file SheetSplat.cpp.

Referenced by vuBCCSheetSplatter::glInit().

void vu1512112::initSheets float  dist0,
float  ddist
[private]
 

allocates setup number of sheets without memory for entries

Definition at line 428 of file SheetSplat.cpp.

References clearSheets(), dword, m_SliceDist, and m_Slices.

Referenced by sortByDistance().

Here is the call graph for this function:

vu1512112 & vu1512112::operator= const vu1512112 rhs  ) 
 

Assignment operator which does a deep copy.

Definition at line 91 of file SheetSplat.cpp.

References vu1512::operator=().

Here is the call graph for this function:

void vu1512112::prepareSheets  )  [private]
 

allocates setup number of sheets without memory for entries

Definition at line 442 of file SheetSplat.cpp.

References dword, and m_Slices.

Referenced by sortByDistance().

void vu1512112::preprocess void   )  [private]
 

Preprocesses volume data for rendering once it's been read.

Definition at line 249 of file SheetSplat.cpp.

References dword, m_DataPrepared, m_Normals, and vuVector::makeUnit().

Referenced by read(), and readRaw().

Here is the call graph for this function:

bool vu1512112::read  )  [virtual]
 

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

Reimplemented from vu15121.

Definition at line 149 of file SheetSplat.cpp.

References vuCamera::getPosition(), vu1512::getVoxelPosition(), m_Center, m_Normals, m_Shading, m_SplatPos, preprocess(), vuVector::print(), vu15121::read(), vuCamera::setPosition(), and vuCamera::translateXYZ().

Referenced by vuBCCSheetSplatter::init().

Here is the call graph for this function:

bool vu1512112::readRaw void   )  [virtual]
 

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

Definition at line 194 of file SheetSplat.cpp.

References byte, dword, vuCamera::getPosition(), vu1512::getVoxelPosition(), m_Center, m_Normals, m_Shading, m_SplatPos, preprocess(), vuVector::print(), vuCamera::setPosition(), and vuCamera::translateXYZ().

Here is the call graph for this function:

void vu1512112::render  )  [virtual]
 

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

Implements vu1.

Definition at line 335 of file SheetSplat.cpp.

References SplatSlicer::buildSplat(), byte, FrameBuffer< N >::clear(), drawSlices(), fbtype, FrameBuffer< N >::getData(), vuCamera::getHeight(), vuCamera::getWidth(), GL_RGB, GL_UNPACK_ALIGNMENT, GL_UNSIGNED_BYTE, glDrawPixels(), glPixelStorei(), glRasterPos2f(), m_BGColour, m_CurrentSheet, m_Exclude, m_FBHeight, m_FrameBuffer, m_Refresh, m_Splat, m_SplatRadius, SHSP_SPLATSTDSCALE, sortByDistance(), and vuThread::startThread().

Referenced by vuBCCSheetSplatter::glRender().

Here is the call graph for this function:

void vu1512112::run int  whatsup,
void *  data
[private, virtual]
 

overrides a virtual from vuThread allowing distributed rendering

Implements vuThread.

Definition at line 310 of file SheetSplat.cpp.

References drawSlices().

Here is the call graph for this function:

void vu1512112::setBGColour float  r,
float  g,
float  b
 

Definition at line 302 of file SheetSplat.cpp.

References m_BGColour.

Referenced by vu1512112().

void vu1512112::setFootprintSize float  size  ) 
 

Sets the size of the splatting footprint.

Definition at line 113 of file SheetSplat.cpp.

References m_SliceWidth, m_SplatRadius, m_SpS_2, and size.

Referenced by vuBCCSheetSplatter::OnChangeSplatSize(), and vu1512112().

bool vu1512112::setImageSize int  width,
int  height
 

Definition at line 408 of file SheetSplat.cpp.

References FrameBuffer< N >::clear(), m_BGColour, m_FBHeight, m_FBWidth, m_FrameBuffer, vuCamera::setHeight(), FrameBuffer< N >::setSize(), and vuCamera::setWidth().

Referenced by vuBCCSheetSplatter::glResize(), and vu1512112().

Here is the call graph for this function:

void vu1512112::setSliceWidth const float  size  ) 
 

sets the width of a slice

Definition at line 128 of file SheetSplat.cpp.

References m_SliceWidth, m_SplatCrop, m_SplatRadius, m_SpS_2, and size.

Referenced by vuBCCSheetSplatter::OnChangeSliceWidth(), and vu1512112().

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

Sets the camera viewing position for the render method.

Implements vu1.

Definition at line 140 of file SheetSplat.cpp.

void vu1512112::showHistogram  )  [private]
 

Definition at line 176 of file SheetSplat.cpp.

References byte, and dword.

void vu1512112::sortByDistance  )  [private]
 

sort voxels by distance uses the eye position of the camera, dimensions of the dataset, thickness of the slices and radius of splatting kernel to determine maximal number of slices

Definition at line 466 of file SheetSplat.cpp.

References clearSheets(), vuVector::dot, dword, vuVector::getData(), vuCamera::getPosition(), vu1512::getVoxelPosition(), initSheets(), m_Exclude, m_LightDiffuse, m_LightDir, m_LightShininess, m_Normals, m_NSlices, m_Shading, m_Slices, m_SliceWidth, m_SplatPos, m_SplatRadius, m_SpS_2, vuVector::makeUnit(), pow(), and prepareSheets().

Referenced by render().

Here is the call graph for this function:


Member Data Documentation

float vu1512112::m_BGColour[4] [private]
 

background colour

Definition at line 119 of file SheetSplat.h.

Referenced by render(), setBGColour(), and setImageSize().

vuVector vu1512112::m_Center [private]
 

Definition at line 118 of file SheetSplat.h.

Referenced by read(), and readRaw().

int vu1512112::m_CurrentSheet [private]
 

Definition at line 127 of file SheetSplat.h.

Referenced by drawSlices(), and render().

bool vu1512112::m_DataPrepared [private]
 

Definition at line 130 of file SheetSplat.h.

Referenced by preprocess(), and vu1512112().

bool vu1512112::m_Exclude[256] [private]
 

exclude intensities from rendering

Definition at line 108 of file SheetSplat.h.

Referenced by render(), and sortByDistance().

int vu1512112::m_FBHeight [private]
 

Definition at line 115 of file SheetSplat.h.

Referenced by drawSlices(), render(), and setImageSize().

vuMutex vu1512112::m_FBMutex [private]
 

Definition at line 128 of file SheetSplat.h.

Referenced by drawSlices().

int vu1512112::m_FBWidth [private]
 

Definition at line 115 of file SheetSplat.h.

Referenced by drawSlices(), and setImageSize().

RGBABuffer vu1512112::m_FrameBuffer [private]
 

Definition at line 116 of file SheetSplat.h.

Referenced by drawSlices(), render(), and setImageSize().

float vu1512112::m_LightAmbient [private]
 

weight for ambient

Definition at line 123 of file SheetSplat.h.

Referenced by vu1512112().

float vu1512112::m_LightDiffuse [private]
 

weight for diffuse relection

Definition at line 122 of file SheetSplat.h.

Referenced by sortByDistance(), and vu1512112().

vuVector vu1512112::m_LightDir [private]
 

direction for parallel light

Definition at line 125 of file SheetSplat.h.

Referenced by sortByDistance(), and vu1512112().

unsigned int vu1512112::m_LightShininess [private]
 

exponent for shininess

Definition at line 124 of file SheetSplat.h.

Referenced by sortByDistance(), and vu1512112().

vuColourRGBa vu1512112::m_LightSpecular [private]
 

specular colour with alpha weight

Definition at line 121 of file SheetSplat.h.

Referenced by vu1512112().

vuVector* vu1512112::m_Normals [private]
 

stores three normal components per voxel

Definition at line 110 of file SheetSplat.h.

Referenced by preprocess(), read(), readRaw(), sortByDistance(), and vu1512112().

int vu1512112::m_NSlices [private]
 

number of slices

Definition at line 104 of file SheetSplat.h.

Referenced by sortByDistance().

bool vu1512112::m_Refresh [private]
 

calculate new image

Definition at line 131 of file SheetSplat.h.

Referenced by doRefresh(), and render().

float* vu1512112::m_Shading [private]
 

stores two shading coefficients per voxel first is diffuse l*n, second is specular (r*v)^shin

Definition at line 113 of file SheetSplat.h.

Referenced by drawSlice(), read(), readRaw(), sortByDistance(), and vu1512112().

RGBABuffer vu1512112::m_SheetBuffer [private]
 

Definition at line 117 of file SheetSplat.h.

float* vu1512112::m_SliceDist [private]
 

distance of each single slice

Definition at line 106 of file SheetSplat.h.

Referenced by clearSheets(), drawSlice(), initSheets(), and vu1512112().

dword** vu1512112::m_Slices [private]
 

index bucket for each slice ([0] is N of elements)

Definition at line 105 of file SheetSplat.h.

Referenced by clearSheets(), drawSlice(), initSheets(), prepareSheets(), sortByDistance(), and vu1512112().

float vu1512112::m_SliceWidth [private]
 

width of a slice

Definition at line 101 of file SheetSplat.h.

Referenced by setFootprintSize(), setSliceWidth(), and sortByDistance().

SplatSlicer vu1512112::m_Splat [private]
 

Definition at line 114 of file SheetSplat.h.

Referenced by drawSlice(), and render().

float vu1512112::m_SplatCrop [private]
 

depth tolerance below which splat in slice is ignored

Definition at line 103 of file SheetSplat.h.

Referenced by setSliceWidth().

float* vu1512112::m_SplatPos [private]
 

projected coordinates with distance in 3rd component

Definition at line 107 of file SheetSplat.h.

Referenced by drawSlice(), read(), readRaw(), sortByDistance(), and vu1512112().

float vu1512112::m_SplatRadius [private]
 

size of a splat

Definition at line 100 of file SheetSplat.h.

Referenced by render(), setFootprintSize(), setSliceWidth(), and sortByDistance().

dword vu1512112::m_SpS_2 [private]
 

((slices per splat) / 2)_

Definition at line 102 of file SheetSplat.h.

Referenced by setFootprintSize(), setSliceWidth(), and sortByDistance().


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