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

A class that performs topology algorithms on an TriangleSet. More...

#include <TriangleSetTopologyAlgorithms.h>

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

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

Collaboration graph
[legend]

Public Types

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

Public Member Functions

 TriangleSetTopologyAlgorithms ()
virtual ~TriangleSetTopologyAlgorithms ()
virtual void init ()
 Initialization method called at graph modification, during bottom-up traversal.
bool Suture2Points (unsigned int ind_ta, unsigned int ind_tb, unsigned int &ind1, unsigned int &ind2)
 Moves and fixes the two closest points of two triangles to their median point.
bool InciseAlongPointsList (bool is_first_cut, const sofa::defaulttype::Vec< 3, double > &a, const sofa::defaulttype::Vec< 3, double > &b, const unsigned int ind_ta, const unsigned int ind_tb, unsigned int &a_last, sofa::helper::vector< unsigned int > &a_p12_last, sofa::helper::vector< unsigned int > &a_i123_last, unsigned int &b_last, sofa::helper::vector< unsigned int > &b_p12_last, sofa::helper::vector< unsigned int > &b_i123_last, sofa::helper::vector< sofa::helper::vector< unsigned int > > &new_points, sofa::helper::vector< sofa::helper::vector< unsigned int > > &closest_vertices)
 Incises along the list of points (ind_edge,coord) intersected by the vector from point a to point b and the triangular mesh.
void RemoveAlongTrianglesList (const sofa::defaulttype::Vec< 3, double > &a, const sofa::defaulttype::Vec< 3, double > &b, const unsigned int ind_ta, const unsigned int ind_tb)
 Removes triangles along the list of points (ind_edge,coord) intersected by the vector from point a to point b and the triangular mesh.
void InciseAlongLinesList (const sofa::helper::vector< sofa::defaulttype::Vec< 3, double > > &input_points, const sofa::helper::vector< unsigned int > &input_triangles)
 Incises along the list of points (ind_edge,coord) intersected by the sequence of input segments (list of input points) and the triangular mesh.
virtual int InciseAlongEdge (unsigned int edge)
 Duplicates the given edge.

Private Attributes

TriangleSetTopologyContainer * m_container
TriangleSetTopologyModifier * m_modifier
TriangleSetGeometryAlgorithms
< DataTypes > * 
m_geometryAlgorithms

Detailed Description

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

A class that performs topology algorithms on an TriangleSet.

Definition at line 55 of file TriangleSetTopologyAlgorithms.h.


Member Typedef Documentation

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

Definition at line 60 of file TriangleSetTopologyAlgorithms.h.

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

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

Definition at line 58 of file TriangleSetTopologyAlgorithms.h.


Constructor & Destructor Documentation

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

Definition at line 62 of file TriangleSetTopologyAlgorithms.h.

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

Definition at line 66 of file TriangleSetTopologyAlgorithms.h.


Member Function Documentation

template<class DataTypes >
int sofa::component::topology::TriangleSetTopologyAlgorithms< DataTypes >::InciseAlongEdge ( unsigned int  edge  )  [inline, virtual]

template<class DataTypes >
void sofa::component::topology::TriangleSetTopologyAlgorithms< DataTypes >::InciseAlongLinesList ( const sofa::helper::vector< sofa::defaulttype::Vec< 3, double > > &  input_points,
const sofa::helper::vector< unsigned int > &  input_triangles 
) [inline]

Incises along the list of points (ind_edge,coord) intersected by the sequence of input segments (list of input points) and the triangular mesh.

force the creation of TriangleEdgeShellArray

force the creation of TriangleVertexShellArray

Register the creation of point a

Register the creation of triangles incident to point a

Register the removal of triangles incident to point a

VERTEX 0

VERTEX 1

VERTEX 2

Register the creation of triangles incident to point indexed by ind_a

Register the creation of the two points (say current "duplicated points") localized on the current interected edge

VERTEX 0

VERTEX 1

Register the removal of the current triangle

Register the creation of triangles incident to the current "duplicated points" and to the previous "duplicated points"

Register the creation of point b

Register the creation of triangles incident to point b

Register the removal of triangles incident to point b

VERTEX 0

VERTEX 1

VERTEX 2

Register the creation of triangles incident to point indexed by ind_b

Definition at line 1060 of file TriangleSetTopologyAlgorithms.inl.

