LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::rayTraceObject< T > Class Template Reference

abstract class parent for all objects that can be ray-traced. More...

#include <ltiDraw3D.h>

Inheritance diagram for lti::rayTraceObject< T >:
Inheritance graph
[legend]
Collaboration diagram for lti::rayTraceObject< T >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 rayTraceObject (draw3D< T > &drawer)
virtual bool rayTrace (const int x, const int y, double &z2, T &val)=0
virtual bool render ()=0
virtual const char * getTypeName () const

Protected Member Functions

multiplyNormed (const T &a, const T &b) const
addSaturated (const T &a, const T &b) const
void p2Dto3D (const int &x, const int &y, dpoint3D &imgp, dpoint3D &ray) const
void buildInverseCamera ()

Protected Attributes

draw3D< T > & drawer
const draw3D< T >::parameters & param
draw3D< T >::hmatrix cam
draw3D< T >::hmatrix camInv
dpoint center

Detailed Description

template<class T>
class lti::rayTraceObject< T >

abstract class parent for all objects that can be ray-traced.

All objects derived from this class are used internally in lti::draw3D objects.


Constructor & Destructor Documentation

template<class T >
lti::rayTraceObject< T >::rayTraceObject ( draw3D< T > &  drawer  ) 

The constructor must receive the drawer object, where this object will be draw.


Member Function Documentation

template<class T >
T lti::rayTraceObject< T >::addSaturated ( const T &  a,
const T &  b 
) const [protected]

add with clipping

template<class T >
void lti::rayTraceObject< T >::buildInverseCamera (  )  [protected]

compute the inverse of the camera transformation matrix (only the rotation part is created.

The result is left in the attribute member camInv

template<class T >
virtual const char* lti::rayTraceObject< T >::getTypeName (  )  const [virtual]

return the name of the this object

Reimplemented from lti::object.

Reimplemented in lti::rayTraceEllipsoid< T >.

template<class T >
T lti::rayTraceObject< T >::multiplyNormed ( const T &  a,
const T &  b 
) const [protected]

multiply ((a/norm) * (b/norm))*norm

template<class T >
void lti::rayTraceObject< T >::p2Dto3D ( const int &  x,
const int &  y,
dpoint3D imgp,
dpoint3D ray 
) const [protected]

compute the vector in world coordinates parallel to the ray going through the focal point and the point (x,y) in the image plane.

Parameters:
x image coordinate x
y image coordinate y
imgp position of the image point (x,y) (on the image plane) in the world coordinate system
ray direction of the ray going through the point (x,y) and the focal point.
template<class T >
virtual bool lti::rayTraceObject< T >::rayTrace ( const int  x,
const int  y,
double &  z2,
T &  val 
) [pure virtual]

Compute the color value of the pixel at x,y.

Parameters:
x x coordinate in the image
y y coordinate in the image
z2 z coordinate of the surface point belonging to the given pixel (required for the z-buffering).
val computed color (or gray) value for the given (x,y) pixel
Returns:
true if the position corresponds to a pixel on the surface of the object.

Implemented in lti::rayTraceEllipsoid< T >.

template<class T >
virtual bool lti::rayTraceObject< T >::render (  )  [pure virtual]

render the whole object

Returns:
true if something was drawn, of false otherwise.

Implemented in lti::rayTraceEllipsoid< T >.


Member Data Documentation

template<class T >
draw3D<T>::hmatrix lti::rayTraceObject< T >::cam [protected]

camera homogene transformation matrix

template<class T >
draw3D<T>::hmatrix lti::rayTraceObject< T >::camInv [protected]

inverse camera rotation matrix of the drawer object

template<class T >
dpoint lti::rayTraceObject< T >::center [protected]

position of the projected origin of the world coordinates

template<class T >
draw3D<T>& lti::rayTraceObject< T >::drawer [protected]

Drawer object.

template<class T >
const draw3D<T>::parameters& lti::rayTraceObject< T >::param [protected]

parameters of the drawer


The documentation for this class was generated from the following file:

Generated on Sat Apr 10 15:27:14 2010 for LTI-Lib by Doxygen 1.6.1