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

vu1512113 Class Reference

#include <raycaster.h>

Inheritance diagram for vu1512113:

Inheritance graph
[legend]
Collaboration diagram for vu1512113:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 vu1512113 ()
 Default constructor creating an empty instance.
 vu1512113 (const vu1512113 &inst)
 Copy constructor which does a deep copy.
virtual ~vu1512113 ()
 Destructor.
vu1512113operator= (const vu1512113 &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 setImageSize (int sx, int sy)
 Sets the size of the rendering canvas.
vuImagegetImage ()
 Returns a pointer to the current image.
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 displayFromImage ()
 implementation of a virtual function
void setSamplingDistance (float sdist)
 sets sampling distance (default=1.0);
float getSamplingDistance () const
 returns sampling distance
void setLightDir (const vuVector ldir)
 change direction of the light (default is (1,0,0))
const vuVector getLightDir ()
 get direction of the light

Public Attributes

bool refresh

Private Member Functions

void preprocess (void)
 Preprocesses volume data for rendering once it's been read.
bool intersectRayWithBox (vuVector Ro, vuVector Rd, vuVector *f, vuVector *s, vuVector *llc, vuVector *urc)
void renderImage ()

Private Attributes

floatm_Normals
vuImage m_Image
 image (just an RGB byte framebuffer)
float m_SamplingDistance
 sampling distance (default=1.0)
vuVector m_LightDir
 direction of the light
vuColourRGBa m_Specular
 specular colour (set to white)

Detailed Description

unoptimized raycasting

Todo:
make images pretty

Definition at line 22 of file raycaster.h.


Constructor & Destructor Documentation

vu1512113::vu1512113  ) 
 

Default constructor creating an empty instance.

Definition at line 23 of file Volume/BCC/Unimodal/3d/1B/Intensity/Raycaster/raycaster.cpp.

References m_SamplingDistance, refresh, vuCamera::setHeight(), and vuCamera::setWidth().

Here is the call graph for this function:

vu1512113::vu1512113 const vu1512113 inst  ) 
 

Copy constructor which does a deep copy.

Definition at line 36 of file Volume/BCC/Unimodal/3d/1B/Intensity/Raycaster/raycaster.cpp.

vu1512113::~vu1512113  )  [virtual]
 

Destructor.

Definition at line 44 of file Volume/BCC/Unimodal/3d/1B/Intensity/Raycaster/raycaster.cpp.


Member Function Documentation

void vu1512113::displayFromImage  ) 
 

implementation of a virtual function

Definition at line 420 of file Volume/BCC/Unimodal/3d/1B/Intensity/Raycaster/raycaster.cpp.

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

Referenced by render().

Here is the call graph for this function:

vuImage* vu1512113::getImage  )  [inline]
 

Returns a pointer to the current image.

Warning: The image (an it's dimensions) may change in the next resize or render operation.

Definition at line 46 of file raycaster.h.

Referenced by vuBCCRaycaster::getCurrentImage().

const vuVector vu1512113::getLightDir  )  [inline]
 

get direction of the light

Definition at line 73 of file raycaster.h.

float vu1512113::getSamplingDistance  )  const [inline]
 

returns sampling distance

Definition at line 67 of file raycaster.h.

void vu1512113::initOpenGL void   ) 
 

Initializes open gl for rendering the volume data.

Definition at line 186 of file Volume/BCC/Unimodal/3d/1B/Intensity/Raycaster/raycaster.cpp.

Referenced by vuBCCRaycaster::glInit().

bool vu1512113::intersectRayWithBox vuVector  Ro,
vuVector  Rd,
vuVector f,
vuVector s,
vuVector llc,
vuVector urc
[private]
 

Definition at line 195 of file Volume/BCC/Unimodal/3d/1B/Intensity/Raycaster/raycaster.cpp.

References vuVector::makeUnit().

Referenced by renderImage().

Here is the call graph for this function:

vu1512113 & vu1512113::operator= const vu1512113 rhs  ) 
 

Assignment operator which does a deep copy.

Definition at line 52 of file Volume/BCC/Unimodal/3d/1B/Intensity/Raycaster/raycaster.cpp.

