Public Types | Public Member Functions | Public Attributes | Protected Types

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

#include <geometry_plane.h>

Inheritance diagram for OpenTissue::geometry::Plane< math_types_ >:
OpenTissue::geometry::BaseShape< math_types_ > OpenTissue::function::SignedDistanceFunction< math_types_ > OpenTissue::utility::ClassID< Plane< math_types_ > > OpenTissue::collision::GeometryInterface< math_types_ > OpenTissue::function::ImplicitFunction< math_types_ > OpenTissue::utility::ClassIDInterface OpenTissue::utility::ClassIDInterface

List of all members.

Public Types

typedef math_types_ math_types
typedef math_types::vector3_type vector3_type
typedef math_types::matrix3x3_type matrix3x3_type

Public Member Functions

vector3_type const & n () const
vector3_typen ()
real_type const & w () const
real_typew ()
size_t const class_id () const
 Plane ()
 Plane (vector3_type const &p1, vector3_type const &p2, vector3_type const &p3)
 Plane (Plane const &p)
 Plane (vector3_type const &n_val, real_type const &d_val)
 Plane (vector3_type const &ndir, vector3_type const &p)
bool is_equal (plane_type const &p) const
bool isNearlyEqual (plane_type const &p) const
void set (plane_type const &p)
void set (vector3_type const &n_val, real_type const &d_val)
void set (vector3_type const &ndir, vector3_type const &p)
void set (vector3_type const &p1, vector3_type const &p2, vector3_type const &p3)
void set (real_type *c1, real_type *c2, real_type *c3)
bool is_coplanar (plane_type const &p) const
void compute_plane_vectors (vector3_type &tx, vector3_type &ty) const
real_type get_distance (vector3_type const &p) const
real_type signed_distance (vector3_type const &p) const
void compute_surface_points (std::vector< vector3_type > &) const
vector3_type get_support_point (vector3_type const &) const
void scale (real_type const &)
void rotate (matrix3x3_type const &R)
void translate (vector3_type const &T)
void flip ()
vector3_type project (vector3_type const &point) const
real_type evaluate (vector3_type const &x) const
vector3_type gradient (vector3_type const &) const
vector3_type normal (vector3_type const &) const
void compute_collision_aabb (vector3_type const &, matrix3x3_type const &, vector3_type &min_coord, vector3_type &max_coord) const

Public Attributes

vector3_type m_n
 The Plane Normal.
real_type m_d

Protected Types

typedef math_types::value_traits value_traits
typedef math_types::real_type real_type
typedef Plane< math_typesplane_type

Detailed Description

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

A Plane. The Plane consist of all points x, where

n*x-d = 0


Member Typedef Documentation

template<typename math_types_>
typedef math_types_ OpenTissue::geometry::Plane< math_types_ >::math_types
template<typename math_types_>
typedef math_types::matrix3x3_type OpenTissue::geometry::Plane< math_types_ >::matrix3x3_type
template<typename math_types_>
typedef Plane<math_types> OpenTissue::geometry::Plane< math_types_ >::plane_type [protected]
template<typename math_types_>
typedef math_types::real_type OpenTissue::geometry::Plane< math_types_ >::real_type [protected]
template<typename math_types_>
typedef math_types::value_traits OpenTissue::geometry::Plane< math_types_ >::value_traits [protected]
template<typename math_types_>
typedef math_types::vector3_type OpenTissue::geometry::Plane< math_types_ >::vector3_type

Constructor & Destructor Documentation

template<typename math_types_>
OpenTissue::geometry::Plane< math_types_ >::Plane (  )  [inline]

Default constructor. Sets up a plane such that:

n = 0 and d =0

This means that all points no matter what their poisition would be lines in the plane.

template<typename math_types_>
OpenTissue::geometry::Plane< math_types_ >::Plane ( vector3_type const &  p1,
vector3_type const &  p2,
vector3_type const &  p3 
) [inline, explicit]

Special constructor. Works in the same way as the corresponding assignment method.

Parameters:
p1 A point in the plane.
p2 A point in the plane.
p3 A point in the plane.
template<typename math_types_>
OpenTissue::geometry::Plane< math_types_ >::Plane ( Plane< math_types_ > const &  p  )  [inline]

Copy constructor. Works in the same way as the corresponding assignment method.

Parameters:
Eq Another plane equation.
template<typename math_types_>
OpenTissue::geometry::Plane< math_types_ >::Plane ( vector3_type const &  n_val,
real_type const &  d_val 
) [inline, explicit]

Special Constructor.

Parameters:
n The direction of the normal vector of this plane.
d The orthogonal distance from origo.
template<typename math_types_>
OpenTissue::geometry::Plane< math_types_ >::Plane ( vector3_type const &  ndir,
vector3_type const &  p 
) [inline, explicit]

Special constructor. Works in the same way as the corresponding assignment method.

Parameters:
ndir The direction of the normal vector of this plane.
p A point in the plane.

Member Function Documentation

template<typename math_types_>
size_t const OpenTissue::geometry::Plane< math_types_ >::class_id (  )  const [inline, virtual]

Query the class ID.

Returns:
The object's class ID

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

