#include <Raycast.h>
Inheritance diagram for vu1112113:
Public Member Functions | |
vu1112113 () | |
Default constructor creating an empty instance. | |
vu1112113 (const vu1112113 &inst) | |
Copy constructor which does a deep copy. | |
virtual | ~vu1112113 () |
Destructor. | |
vu1112113 & | operator= (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 | |
vuImage * | getImage () |
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 |
This allows modelling special physical properties of light like spectral absorption and metamerism. long name: vuVolumeRegularUnimodal3d1B1ValRaycast
Definition at line 33 of file Raycast.h.
|
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:
|
Copy constructor which does a deep copy.
Definition at line 41 of file Raycast.cpp. References lightdir. |
|
Destructor.
Definition at line 50 of file Raycast.cpp. |
|
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:
|
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:
|
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(). |
|
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(). |
|
perform specular shading
Definition at line 78 of file Raycast.h. References m_DoSpecular. Referenced by Scanner::Scanner(). |
|
returns the center of the dataset
Reimplemented from vu1112. Definition at line 370 of file Raycast.cpp. Referenced by Scanner::_renderView(). |
|
Definition at line 380 of file Raycast.cpp. Referenced by Scanner::_renderView(), and vuRaycast::getCurrentImage(). |
|
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:
|
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:
|
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:
|
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(). |
Here is the call graph for this function:
|
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:
|
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:
|
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:
|
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:
|
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:
|
Toogles the sampling distance.
Definition at line 76 of file Raycast.h. References m_SamplingDistance. Referenced by Scanner::Scanner(). |
|
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:
|
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:
|
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.
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(). |
Here is the call graph for this function:
|
|
|
|
|
scalar to toogle brightness of light source
Definition at line 119 of file Raycast.h. Referenced by ns_vu1112113::DatPnt::shade(), and vu1112113(). |
|
center to rotate about
|
|
weight for diffuse gradient shading
Definition at line 120 of file Raycast.h. Referenced by ns_vu1112113::DatPnt::shade(), and vu1112113(). |
|
direction of light vector
Definition at line 118 of file Raycast.h. Referenced by Cast(), ns_vu1112113::DatPnt::shade(), and vu1112113(). |
|
background colour
Definition at line 122 of file Raycast.h. Referenced by Cast(). |
|
flag for performing specular shading
Definition at line 127 of file Raycast.h. Referenced by Cast(), doSpecular(), and vu1112113(). |
|
array for storing information for each point
Definition at line 115 of file Raycast.h. Referenced by Cast(), preprocess(), read(), and readRaw(). |
|
image (just an RGB byte framebuffer)
Definition at line 117 of file Raycast.h. Referenced by displayFromImage(), setImageSize(), and shootRays(). |
|
|
|
draw while calculating new image
Definition at line 124 of file Raycast.h. Referenced by doPreviewDraw(), and vu1112113(). |
|
the distance used for sampling
Definition at line 125 of file Raycast.h. Referenced by Cast(), setSamplingDistance(), and vu1112113(). |
|
specular colour
Definition at line 121 of file Raycast.h. Referenced by Cast(). |
|
modified by setTFuncMethod()
Definition at line 128 of file Raycast.h. Referenced by Cast(), and setTFuncMethod(). |
|
preintegrated transfer function
Definition at line 113 of file Raycast.h. Referenced by Cast(), render(), and setTFuncMethod(). |
|
gradients already preprocessed?
Definition at line 123 of file Raycast.h. Referenced by preprocess(), read(), and readRaw(). |