sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes > Class Template Reference

A class that provides geometry information on an TriangleSet. More...

#include <TriangleSetGeometryAlgorithms.h>

Inheritance diagram for sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >:

Inheritance graph
[legend]
Collaboration diagram for sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >:

Collaboration graph
[legend]

Public Types

typedef DataTypes::VecCoord VecCoord
typedef DataTypes::Real Real
typedef DataTypes::Coord Coord

Public Member Functions

 TriangleSetGeometryAlgorithms ()
virtual ~TriangleSetGeometryAlgorithms ()
const Coord & getPositionPoint (unsigned int i)
 Returns spatial position of point indexed by i.
Real computeTriangleArea (const unsigned int i) const
 Computes the area of triangle no i and returns it.
void computeTriangleArea (BasicArrayInterface< Real > &ai) const
 Computes the triangle area of all triangles are store in the array interface.
Real computeRestTriangleArea (const unsigned int i) const
 Computes the initial area of triangle no i and returns it.
sofa::helper::vector< double > computeTriangleBarycoefs (const sofa::defaulttype::Vec< 3, double > &p, unsigned int ind_t)
 Computes barycentric coefficients of point p in triangle (a,b,c) indexed by ind_t.
sofa::helper::vector< double > compute3PointsBarycoefs (const sofa::defaulttype::Vec< 3, double > &p, unsigned int ind_p1, unsigned int ind_p2, unsigned int ind_p3)
 Computes barycentric coefficients of point p in triangle whose vertices are indexed by (ind_p1,ind_p2,ind_p3).
void closestIndexPair (unsigned int ind_ta, unsigned int ind_tb, unsigned int &ind1, unsigned int &ind2)
 Finds the two closest points from two triangles (each of the point belonging to one triangle).
bool is_PointinTriangle (bool is_tested, const sofa::defaulttype::Vec< 3, Real > &p, unsigned int ind_t, unsigned int &ind_t_test)
 Tests if a point is included in the triangle indexed by ind_t.
sofa::defaulttype::Vec< 3, double > computeBaryEdgePoint (sofa::helper::vector< unsigned int > &indices, const double &coord_p)
 Computes the point defined by 2 indices of vertex and 1 barycentric coordinate.
sofa::defaulttype::Vec< 3, double > computeTriangleNormal (const unsigned int ind_t)
 Computes the normal vector of a triangle indexed by ind_t (not normed).
bool isQuadDeulaunayOriented (const sofa::defaulttype::Vec< 3, double > &p_q1, const sofa::defaulttype::Vec< 3, double > &p_q2, unsigned int ind_q3, unsigned int ind_q4)
 Tests how to triangularize a quad whose vertices are defined by (p_q1, p_q2, ind_q3, ind_q4) according to the Delaunay criterion.
sofa::defaulttype::Vec< 3, double > getOppositePoint (unsigned int ind_p, sofa::helper::vector< unsigned int > &indices, const double &coord_p)
 Computes the opposite point to ind_p.
bool is_triangle_in_plane (const unsigned int ind_t, const unsigned int ind_p, const sofa::defaulttype::Vec< 3, Real > &plane_vect)
 Tests if a triangle indexed by ind_t (and incident to the vertex indexed by ind_p) is included or not in the plane defined by (ind_p, plane_vect).
void Prepare_VertexDuplication (const unsigned int ind_p, const unsigned int ind_t_from, const unsigned int ind_t_to, const sofa::helper::vector< unsigned int > &indices_from, const double &coord_from, const sofa::helper::vector< unsigned int > &indices_to, const double &coord_to, sofa::helper::vector< unsigned int > &triangles_list_1, sofa::helper::vector< unsigned int > &triangles_list_2)
 Prepares the duplication of a vertex.
bool computeSegmentTriangleIntersection (bool is_entered, const sofa::defaulttype::Vec< 3, double > &a, const sofa::defaulttype::Vec< 3, double > &b, const unsigned int ind_t, sofa::helper::vector< unsigned int > &indices, double &baryCoef, double &coord_kmin)
 Computes the intersection of the vector from point a to point b and the triangle indexed by t.
bool computeIntersectedPointsList (const sofa::defaulttype::Vec< 3, double > &a, const sofa::defaulttype::Vec< 3, double > &b, const unsigned int ind_ta, unsigned int &ind_tb, sofa::helper::vector< unsigned int > &triangles_list, sofa::helper::vector< sofa::helper::vector< unsigned int > > &indices_list, sofa::helper::vector< double > &coords_list, bool &is_on_boundary)
 Computes the list of points (ind_edge,coord) intersected by the segment from point a to point b and the triangular mesh.
void writeMSHfile (const char *filename)
 Write the current mesh into a msh file.

Detailed Description

template<class DataTypes>
class sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >

A class that provides geometry information on an TriangleSet.

Definition at line 50 of file TriangleSetGeometryAlgorithms.h.


Member Typedef Documentation

template<class DataTypes >
typedef DataTypes::Coord sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::Coord

template<class DataTypes >
typedef DataTypes::Real sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::Real

template<class DataTypes >
typedef DataTypes::VecCoord sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::VecCoord


Constructor & Destructor Documentation

template<class DataTypes >
sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::TriangleSetGeometryAlgorithms (  )  [inline]

Definition at line 57 of file TriangleSetGeometryAlgorithms.h.

template<class DataTypes >
virtual sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::~TriangleSetGeometryAlgorithms (  )  [inline, virtual]

Definition at line 61 of file TriangleSetGeometryAlgorithms.h.


Member Function Documentation

template<class DataTypes >
void sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::closestIndexPair ( unsigned int  ind_ta,
unsigned int  ind_tb,
unsigned int &  ind1,
unsigned int &  ind2 
) [inline]