template<typename math_types_>
void OpenTissue::geometry::Plane< math_types_ >::compute_collision_aabb ( vector3_type const &  ,
matrix3x3_type const &  ,
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::Plane< math_types_ >::compute_plane_vectors ( vector3_type tx,
vector3_type ty 
) const [inline]

This method computes two orthogonal vectors, which span the plane.

These vectors are usefull when one wants to project points onto the plane.

Parameters:
tx Upon return this vector holds the x-axe direction in the plane.
ty Upon return this vector holds the y-axe direction in the plane.
template<typename math_types_>
void OpenTissue::geometry::Plane< math_types_ >::compute_surface_points ( std::vector< vector3_type > &   )  const [inline]
template<typename math_types_>
real_type OpenTissue::geometry::Plane< math_types_ >::evaluate ( vector3_type const &  x  )  const [inline]
template<typename math_types_>
void OpenTissue::geometry::Plane< math_types_ >::flip (  )  [inline]

Flip Plane.

template<typename math_types_>
real_type OpenTissue::geometry::Plane< math_types_ >::get_distance ( vector3_type const &  p  )  const [inline]

Retrieves the shortest distance from the specified point to this plane.

Parameters:
p A point
Returns:
The shortest distance from the specified point to this plane.
template<typename math_types_>
vector3_type OpenTissue::geometry::Plane< math_types_ >::get_support_point ( vector3_type const &   )  const [inline]
template<typename math_types_>
vector3_type OpenTissue::geometry::Plane< math_types_ >::gradient ( vector3_type const &   )  const [inline]
template<typename math_types_>
bool OpenTissue::geometry::Plane< math_types_ >::is_coplanar ( plane_type const &  p  )  const [inline]

Coplanar Test. This method test if the specified plane and this plane are coplanar. That is whatever their normals point in the same direction.

template<typename math_types_>
bool OpenTissue::geometry::Plane< math_types_ >::is_equal ( plane_type const &  p  )  const [inline]
template<typename math_types_>
bool OpenTissue::geometry::Plane< math_types_ >::isNearlyEqual ( plane_type const &  p  )  const [inline]
template<typename math_types_>
vector3_type const& OpenTissue::geometry::Plane< math_types_ >::n (  )  const [inline]
template<typename math_types_>
vector3_type& OpenTissue::geometry::Plane< math_types_ >::n (  )  [inline]
template<typename math_types_>
vector3_type OpenTissue::geometry::Plane< math_types_ >::normal ( vector3_type const &   )  const [inline]
template<typename math_types_>
vector3_type OpenTissue::geometry::Plane< math_types_ >::project ( vector3_type const &  point  )  const [inline]

Project Point onto Plane.

Parameters:
point The point that should be projected.
Returns:
The projected point
template<typename math_types_>
void OpenTissue::geometry::Plane< math_types_ >::rotate ( matrix3x3_type const &  R  )  [inline]

Rotation of Plane. The transformation rule is easy to derive, let prime values denote the new value of this plane equation and non-prime the current values.

d = n*p n' = R*n d' = Rn*(t+Rp) | where p is old point in plane d' = (Rn)*t + (Rn)*(Rp) d' = n'*t + d

Parameters:
R The rotation of the plane around origo.
template<typename math_types_>
void OpenTissue::geometry::Plane< math_types_ >::scale ( real_type const &   )  [inline]
template<typename math_types_>
void OpenTissue::geometry::Plane< math_types_ >::set ( plane_type const &  p  )  [inline]

Assignment Method. Assigns the values of the specified plane equation to this plane equation.

Parameters:
Eq Another plane equation.
template<typename math_types_>
void OpenTissue::geometry::Plane< math_types_ >::set ( vector3_type const &  n_val,
real_type const &  d_val 
) [inline]

Assignment Method.

Parameters:
n The direction of the normal vector of this plane.
d The orthogonal distance from origo.
template<typename math_types_>
void OpenTissue::geometry::Plane< math_types_ >::set ( vector3_type const &  p1,
vector3_type const &  p2,
vector3_type const &  p3 
) [inline]

Assignment Method. Assigns values to this plane in such a way that all the three specified points lie in the plane.

VERY IMPORTANT: The three points must all be different and not collinear.

Parameters:
p1 A point in the plane.
p2 A point in the plane.
p3 A point in the plane.
template<typename math_types_>
void OpenTissue::geometry::Plane< math_types_ >::set ( vector3_type const &  ndir,
vector3_type const &  p 
) [inline]

Assignment Method. Assigns values to this plane in such a way, that the plane will have a unit vector normal in the same direction as the first argument, and in such a way that the second argument lies in the plane represented by this plane equation.

Parameters:
ndir The direction of the normal vector of this plane.
p A point in the plane.
template<typename math_types_>
void OpenTissue::geometry::Plane< math_types_ >::set ( real_type c1,
real_type c2,
real_type c3 
) [inline]

This method computes the plane equation from three given points which lies in the plane.

Parameters:
c1 First point of the plane.
c2 Second point of the plane.
c3 Third point of the plane.
template<typename math_types_>
real_type OpenTissue::geometry::Plane< math_types_ >::signed_distance ( vector3_type const &  p  )  const [inline]

Retrieves the shortest distance with sign from the specified point to this plane.

If the point lies on the side of the plane where the normal is pointing the sign would be positive. This side of the plane is known as the frontside. If the point was on the backside the sign would have been negative. The final possibility is that the point lies in the plane. In this case the reutrn value is zero.

Parameters:
p A point
Returns:
The shortest signed distance from the specified point to this plane.
template<typename math_types_>
void OpenTissue::geometry::Plane< math_types_ >::translate ( vector3_type const &  T  )  [inline]

Translation of Plane.

Parameters:
T The translation of the plane.
template<typename math_types_>
real_type const& OpenTissue::geometry::Plane< math_types_ >::w (  )  const [inline]
template<typename math_types_>
real_type& OpenTissue::geometry::Plane< math_types_ >::w (  )  [inline]

Member Data Documentation

template<typename math_types_>
real_type OpenTissue::geometry::Plane< math_types_ >::m_d

The offset of the plane (in the direction of the normal) from the origin of the coordinate frame.

template<typename math_types_>
vector3_type OpenTissue::geometry::Plane< math_types_ >::m_n

The Plane Normal.


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