Public Types | Public Member Functions | Protected Attributes

OpenTissue::geometry::Ellipsoid< math_types_ > Class Template Reference

#include <geometry_ellipsoid.h>

Inheritance diagram for OpenTissue::geometry::Ellipsoid< math_types_ >:
OpenTissue::geometry::VolumeShape< math_types_ > OpenTissue::utility::ClassID< Ellipsoid< math_types_ > > OpenTissue::geometry::BaseShape< math_types_ > OpenTissue::utility::ClassIDInterface OpenTissue::collision::GeometryInterface< math_types_ > OpenTissue::utility::ClassIDInterface

List of all members.

Public Types

typedef math_types_ math_types
typedef math_types::index_type index_type
typedef math_types::value_traits value_traits
typedef math_types::real_type real_type
typedef math_types::vector3_type vector3_type
typedef math_types::matrix3x3_type matrix3x3_type
typedef math_types::quaternion_type quaternion_type
typedef Ellipsoid< math_types_ > ellipsoid_type

Public Member Functions

size_t const class_id () const
 Ellipsoid ()
virtual ~Ellipsoid ()
Ellipsoidoperator= (ellipsoid_type const &ellipsoid)
real_typeradius0 ()
real_typeradius1 ()
real_typeradius2 ()
real_type const & radius0 () const
real_type const & radius1 () const
real_type const & radius2 () const
vector3_typecenter ()
vector3_type center () const
vector3_typeaxis0 ()
vector3_typeaxis1 ()
vector3_typeaxis2 ()
vector3_type const & axis0 () const
vector3_type const & axis1 () const
vector3_type const & axis2 () const
real_typeradius (index_type idx)
real_type const & radius (index_type idx) const
vector3_type const & axis (index_type idx) const
vector3_typeaxis (index_type idx)
void orientation (matrix3x3_type const &R)
matrix3x3_type orientation () const
real_type volume () const
void get_equation (matrix3x3_type &A, vector3_type &B, real_type &C) const
void set_equation (matrix3x3_type const &A, vector3_type const &B, real_type const &C)
void get_covariance (vector3_type &mean, matrix3x3_type &C)
void set_covariance (vector3_type const &mean, matrix3x3_type const &C)
void set_sphere (real_type const &radius, vector3_type const &center)
template<typename point_container >
void random_points (point_container &P)
void translate (vector3_type const &T)
void rotate (matrix3x3_type const &R)
void scale (real_type const &s)
vector3_type get_support_point (vector3_type const &) const
real_type area () const
real_type diameter () const
void compute_surface_points (std::vector< vector3_type > &) const
void compute_collision_aabb (vector3_type const &r, matrix3x3_type const &R, vector3_type &min_coord, vector3_type &max_coord) const

Protected Attributes

vector3_type m_center
 The center of the ellipsoid.
vector3_type m_axis0
 First axis.
vector3_type m_axis1
 Second axis.
vector3_type m_axis2
 Third axis.
real_type m_radius0
 Radius of first axis.
real_type m_radius1
 Radius of first axis.
real_type m_radius2
 Radius of first axis.

Detailed Description

template<typename math_types_>
class OpenTissue::geometry::Ellipsoid< math_types_ >

Ellipsoid.


Member Typedef Documentation

template<typename math_types_ >
typedef Ellipsoid<math_types_> OpenTissue::geometry::Ellipsoid< math_types_ >::ellipsoid_type
template<typename math_types_ >
typedef math_types::index_type OpenTissue::geometry::Ellipsoid< math_types_ >::index_type
template<typename math_types_ >
typedef math_types_ OpenTissue::geometry::Ellipsoid< math_types_ >::math_types
template<typename math_types_ >
typedef math_types::matrix3x3_type OpenTissue::geometry::Ellipsoid< math_types_ >::matrix3x3_type
template<typename math_types_ >
typedef math_types::quaternion_type OpenTissue::geometry::Ellipsoid< math_types_ >::quaternion_type
template<typename math_types_ >
typedef math_types::real_type OpenTissue::geometry::Ellipsoid< math_types_ >::real_type
template<typename math_types_ >
typedef math_types::value_traits OpenTissue::geometry::Ellipsoid< math_types_ >::value_traits
template<typename math_types_ >
typedef math_types::vector3_type OpenTissue::geometry::Ellipsoid< math_types_ >::vector3_type

Constructor & Destructor Documentation

template<typename math_types_ >
OpenTissue::geometry::Ellipsoid< math_types_ >::Ellipsoid (  )  [inline]
template<typename math_types_ >
virtual OpenTissue::geometry::Ellipsoid< math_types_ >::~Ellipsoid (  )  [inline, virtual]

