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

vu1112113 Class Reference

This class performs raycasting using a spectral colour model. More...

#include <Raycast.h>

Inheritance diagram for vu1112113:

Inheritance graph
[legend]
Collaboration diagram for vu1112113:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 vu1112113 ()
 Default constructor creating an empty instance.
 vu1112113 (const vu1112113 &inst)
 Copy constructor which does a deep copy.
virtual ~vu1112113 ()
 Destructor.
vu1112113operator= (const vu1112113 &rhs)
 Assignment operator which does a deep copy.
void setViewVectors (const vuVector &pos, const vuVector &vrp, const vuVector &up)
 Sets the camera viewing position for the render method.
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.
void setImageSize (dword sx, dword sy)
 set size of the canvas to render to
void getImageSize (dword &sx, dword &sy)
 set size of the canvas to render to
void doRefresh ()
 tell that the data should be rerendered on next glRender
vuVector getCenter () const
 returns the center of the dataset
void doPreviewDraw (bool predraw=true)
 The parameter enables/disables drawing during calculation of new image.
void setSamplingDistance (float smpdist)
 Toogles the sampling distance.
void doSpecular (bool dospec)
 perform specular shading
void setTFuncMethod (int which)
 sets a method for evaluating the transfer function 0 - evaluate integer density per sample 1 - evaluate preintegrated tfunc per segment (front and back density) 2 - like '1' but integral is weighted with alpha function
vuImagegetImage ()
void displayFromImage ()

Private Member Functions

void run (int whatsup, void *data)
 Overrides virtual vuThread::run().
void shootRays (int xofs=0, int xinc=1, int yofs=0, int yinc=1)
 Renders the scene by casting the rays from the camera.
void preprocess (void)
 Preprocesses volume data for rendering once it's been read.
vuColourRGBa Cast (vuSampleRay &Vray)
 Cast a ray through the scene used by render().

Private Attributes

vuTFPreintegrated m_TFuncPI
 preintegrated transfer function
vuVector center
 center to rotate about
DatGrid m_Grid
 array for storing information for each point
vuImage m_Image
 image (just an RGB byte framebuffer)
vuVector lightdir
 direction of light vector
float brightness
 scalar to toogle brightness of light source
float diffuse
 weight for diffuse gradient shading
vuColourRGBa m_Specular
 specular colour
vuColourRGBa m_Background
 background colour
bool pp_gradients
 gradients already preprocessed?
bool m_PreDraw
 draw while calculating new image
float m_SamplingDistance
 the distance used for sampling
vuMutex m_Mutex [2]
bool m_DoSpecular
 flag for performing specular shading
int m_TFuncMethod
 modified by setTFuncMethod()

Friends

class DatGrid
class DatPnt

Detailed Description

This class performs raycasting using a spectral colour model.

This allows modelling special physical properties of light like spectral absorption and metamerism. long name: vuVolumeRegularUnimodal3d1B1ValRaycast

Author:
Steven Bergner

Definition at line 33 of file Raycast.h.


Constructor & Destructor Documentation

vu1112113::vu1112113  ) 
 

Default constructor creating an empty instance.

Definition at line 25 of file Raycast.cpp.

References brightness, diffuse, m_DoSpecular, m_PreDraw, m_SamplingDistance, vuCamera::setHeight(), and vuCamera::setWidth().

Here is the call graph for this function:

vu1112113::vu1112113 const vu1112113 inst  ) 
 

Copy constructor which does a deep copy.

Definition at line 41 of file Raycast.cpp.

References lightdir.

vu1112113::~vu1112113  )  [virtual]
 

Destructor.

Definition at line 50 of file Raycast.cpp.


Member Function Documentation

vuColourRGBa vu1112113::Cast vuSampleRay Vray  )  [private]
 

Cast a ray through the scene used by render().

Definition at line 291 of file Raycast.cpp.

References ns_vu1112113::vuSampleRay::advanceRay(), ns_vu1112113::vuSampleRay::attachToGrid(), ns_vu1112113::DatPnt::data, vuVector::dot, vuColour< S >::getAlpha(), ns_vu1112113::vuSampleRay::getSamplePoint(), ns_vu1112113::DatPnt::illum, vuTFPreintegrated::integrate(), ns_vu1112113::DatPnt::len, lightdir, m_Background, vuRay::m_Direction, m_DoSpecular, m_Grid, m_SamplingDistance, m_Specular, m_TFuncMethod, m_TFuncPI, ns_vu1112113::DatPnt::normalVec(), pow(), ns_vu1112113::vuSampleRay::SamplingDistance(), and vuColour< S >::setAlpha().

Referenced by shootRays().

Here is the call graph for this function:

void vu1112113::displayFromImage  ) 
 