Finds the two closest points from two triangles (each of the point belonging to one triangle).

Definition at line 270 of file TriangleSetGeometryAlgorithms.inl.

References sofa::core::componentmodel::topology::BaseMeshTopology::getTriangle(), and sofa::component::topology::PointSetGeometryAlgorithms< DataTypes >::m_topology.

template<class DataTypes >
sofa::helper::vector< double > sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::compute3PointsBarycoefs ( const sofa::defaulttype::Vec< 3, double > &  p,
unsigned int  ind_p1,
unsigned int  ind_p2,
unsigned int  ind_p3 
) [inline]

Computes barycentric coefficients of point p in triangle whose vertices are indexed by (ind_p1,ind_p2,ind_p3).

Definition at line 214 of file TriangleSetGeometryAlgorithms.inl.

References cross(), and sofa::defaulttype::Vec< N, real >::cross().

template<class DataTypes >
Vec< 3, double > sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::computeBaryEdgePoint ( sofa::helper::vector< unsigned int > &  indices,
const double &  coord_p 
) [inline]

Computes the point defined by 2 indices of vertex and 1 barycentric coordinate.

Definition at line 74 of file TriangleSetGeometryAlgorithms.inl.

template<class DataTypes >
bool sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::computeIntersectedPointsList ( const sofa::defaulttype::Vec< 3, double > &  a,
const sofa::defaulttype::Vec< 3, double > &  b,
const unsigned int  ind_ta,
unsigned int &  ind_tb,
sofa::helper::vector< unsigned int > &  triangles_list,
sofa::helper::vector< sofa::helper::vector< unsigned int > > &  indices_list,
sofa::helper::vector< double > &  coords_list,
bool &  is_on_boundary 
) [inline]

template<class DataTypes >
DataTypes::Real sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::computeRestTriangleArea ( const unsigned int  i  )  const [inline]

template<class DataTypes >
bool sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::computeSegmentTriangleIntersection ( bool  is_entered,
const sofa::defaulttype::Vec< 3, double > &  a,
const sofa::defaulttype::Vec< 3, double > &  b,
const unsigned int  ind_t,
sofa::helper::vector< unsigned int > &  indices,
double &  baryCoef,
double &  coord_kmin 
) [inline]

template<class DataTypes >
void sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::computeTriangleArea ( BasicArrayInterface< Real > &  ai  )  const [inline]

Computes the triangle area of all triangles are store in the array interface.

computes the edge length of all edges are store in the array interface

Definition at line 60 of file TriangleSetGeometryAlgorithms.inl.

References sofa::component::topology::areaProduct(), sofa::core::componentmodel::topology::BaseMeshTopology::getTriangles(), and sofa::component::topology::PointSetGeometryAlgorithms< DataTypes >::m_topology.

template<class DataTypes >
DataTypes::Real sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::computeTriangleArea ( const unsigned int  i  )  const [inline]

template<class DataTypes >
sofa::helper::vector< double > sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::computeTriangleBarycoefs ( const sofa::defaulttype::Vec< 3, double > &  p,
unsigned int  ind_t 
) [inline]

template<class DataTypes >
Vec< 3, double > sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::computeTriangleNormal ( const unsigned int  ind_t  )  [inline]

template<class DataTypes >
Vec< 3, double > sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::getOppositePoint ( unsigned int  ind_p,
sofa::helper::vector< unsigned int > &  indices,
const double &  coord_p 
) [inline]

template<class DataTypes >
const DataTypes::Coord & sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::getPositionPoint ( unsigned int  i  )  [inline]

Returns spatial position of point indexed by i.

Definition at line 782 of file TriangleSetGeometryAlgorithms.inl.

template<class DataTypes >
bool sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::is_PointinTriangle ( bool  is_tested,
const sofa::defaulttype::Vec< 3, Real > &  p,
unsigned int  ind_t,
unsigned int &  ind_t_test 
) [inline]

template<class DataTypes >
bool sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::is_triangle_in_plane ( const unsigned int  ind_t,
const unsigned int  ind_p,
const sofa::defaulttype::Vec< 3, Real > &  plane_vect 
) [inline]

Tests if a triangle indexed by ind_t (and incident to the vertex indexed by ind_p) is included or not in the plane defined by (ind_p, plane_vect).

Definition at line 494 of file TriangleSetGeometryAlgorithms.inl.

References sofa::core::componentmodel::topology::BaseMeshTopology::getTriangle(), and sofa::component::topology::PointSetGeometryAlgorithms< DataTypes >::m_topology.

Referenced by sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::Prepare_VertexDuplication().

template<class DataTypes >
bool sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::isQuadDeulaunayOriented ( const sofa::defaulttype::Vec< 3, double > &  p_q1,
const sofa::defaulttype::Vec< 3, double > &  p_q2,
unsigned int  ind_q3,
unsigned int  ind_q4 
) [inline]

Tests how to triangularize a quad whose vertices are defined by (p_q1, p_q2, ind_q3, ind_q4) according to the Delaunay criterion.

Definition at line 456 of file TriangleSetGeometryAlgorithms.inl.

template<class DataTypes >
void sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::Prepare_VertexDuplication ( const unsigned int  ind_p,
const unsigned int  ind_t_from,
const unsigned int  ind_t_to,
const sofa::helper::vector< unsigned int > &  indices_from,
const double &  coord_from,
const sofa::helper::vector< unsigned int > &  indices_to,
const double &  coord_to,
sofa::helper::vector< unsigned int > &  triangles_list_1,
sofa::helper::vector< unsigned int > &  triangles_list_2 
) [inline]

template<typename DataTypes >
void sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::writeMSHfile ( const char *  filename  )  [inline]


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

Generated on Sun Nov 23 04:21:40 2008 for Sofa by  doxygen 1.5.7.1