Member Function Documentation

template<typename math_types_ >
real_type OpenTissue::geometry::Ellipsoid< math_types_ >::area (  )  const [inline]
template<typename math_types_ >
vector3_type const& OpenTissue::geometry::Ellipsoid< math_types_ >::axis ( index_type  idx  )  const [inline]

Get Axis.

Parameters:
idx Index of the axis.
Returns:
The specified axis.
template<typename math_types_ >
vector3_type& OpenTissue::geometry::Ellipsoid< math_types_ >::axis ( index_type  idx  )  [inline]

Get Axis.

Parameters:
idx Index of the axis.
Returns:
The specified axis.
template<typename math_types_ >
vector3_type& OpenTissue::geometry::Ellipsoid< math_types_ >::axis0 (  )  [inline]
template<typename math_types_ >
vector3_type const& OpenTissue::geometry::Ellipsoid< math_types_ >::axis0 (  )  const [inline]
template<typename math_types_ >
vector3_type& OpenTissue::geometry::Ellipsoid< math_types_ >::axis1 (  )  [inline]
template<typename math_types_ >
vector3_type const& OpenTissue::geometry::Ellipsoid< math_types_ >::axis1 (  )  const [inline]
template<typename math_types_ >
vector3_type const& OpenTissue::geometry::Ellipsoid< math_types_ >::axis2 (  )  const [inline]
template<typename math_types_ >
vector3_type& OpenTissue::geometry::Ellipsoid< math_types_ >::axis2 (  )  [inline]
template<typename math_types_ >
vector3_type& OpenTissue::geometry::Ellipsoid< math_types_ >::center (  )  [inline]
template<typename math_types_ >
vector3_type OpenTissue::geometry::Ellipsoid< math_types_ >::center (  )  const [inline]
template<typename math_types_ >
size_t const OpenTissue::geometry::Ellipsoid< math_types_ >::class_id (  )  const [inline, virtual]

Query the class ID.

Returns:
The object's class ID

Reimplemented from OpenTissue::utility::ClassID< Ellipsoid< math_types_ > >.

template<typename math_types_ >
void OpenTissue::geometry::Ellipsoid< math_types_ >::compute_collision_aabb ( vector3_type const &  r,
matrix3x3_type const &  R,
vector3_type min_coord,
vector3_type max_coord 
) const [inline]

Compute Bounding Box. This method computes an axis aligned bounding box (AABB) that encloses the geometry.

Parameters:
r The position of the model frame (i.e the coordinate frame the geometry lives in).
R The orientation of the model frame (i.e the coordinate frame the geometry lives in).
min_coord Upon return holds the minimum corner of the box.
max_coord Upon return holds the maximum corner of the box.
template<typename math_types_ >
void OpenTissue::geometry::Ellipsoid< math_types_ >::compute_surface_points ( std::vector< vector3_type > &   )  const [inline]
template<typename math_types_ >
real_type OpenTissue::geometry::Ellipsoid< math_types_ >::diameter (  )  const [inline]
template<typename math_types_ >
void OpenTissue::geometry::Ellipsoid< math_types_ >::get_covariance ( vector3_type mean,
matrix3x3_type C 
) [inline]

Retrive Covariance Information about Ellipsoid.

Parameters:
C Covariance matrix.
mean Mean point.
template<typename math_types_ >
void OpenTissue::geometry::Ellipsoid< math_types_ >::get_equation ( matrix3x3_type A,
vector3_type B,
real_type C 
) const [inline]

Ellipsoid (Implicit) Equation.

let p = [x y z]^T, then an ellipsoid can be written as (in homegenious coordinates)

| A B | | p | |p^T 1 | | B^T C | | 1 | = p^T A p + 2 B^T p + C = 0

Which should be equivalent to the classical ellipoid equation

(R^T (p - center) )_x^2 / r_0^2 + ...+ (R^T (p - center) )_z^2 / r_2^2 = 1

With some mathemagical handy-work is can be shown that

D = diag( 1/r0^2, 1/r1^2, 1/r2^2) R = (axis0, axis1, axis2) A = R D R^T // Note this is a symmetric matrix B = - A center C = center^T A center - 1 = - center^T B - 1