Definition at line 386 of file Raycast.cpp.

References vuImage::blit(), vuImage::get_extents(), and m_Image.

Referenced by vuRaycast::onRender().

Here is the call graph for this function:

void vu1112113::doPreviewDraw bool  predraw = true  )  [inline]
 

The parameter enables/disables drawing during calculation of new image.

Definition at line 74 of file Raycast.h.

References m_PreDraw.

Referenced by vuRaycast::init(), and Scanner::Scanner().

void vu1112113::doRefresh  ) 
 

tell that the data should be rerendered on next glRender

default behaviour is to just blit the intermediate framebuffer

Definition at line 365 of file Raycast.cpp.

Referenced by Scanner::_renderView(), vuRaycast::DrawAgain(), and vuRaycast::OnButtonRender().

void vu1112113::doSpecular bool  dospec  )  [inline]
 

perform specular shading

Definition at line 78 of file Raycast.h.

References m_DoSpecular.

Referenced by Scanner::Scanner().

vuVector vu1112113::getCenter  )  const [virtual]
 

returns the center of the dataset

Reimplemented from vu1112.

Definition at line 370 of file Raycast.cpp.

Referenced by Scanner::_renderView().

vuImage * vu1112113::getImage  ) 
 

Definition at line 380 of file Raycast.cpp.

Referenced by Scanner::_renderView(), and vuRaycast::getCurrentImage().

void vu1112113::getImageSize dword sx,
dword sy
 

set size of the canvas to render to

Definition at line 85 of file Raycast.cpp.

References vuCamera::getHeight(), and vuCamera::getWidth().

Here is the call graph for this function:

void vu1112113::initOpenGL void   ) 
 

Initializes open gl for rendering the volume data.

Definition at line 117 of file Raycast.cpp.

References GL_LIGHTING, and glDisable().

Referenced by vuRaycast::glInit(), and Scanner::Scanner().

Here is the call graph for this function:

vu1112113 & vu1112113::operator= const vu1112113 rhs  ) 
 

Assignment operator which does a deep copy.

Definition at line 62 of file Raycast.cpp.

References vu1112::operator=().

Here is the call graph for this function:

void vu1112113::preprocess void   )  [private]
 

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

Definition at line 189 of file Raycast.cpp.

References ns_vu1112113::DatGrid::calculate_gradients(), m_Grid, pp_gradients, and ns_vu1112113::DatGrid::shade().

Referenced by read(), and readRaw().

Here is the call graph for this function:

bool vu1112113::read  )  [virtual]
 

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

Reimplemented from vu11121.

Definition at line 126 of file Raycast.cpp.

References center, ns_vu1112113::DatGrid::copy_vol(), vuCamera::init(), m_Grid, pp_gradients, preprocess(), vu11121::read(), vuCamera::setPosition(), and vuCamera::translateXYZ().

Referenced by vuRaycast::init(), and Scanner::Scanner().

Here is the call graph for this function:

bool vu1112113::readRaw void   )  [virtual]
 

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

Definition at line 147 of file Raycast.cpp.

References byte, center, ns_vu1112113::DatGrid::copy_vol(), dword, vuCamera::init(), m_Grid, pp_gradients, preprocess(), vuCamera::setPosition(), and vuCamera::translateXYZ().

Here is the call graph for this function:

void vu1112113::render  )  [virtual]
 

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

Reimplemented from vu11121.

Definition at line 222 of file Raycast.cpp.

References vuCamera::getLookAtVector(), vuCamera::getPosition(), vuMutex::lock(), m_Mutex, m_TFuncPI, shootRays(), vuThread::startThread(), and vuMutex::unlock().

Referenced by Scanner::_renderView(), and vuRaycast::onRender().

Here is the call graph for this function:

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

Overrides virtual vuThread::run().

Calls shootRays to distribute rendering to two different threads.

Implements vuThread.

Definition at line 202 of file Raycast.cpp.

References dword, vuCamera::getHeight(), m_Mutex, shootRays(), and vuMutex::unlock().

Here is the call graph for this function:

void vu1112113::setImageSize dword  sx,
dword  sy
 

set size of the canvas to render to

Definition at line 73 of file Raycast.cpp.

References vuCamera::getHeight(), vuCamera::getType(), vuCamera::getWidth(), vuImage::init(), vuCamera::init(), m_Image, vuPerspectiveCamera::setAspect(), vuCamera::setHeight(), and vuCamera::setWidth().

Referenced by vuRaycast::glResize(), and Scanner::Scanner().

Here is the call graph for this function:

void vu1112113::setSamplingDistance float  smpdist  )  [inline]
 

Toogles the sampling distance.

Definition at line 76 of file Raycast.h.

References m_SamplingDistance.

