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

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

#include <geometry_triangle.h>

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

List of all members.

Public Types

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

Public Member Functions

size_t const class_id () const
 Triangle ()
virtual ~Triangle ()
 Triangle (Triangle const &triangle)
 Triangle (vector3_type const &p0_, vector3_type const &p1_, vector3_type const &p2_)
 Triangle (vector3_type *p0_, vector3_type *p1_, vector3_type *p2_)
template<typename face_type >
 Triangle (face_type *f)
Triangle const & operator= (Triangle const &triangle)
template<typename face_type >
void set (face_type *f)
void set (Triangle const &triangle)
void set (const vector3_type &p0_, const vector3_type &p1_, const vector3_type &p2_)
void bind (vector3_type *p0_, vector3_type *p1_, vector3_type *p2_)
void unbind ()
void barycentric (vector3_type const &p, real_type &w1, real_type &w2, real_type &w3) const
real_type area () const
void compute_surface_points (std::vector< vector3_type > &points) const
vector3_type get_support_point (vector3_type const &v) const
vector3_typep0 ()
vector3_typep1 ()
vector3_typep2 ()
vector3_type const & p0 () const
vector3_type const & p1 () const
vector3_type const & p2 () const
vector3_type center () const
vector3_type normal () const
void translate (vector3_type const &T)
void rotate (matrix3x3_type const &R)
void scale (real_type const &s)
void compute_collision_aabb (vector3_type const &r, matrix3x3_type const &R, vector3_type &min_coord, vector3_type &max_coord) const

Protected Types

typedef math_types::value_traits value_traits

Protected Attributes

vector3_typem_p0
 Triangle vertex number 1.
vector3_typem_p1
 Triangle vertex number 2.
vector3_typem_p2
 Triangle vertex number 3.
bool m_bound
 Boolan flag indicating whether triangle vertices are bound to other data (allocated elsewhere).

Detailed Description

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

A Triangle Class. Observe that the vertices of the triangle can be bound to vector3's allocated elsewhere, this is useful for binding a triangle to a underlying deforming geomtry.


Member Typedef Documentation

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

Constructor & Destructor Documentation

template<typename math_types_>
OpenTissue::geometry::Triangle< math_types_ >::Triangle (  )  [inline]
template<typename math_types_>
virtual OpenTissue::geometry::Triangle< math_types_ >::~Triangle (  )  [inline, virtual]
template<typename math_types_>
OpenTissue::geometry::Triangle< math_types_ >::Triangle ( Triangle< math_types_ > const &  triangle  )  [inline]
template<typename math_types_>
OpenTissue::geometry::Triangle< math_types_ >::Triangle ( vector3_type const &  p0_,
vector3_type const &  p1_,
vector3_type const &  p2_ 
) [inline, explicit]
template<typename math_types_>
OpenTissue::geometry::Triangle< math_types_ >::Triangle ( vector3_type p0_,
vector3_type p1_,
vector3_type p2_ 
) [inline, explicit]

Specialized Constructor. This constuctor makes the triangle store pointers to its vertex coordinates.

Parameters:
p0 
p1 
p2 
template<typename math_types_>
template<typename face_type >
OpenTissue::geometry::Triangle< math_types_ >::Triangle ( face_type *  f  )  [inline]

Specialized Constructor.

Parameters:
face 

Member Function Documentation

template<typename math_types_>
real_type OpenTissue::geometry::Triangle< math_types_ >::area (  )  const [inline]
template<typename math_types_>
void OpenTissue::geometry::Triangle< math_types_ >::barycentric ( vector3_type const &  p,
real_type w1,
real_type w2,
real_type w3 
) const [inline]

Compute Barycentric Coordinates.

Parameters:
p The point for which the barycentric coordinates should be computed.
w1 Upon return this parameter contains the value of the first barycentric coordinate.
w2 Upon return this parameter contains the value of the second barycentric coordinate.
w3 Upon return this parameter contains the value of the third barycentric coordinate.
template<typename math_types_>
void OpenTissue::geometry::Triangle< math_types_ >::bind ( vector3_type p0_,
vector3_type p1_,
vector3_type p2_ 
) [inline]