template<typename math_types_ >
vector3_type OpenTissue::geometry::Ellipsoid< math_types_ >::get_support_point ( vector3_type const &   )  const [inline]
template<typename math_types_ >
Ellipsoid& OpenTissue::geometry::Ellipsoid< math_types_ >::operator= ( ellipsoid_type const &  ellipsoid  )  [inline]
template<typename math_types_ >
void OpenTissue::geometry::Ellipsoid< math_types_ >::orientation ( matrix3x3_type const &  R  )  [inline]
template<typename math_types_ >
matrix3x3_type OpenTissue::geometry::Ellipsoid< math_types_ >::orientation (  )  const [inline]
template<typename math_types_ >
real_type const& OpenTissue::geometry::Ellipsoid< math_types_ >::radius ( index_type  idx  )  const [inline]

Get Radius.

Parameters:
idx Index of the axis along which the radius is wanted.
Returns:
The radius of the specified axis.
template<typename math_types_ >
real_type& OpenTissue::geometry::Ellipsoid< math_types_ >::radius ( index_type  idx  )  [inline]

Get Radius.

Parameters:
idx Index of the axis along which the radius is wanted.
Returns:
The radius of the specified axis.
template<typename math_types_ >
real_type const& OpenTissue::geometry::Ellipsoid< math_types_ >::radius0 (  )  const [inline]
template<typename math_types_ >
real_type& OpenTissue::geometry::Ellipsoid< math_types_ >::radius0 (  )  [inline]
template<typename math_types_ >
real_type& OpenTissue::geometry::Ellipsoid< math_types_ >::radius1 (  )  [inline]
template<typename math_types_ >
real_type const& OpenTissue::geometry::Ellipsoid< math_types_ >::radius1 (  )  const [inline]
template<typename math_types_ >
real_type& OpenTissue::geometry::Ellipsoid< math_types_ >::radius2 (  )  [inline]
template<typename math_types_ >
real_type const& OpenTissue::geometry::Ellipsoid< math_types_ >::radius2 (  )  const [inline]
template<typename math_types_ >
template<typename point_container >
void OpenTissue::geometry::Ellipsoid< math_types_ >::random_points ( point_container P  )  [inline]

Generate Random Surface Points on Ellipsoid.

Parameters:
P Upon return this container will hold the generated points.
template<typename math_types_ >
void OpenTissue::geometry::Ellipsoid< math_types_ >::rotate ( matrix3x3_type const &  R  )  [inline]
template<typename math_types_ >
void OpenTissue::geometry::Ellipsoid< math_types_ >::scale ( real_type const &  s  )  [inline]
template<typename math_types_ >
void OpenTissue::geometry::Ellipsoid< math_types_ >::set_covariance ( vector3_type const &  mean,
matrix3x3_type const &  C 
) [inline]

Set Ellipsoid to match Covariance Matrix.

Parameters:
C Covariance matrix.
mean Mean point.
template<typename math_types_ >
void OpenTissue::geometry::Ellipsoid< math_types_ >::set_equation ( matrix3x3_type const &  A,
vector3_type const &  B,
real_type const &  C 
) [inline]

Set Ellipsoid

Let ellipsoid equation be given as

p^T A p + 2 B^T p + C = 0

This method extracts, ellipsoid axes and center from this implicit equation.

template<typename math_types_ >
void OpenTissue::geometry::Ellipsoid< math_types_ >::set_sphere ( real_type const &  radius,
vector3_type const &  center 
) [inline]

Set Ellipsoid to be Spherical.

Parameters:
radius The radius of the sphere.
center The cetner of the sphere.
template<typename math_types_ >
void OpenTissue::geometry::Ellipsoid< math_types_ >::translate ( vector3_type const &  T  )  [inline]
template<typename math_types_ >
real_type OpenTissue::geometry::Ellipsoid< math_types_ >::volume (  )  const [inline]

Member Data Documentation

template<typename math_types_ >
vector3_type OpenTissue::geometry::Ellipsoid< math_types_ >::m_axis0 [protected]

First axis.

template<typename math_types_ >
vector3_type OpenTissue::geometry::Ellipsoid< math_types_ >::m_axis1 [protected]

Second axis.

template<typename math_types_ >
vector3_type OpenTissue::geometry::Ellipsoid< math_types_ >::m_axis2 [protected]

Third axis.

template<typename math_types_ >
vector3_type OpenTissue::geometry::Ellipsoid< math_types_ >::m_center [protected]

The center of the ellipsoid.

template<typename math_types_ >
real_type OpenTissue::geometry::Ellipsoid< math_types_ >::m_radius0 [protected]

Radius of first axis.

template<typename math_types_ >
real_type OpenTissue::geometry::Ellipsoid< math_types_ >::m_radius1 [protected]

Radius of first axis.

template<typename math_types_ >
real_type OpenTissue::geometry::Ellipsoid< math_types_ >::m_radius2 [protected]

Radius of first axis.


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