Referenced by Scanner::Scanner().

void vu1112113::setTFuncMethod int  which  )  [inline]
 

sets a method for evaluating the transfer function 0 - evaluate integer density per sample 1 - evaluate preintegrated tfunc per segment (front and back density) 2 - like '1' but integral is weighted with alpha function

Definition at line 83 of file Raycast.h.

References m_TFuncMethod, m_TFuncPI, vuTFPreintegrated::preintegrate(), TFUNC_PIAW, and vuTFPreintegrated::useAlphaWeighting().

Referenced by Scanner::Scanner().

Here is the call graph for this function:

void vu1112113::setViewVectors const vuVector pos,
const vuVector vrp,
const vuVector up
[virtual]
 

Sets the camera viewing position for the render method.

Reimplemented from vu11121.

Definition at line 95 of file Raycast.cpp.

References vuCamera::init(), vuCamera::setLookAtVector(), and vuCamera::setUpVector().

Here is the call graph for this function:

void vu1112113::shootRays int  xofs = 0,
int  xinc = 1,
int  yofs = 0,
int  yinc = 1
[private]
 

Renders the scene by casting the rays from the camera.

The parameters can be used to render only specific pixels. That can be used for progressive rendering or rendering distributed to different processes. The default values setup for full rendering.

Parameters:
xofs pixel offset in each line
xinc increment determining the space between two pixels on one line
yofs line to start with
yinc step size to next line

Definition at line 262 of file Raycast.cpp.

References Cast(), vuColour< S >::clampTo01(), vuCamera::getHeight(), vuCamera::getRay(), vuCamera::getWidth(), GL_POINTS, glBegin(), vuColourRGBa::glColor(), glEnd(), glVertex2i(), vuImage::init(), m_Image, and vuImage::set_xy().

Referenced by render(), and run().

Here is the call graph for this function:


Friends And Related Function Documentation

friend class DatGrid [friend]
 

Definition at line 35 of file Raycast.h.

friend class DatPnt [friend]
 

Definition at line 36 of file Raycast.h.


Member Data Documentation

float vu1112113::brightness [private]
 

scalar to toogle brightness of light source

Definition at line 119 of file Raycast.h.

Referenced by ns_vu1112113::DatPnt::shade(), and vu1112113().

vuVector vu1112113::center [private]
 

center to rotate about

Definition at line 114 of file Raycast.h.

Referenced by read(), and readRaw().

float vu1112113::diffuse [private]
 

weight for diffuse gradient shading

Definition at line 120 of file Raycast.h.

Referenced by ns_vu1112113::DatPnt::shade(), and vu1112113().

vuVector vu1112113::lightdir [private]
 

direction of light vector

Definition at line 118 of file Raycast.h.

Referenced by Cast(), ns_vu1112113::DatPnt::shade(), and vu1112113().

vuColourRGBa vu1112113::m_Background [private]
 

background colour

Definition at line 122 of file Raycast.h.

Referenced by Cast().

bool vu1112113::m_DoSpecular [private]
 

flag for performing specular shading

Definition at line 127 of file Raycast.h.

Referenced by Cast(), doSpecular(), and vu1112113().

DatGrid vu1112113::m_Grid [private]
 

array for storing information for each point

Definition at line 115 of file Raycast.h.

Referenced by Cast(), preprocess(), read(), and readRaw().

vuImage vu1112113::m_Image [private]
 

image (just an RGB byte framebuffer)

Definition at line 117 of file Raycast.h.

Referenced by displayFromImage(), setImageSize(), and shootRays().

vuMutex vu1112113::m_Mutex[2] [private]
 

Definition at line 126 of file Raycast.h.

Referenced by render(), and run().

bool vu1112113::m_PreDraw [private]
 

draw while calculating new image

Definition at line 124 of file Raycast.h.

Referenced by doPreviewDraw(), and vu1112113().

float vu1112113::m_SamplingDistance [private]
 

the distance used for sampling

Definition at line 125 of file Raycast.h.

Referenced by Cast(), setSamplingDistance(), and vu1112113().

vuColourRGBa vu1112113::m_Specular [private]
 

specular colour

Definition at line 121 of file Raycast.h.

Referenced by Cast().

int vu1112113::m_TFuncMethod [private]
 

modified by setTFuncMethod()

Definition at line 128 of file Raycast.h.

Referenced by Cast(), and setTFuncMethod().

vuTFPreintegrated vu1112113::m_TFuncPI [private]
 

preintegrated transfer function

Definition at line 113 of file Raycast.h.

Referenced by Cast(), render(), and setTFuncMethod().

bool vu1112113::pp_gradients [private]
 

gradients already preprocessed?

Definition at line 123 of file Raycast.h.

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


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