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

lti::rayTraceEllipsoid< T > Class Template Reference

Ray tracing object for ellipsoids. More...

#include <ltiDraw3D.h>

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

List of all members.

Public Member Functions

 rayTraceEllipsoid (draw3D< T > &drawer)
 rayTraceEllipsoid (draw3D< T > &drawer, const dpoint3D &theMean, const dmatrix &covar, const double &theMahDist=1)
void setEllipsoid (const dpoint3D &theMean, const dmatrix &covar, const double &theMahDist=1)
virtual bool rayTrace (const int x, const int y, double &z2, T &val)
virtual bool render ()
virtual const char * getTypeName () const

Protected Member Functions

bool intersectRayEllipsoid (const dpoint3D &ip, const dpoint3D &ray, const dpoint3D &mu, const matrix< double > &sigma, const double &mah, double &lambda, dpoint3D &sp)
void calcNormal (const dpoint3D &intersectionPoint, const dpoint3D &mu, const matrix< double > &sigma, dpoint3D &normal) const

Protected Attributes

dpoint3D mean
dmatrix sigma
dmatrix invMat
double mahDist
storedColor

Detailed Description

template<class T>
class lti::rayTraceEllipsoid< T >

Ray tracing object for ellipsoids.


Constructor & Destructor Documentation

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

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

template<class T >
lti::rayTraceEllipsoid< T >::rayTraceEllipsoid ( draw3D< T > &  drawer,
const dpoint3D theMean,
const dmatrix covar,
const double &  theMahDist = 1 
)

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

Parameters:
drawer the drawer object where the ellipsoid will be drawn.
theMean mean point of the ellipsoid
covar covariance matrix used in the definition of the ellipsoid. This should be a 3x3 symmetric positive definite matrix.
theMahDist mahalanobis distance using the given covariance matrix between the mean point and the surface of the ellipsoid.

Member Function Documentation

template<class T >
void lti::rayTraceEllipsoid< T >::calcNormal ( const dpoint3D intersectionPoint,
const dpoint3D mu,
const matrix< double > &  sigma,
dpoint3D normal 
) const [protected]

compute the normal vector of an ellipsoid surface at a specific point

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

return the name of the this object

Reimplemented from lti::rayTraceObject< T >.

template<class T >
bool lti::rayTraceEllipsoid< T >::intersectRayEllipsoid ( const dpoint3D ip,
const dpoint3D ray,
const dpoint3D mu,
const matrix< double > &  sigma,
const double &  mah,
double &  lambda,
dpoint3D sp 
) [protected]

Given a point of the image plane in world coordinates and the direction of a ray passing through the focal point and the image point, compute the intersection of the ray and the ellipsoid formed using a constant mahalanobis distance from the mean value to the surface of the ellipsoid under consideration of the given covariance matrix.

Parameters:
ip point of the image plane in world coordinates (see p2Dto3D())
ray point describing the direction of a ray passing through the image point and the focal point
mu mean value of the ellipsoid
sigma covariance matrix
mah mahalanobis distance between the ellipsoid surface and the mean value mu
lambda imgPnt + lambda*ray is the point on the ellipsoid surface to be considered
sp point at the surface of the ellipsoid
Returns:
true if point was found, or false if the image point does not belong to the ellipsoid
template<class T >
virtual bool lti::rayTraceEllipsoid< T >::rayTrace ( const int  x,
const int  y,
double &  z2,
T &  val 
) [virtual]

Compute the 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.

Implements lti::rayTraceObject< T >.

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

render the whole object.

Returns:
true if something was drawn, of false otherwise

Implements lti::rayTraceObject< T >.

template<class T >
void lti::rayTraceEllipsoid< T >::setEllipsoid ( const dpoint3D theMean,
const dmatrix covar,
const double &  theMahDist = 1 
)

set the parameters of the ellipsoid.

Parameters:
theMean mean point of the ellipsoid
covar covariance matrix used in the definition of the ellipsoid. This should be a 3x3 symmetric positive definite matrix.
theMahDist mahalanobis distance using the given covariance matrix between the mean point and the surface of the ellipsoid.

Member Data Documentation

template<class T >
dmatrix lti::rayTraceEllipsoid< T >::invMat [protected]

inverse matrix of the covariance matrix

template<class T >
double lti::rayTraceEllipsoid< T >::mahDist [protected]

mahalanobis distance of the ellipsoid surface to the mean point using the given covariance matrix

template<class T >
dpoint3D lti::rayTraceEllipsoid< T >::mean [protected]

mean point of the ellipsoid

template<class T >
dmatrix lti::rayTraceEllipsoid< T >::sigma [protected]

covariance matrix of the ellipsoid

template<class T >
T lti::rayTraceEllipsoid< T >::storedColor [protected]

current color of the ellipsoid


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