Bind

Parameters:
p0 
p1 
p2 
template<typename math_types_>
vector3_type OpenTissue::geometry::Triangle< math_types_ >::center (  )  const [inline]
template<typename math_types_>
size_t const OpenTissue::geometry::Triangle< math_types_ >::class_id (  )  const [inline, virtual]

Query the class ID.

Returns:
The object's class ID

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

template<typename math_types_>
void OpenTissue::geometry::Triangle< 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::Triangle< math_types_ >::compute_surface_points ( std::vector< vector3_type > &  points  )  const [inline]

Retrieve Triangle Corners

Parameters:
points 
template<typename math_types_>
vector3_type OpenTissue::geometry::Triangle< math_types_ >::get_support_point ( vector3_type const &  v  )  const [inline]
template<typename math_types_>
vector3_type OpenTissue::geometry::Triangle< math_types_ >::normal (  )  const [inline]
template<typename math_types_>
Triangle const& OpenTissue::geometry::Triangle< math_types_ >::operator= ( Triangle< math_types_ > const &  triangle  )  [inline]

Assignment Operator.

Parameters:
triangle 
template<typename math_types_>
vector3_type& OpenTissue::geometry::Triangle< math_types_ >::p0 (  )  [inline]
template<typename math_types_>
vector3_type const& OpenTissue::geometry::Triangle< math_types_ >::p0 (  )  const [inline]
template<typename math_types_>
vector3_type const& OpenTissue::geometry::Triangle< math_types_ >::p1 (  )  const [inline]
template<typename math_types_>
vector3_type& OpenTissue::geometry::Triangle< math_types_ >::p1 (  )  [inline]
template<typename math_types_>
vector3_type& OpenTissue::geometry::Triangle< math_types_ >::p2 (  )  [inline]
template<typename math_types_>
vector3_type const& OpenTissue::geometry::Triangle< math_types_ >::p2 (  )  const [inline]
template<typename math_types_>
void OpenTissue::geometry::Triangle< math_types_ >::rotate ( matrix3x3_type const &  R  )  [inline]
template<typename math_types_>
void OpenTissue::geometry::Triangle< math_types_ >::scale ( real_type const &  s  )  [inline]

Uniform Scaling of Triangle.

Parameters:
s The scaling of the triangle.
template<typename math_types_>
template<typename face_type >
void OpenTissue::geometry::Triangle< math_types_ >::set ( face_type *  f  )  [inline]
template<typename math_types_>
void OpenTissue::geometry::Triangle< math_types_ >::set ( Triangle< math_types_ > const &  triangle  )  [inline]
template<typename math_types_>
void OpenTissue::geometry::Triangle< math_types_ >::set ( const vector3_type p0_,
const vector3_type p1_,
const vector3_type p2_ 
) [inline]
template<typename math_types_>
void OpenTissue::geometry::Triangle< math_types_ >::translate ( vector3_type const &  T  )  [inline]
template<typename math_types_>
void OpenTissue::geometry::Triangle< math_types_ >::unbind (  )  [inline]

Member Data Documentation

template<typename math_types_>
bool OpenTissue::geometry::Triangle< math_types_ >::m_bound [protected]

Boolan flag indicating whether triangle vertices are bound to other data (allocated elsewhere).

template<typename math_types_>
vector3_type* OpenTissue::geometry::Triangle< math_types_ >::m_p0 [protected]

Triangle vertex number 1.

template<typename math_types_>
vector3_type* OpenTissue::geometry::Triangle< math_types_ >::m_p1 [protected]

Triangle vertex number 2.

template<typename math_types_>
vector3_type* OpenTissue::geometry::Triangle< math_types_ >::m_p2 [protected]

Triangle vertex number 3.


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