References sofa::component::topology::TriangleSetTopologyModifier::addPointsProcess(), sofa::component::topology::PointSetTopologyModifier::addPointsWarning(), sofa::component::topology::TriangleSetTopologyModifier::addTrianglesProcess(), sofa::component::topology::TriangleSetTopologyModifier::addTrianglesWarning(), sofa::core::componentmodel::topology::BaseMeshTopology::getTriangle(), sofa::component::topology::TriangleSetTopologyContainer::getTriangleArray(), sofa::component::topology::TriangleSetTopologyContainer::getTriangleEdgeShellArray(), sofa::component::topology::TriangleSetTopologyContainer::getTriangleVertexShellArray(), sofa::component::topology::TriangleSetTopologyAlgorithms< DataTypes >::m_container, sofa::component::topology::TriangleSetTopologyAlgorithms< DataTypes >::m_geometryAlgorithms, sofa::component::topology::TriangleSetTopologyAlgorithms< DataTypes >::m_modifier, sofa::component::topology::TriangleSetTopologyModifier::removeTriangles(), sofa::component::topology::snapping_test_edge(), and sofa::component::topology::snapping_test_triangle().

template<class DataTypes >
bool sofa::component::topology::TriangleSetTopologyAlgorithms< DataTypes >::InciseAlongPointsList ( bool  is_first_cut,
const sofa::defaulttype::Vec< 3, double > &  a,
const sofa::defaulttype::Vec< 3, double > &  b,
const unsigned int  ind_ta,
const unsigned int  ind_tb,
unsigned int &  a_last,
sofa::helper::vector< unsigned int > &  a_p12_last,
sofa::helper::vector< unsigned int > &  a_i123_last,
unsigned int &  b_last,
sofa::helper::vector< unsigned int > &  b_p12_last,
sofa::helper::vector< unsigned int > &  b_i123_last,
sofa::helper::vector< sofa::helper::vector< unsigned int > > &  new_points,
sofa::helper::vector< sofa::helper::vector< unsigned int > > &  closest_vertices 
) [inline]

Incises along the list of points (ind_edge,coord) intersected by the vector from point a to point b and the triangular mesh.

force the creation of TriangleEdgeShellArray

force the creation of TriangleVertexShellArray

Register the creation of point a

Register the creation of triangles incident to point a

Register the removal of triangles incident to point a

VERTEX 0

VERTEX 1

VERTEX 2

Register the creation of triangles incident to point indexed by ind_a

Register the creation of the two points (say current "duplicated points") localized on the current interected edge

VERTEX 0

VERTEX 1

Register the removal of the current triangle

Register the creation of triangles incident to the current "duplicated points" and to the previous "duplicated points"

Register the creation of point b

Register the creation of triangles incident to point b

Register the removal of triangles incident to point b

VERTEX 0

VERTEX 1

VERTEX 2

Register the creation of triangles incident to point indexed by ind_b

Definition at line 91 of file TriangleSetTopologyAlgorithms.inl.

References sofa::component::topology::TriangleSetTopologyModifier::addPointsProcess(), sofa::component::topology::PointSetTopologyModifier::addPointsWarning(), sofa::component::topology::TriangleSetTopologyModifier::addTrianglesProcess(), sofa::component::topology::TriangleSetTopologyModifier::addTrianglesWarning(), sofa::core::componentmodel::topology::BaseMeshTopology::getTriangle(), sofa::component::topology::TriangleSetTopologyContainer::getTriangleArray(), sofa::component::topology::TriangleSetTopologyContainer::getTriangleEdgeShellArray(), sofa::component::topology::TriangleSetTopologyContainer::getTriangleVertexShellArray(), sofa::component::topology::TriangleSetTopologyAlgorithms< DataTypes >::m_container, sofa::component::topology::TriangleSetTopologyAlgorithms< DataTypes >::m_geometryAlgorithms, sofa::component::topology::TriangleSetTopologyAlgorithms< DataTypes >::m_modifier, sofa::component::topology::TriangleSetTopologyModifier::removeTriangles(), sofa::component::topology::snapping_test_edge(), and sofa::component::topology::snapping_test_triangle().

Referenced by sofa::component::collision::TopologicalChangeManager::incisionTriangleSetTopology().

template<class DataTypes >
void sofa::component::topology::TriangleSetTopologyAlgorithms< DataTypes >::init ( void   )  [inline, virtual]

template<class DataTypes >
void sofa::component::topology::TriangleSetTopologyAlgorithms< DataTypes >::RemoveAlongTrianglesList ( const sofa::defaulttype::Vec< 3, double > &  a,
const sofa::defaulttype::Vec< 3, double > &  b,
const unsigned int  ind_ta,
const unsigned int  ind_tb 
) [inline]

template<class DataTypes >
bool sofa::component::topology::TriangleSetTopologyAlgorithms< DataTypes >::Suture2Points ( unsigned int  ind_ta,
unsigned int  ind_tb,
unsigned int &  ind1,
unsigned int &  ind2 
) [inline]

Moves and fixes the two closest points of two triangles to their median point.

TODO:Cast into a MechanicalObject ?

Definition at line 58 of file TriangleSetTopologyAlgorithms.inl.

References sofa::component::MechanicalObject< DataTypes >::forcePointPosition(), and sofa::component::topology::TriangleSetTopologyAlgorithms< DataTypes >::m_geometryAlgorithms.


Field Documentation


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