References vu1512::operator=().

Here is the call graph for this function:

void vu1512113::preprocess void   )  [private]
 

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

Definition at line 156 of file Volume/BCC/Unimodal/3d/1B/Intensity/Raycaster/raycaster.cpp.

Referenced by read(), and readRaw().

bool vu1512113::read  )  [virtual]
 

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

Reimplemented from vu15121.

Definition at line 100 of file Volume/BCC/Unimodal/3d/1B/Intensity/Raycaster/raycaster.cpp.

References vu1512::getCenter(), vuCamera::init(), preprocess(), vu15121::read(), vuCamera::setPosition(), and vuCamera::translateXYZ().

Referenced by vuBCCRaycaster::init().

Here is the call graph for this function:

bool vu1512113::readRaw void   )  [virtual]
 

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

Definition at line 118 of file Volume/BCC/Unimodal/3d/1B/Intensity/Raycaster/raycaster.cpp.

References byte, dword, and preprocess().

Here is the call graph for this function:

void vu1512113::render  )  [virtual]
 

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

Implements vu1.

Definition at line 166 of file Volume/BCC/Unimodal/3d/1B/Intensity/Raycaster/raycaster.cpp.

References displayFromImage(), GL_COLOR_BUFFER_BIT, glClear(), glClearColor(), glFlush(), refresh, and renderImage().

Referenced by vuBCCRaycaster::onRender().

Here is the call graph for this function:

void vu1512113::renderImage  )  [private]
 

Definition at line 314 of file Volume/BCC/Unimodal/3d/1B/Intensity/Raycaster/raycaster.cpp.

References vuVector::dot, vuColour< S >::getAlpha(), vu15121::getDataValue(), vu15121::getGradient(), vuCamera::getHeight(), vuCamera::getLookAtVector(), vuCamera::getRay(), vuCamera::getWidth(), GL_POINTS, glBegin(), glEnd(), vuImage::init(), intersectRayWithBox(), m_Image, m_LightDir, m_SamplingDistance, m_Specular, vuVector::makeUnit(), vuVector::norm2(), pow(), vuImage::set_xy(), and vuColour< S >::setAlpha().

Referenced by render().

Here is the call graph for this function:

void vu1512113::setImageSize int  sx,
int  sy
 

Sets the size of the rendering canvas.

Definition at line 62 of file Volume/BCC/Unimodal/3d/1B/Intensity/Raycaster/raycaster.cpp.

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

Referenced by vuBCCRaycaster::glResize().

Here is the call graph for this function:

void vu1512113::setLightDir const vuVector  ldir  )  [inline]
 

change direction of the light (default is (1,0,0))

Definition at line 69 of file raycaster.h.

References m_LightDir.

void vu1512113::setSamplingDistance float  sdist  )  [inline]
 

sets sampling distance (default=1.0);

Definition at line 63 of file raycaster.h.

References m_SamplingDistance.

void vu1512113::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 82 of file Volume/BCC/Unimodal/3d/1B/Intensity/Raycaster/raycaster.cpp.

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

Here is the call graph for this function:


Member Data Documentation

vuImage vu1512113::m_Image [private]
 

image (just an RGB byte framebuffer)

Definition at line 85 of file raycaster.h.

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

vuVector vu1512113::m_LightDir [private]
 

direction of the light

Definition at line 87 of file raycaster.h.

Referenced by renderImage(), and setLightDir().

float* vu1512113::m_Normals [private]
 

Definition at line 83 of file raycaster.h.

float vu1512113::m_SamplingDistance [private]
 

sampling distance (default=1.0)

Definition at line 86 of file raycaster.h.

Referenced by renderImage(), setSamplingDistance(), and vu1512113().

vuColourRGBa vu1512113::m_Specular [private]
 

specular colour (set to white)

Definition at line 88 of file raycaster.h.

Referenced by renderImage().

bool vu1512113::refresh
 

Definition at line 25 of file raycaster.h.

Referenced by vuBCCRaycaster::DrawAgain(), vuBCCRaycaster::OnButtonRender(), render(), and vu1512113().


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