#include <TriangleSetGeometryAlgorithms.h>


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. | |
Definition at line 50 of file TriangleSetGeometryAlgorithms.h.
| typedef DataTypes::Coord sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::Coord |
Reimplemented from sofa::component::topology::EdgeSetGeometryAlgorithms< DataTypes >.
Reimplemented in sofa::component::topology::TetrahedronSetGeometryAlgorithms< DataTypes >.
Definition at line 55 of file TriangleSetGeometryAlgorithms.h.
| typedef DataTypes::Real sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::Real |
Reimplemented from sofa::component::topology::EdgeSetGeometryAlgorithms< DataTypes >.
Reimplemented in sofa::component::topology::TetrahedronSetGeometryAlgorithms< DataTypes >.
Definition at line 54 of file TriangleSetGeometryAlgorithms.h.
| typedef DataTypes::VecCoord sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::VecCoord |
Reimplemented from sofa::component::topology::EdgeSetGeometryAlgorithms< DataTypes >.
Reimplemented in sofa::component::topology::TetrahedronSetGeometryAlgorithms< DataTypes >.
Definition at line 53 of file TriangleSetGeometryAlgorithms.h.
| sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::TriangleSetGeometryAlgorithms | ( | ) | [inline] |
Definition at line 57 of file TriangleSetGeometryAlgorithms.h.
| virtual sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::~TriangleSetGeometryAlgorithms | ( | ) | [inline, virtual] |
Definition at line 61 of file TriangleSetGeometryAlgorithms.h.
| 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.
| 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().
| 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.
| 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] |
Computes the list of points (ind_edge,coord) intersected by the segment from point a to point b and the triangular mesh.
Definition at line 1084 of file TriangleSetGeometryAlgorithms.inl.
References sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::computeSegmentTriangleIntersection(), sofa::core::componentmodel::topology::BaseMeshTopology::getEdgeIndex(), sofa::core::componentmodel::topology::BaseMeshTopology::getNbEdges(), sofa::core::componentmodel::topology::Topology::getNbPoints(), sofa::core::componentmodel::topology::BaseMeshTopology::getTriangle(), sofa::core::componentmodel::topology::BaseMeshTopology::getTriangleEdgeShell(), sofa::core::componentmodel::topology::BaseMeshTopology::getTriangleVertexShell(), and sofa::component::topology::PointSetGeometryAlgorithms< DataTypes >::m_topology.
| DataTypes::Real sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::computeRestTriangleArea | ( | const unsigned int | i | ) | const [inline] |
Computes the initial area of triangle no i and returns it.
Definition at line 50 of file TriangleSetGeometryAlgorithms.inl.
References sofa::component::topology::areaProduct(), sofa::core::componentmodel::topology::BaseMeshTopology::getTriangle(), and sofa::component::topology::PointSetGeometryAlgorithms< DataTypes >::m_topology.
Referenced by sofa::component::forcefield::TrianglePressureForceField< DataTypes >::initTriangleInformation().
| 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] |
Computes the intersection of the vector from point a to point b and the triangle indexed by t.
Test of edge (p0,p1) :
Test of edge (p1,p2) :
Test of edge (p2,p0) :
Definition at line 790 of file TriangleSetGeometryAlgorithms.inl.
References sofa::defaulttype::Vec< N, real >::cross(), cross(), sofa::core::componentmodel::topology::BaseMeshTopology::getTriangle(), sofa::defaulttype::Vec< N, real >::linearProduct(), sofa::component::topology::PointSetGeometryAlgorithms< DataTypes >::m_topology, and sofa::defaulttype::Vec< N, real >::norm().
Referenced by sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::computeIntersectedPointsList().
| 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.
| DataTypes::Real sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::computeTriangleArea | ( | const unsigned int | i | ) | const [inline] |
Computes the area of triangle no i and returns it.
Definition at line 41 of file TriangleSetGeometryAlgorithms.inl.
References sofa::component::topology::areaProduct(), sofa::core::componentmodel::topology::BaseMeshTopology::getTriangle(), and sofa::component::topology::PointSetGeometryAlgorithms< DataTypes >::m_topology.
| sofa::helper::vector< double > sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::computeTriangleBarycoefs | ( | const sofa::defaulttype::Vec< 3, double > & | p, | |
| unsigned int | ind_t | |||
| ) | [inline] |
Computes barycentric coefficients of point p in triangle (a,b,c) indexed by ind_t.
Definition at line 159 of file TriangleSetGeometryAlgorithms.inl.
References cross(), sofa::defaulttype::Vec< N, real >::cross(), sofa::core::componentmodel::topology::BaseMeshTopology::getTriangle(), and sofa::component::topology::PointSetGeometryAlgorithms< DataTypes >::m_topology.
| Vec< 3, double > sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::computeTriangleNormal | ( | const unsigned int | ind_t | ) | [inline] |
Computes the normal vector of a triangle indexed by ind_t (not normed).
Definition at line 130 of file TriangleSetGeometryAlgorithms.inl.
References cross(), sofa::core::componentmodel::topology::BaseMeshTopology::getTriangle(), and sofa::component::topology::PointSetGeometryAlgorithms< DataTypes >::m_topology.
Referenced by sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::Prepare_VertexDuplication().
| Vec< 3, double > sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::getOppositePoint | ( | unsigned int | ind_p, | |
| sofa::helper::vector< unsigned int > & | indices, | |||
| const double & | coord_p | |||
| ) | [inline] |
Computes the opposite point to ind_p.
Definition at line 92 of file TriangleSetGeometryAlgorithms.inl.
Referenced by sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::Prepare_VertexDuplication().
| 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.
| 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] |
Tests if a point is included in the triangle indexed by ind_t.
vertex 1
vertex 0
vertex 2
Definition at line 322 of file TriangleSetGeometryAlgorithms.inl.
References cross(), sofa::core::componentmodel::topology::BaseMeshTopology::getEdgeIndex(), sofa::core::componentmodel::topology::BaseMeshTopology::getTriangle(), sofa::core::componentmodel::topology::BaseMeshTopology::getTriangleEdgeShell(), sofa::core::componentmodel::topology::BaseMeshTopology::getTriangleVertexShell(), and sofa::component::topology::PointSetGeometryAlgorithms< DataTypes >::m_topology.
| 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().
| 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.
| 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] |
Prepares the duplication of a vertex.
Definition at line 546 of file TriangleSetGeometryAlgorithms.inl.
References sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::computeTriangleNormal(), sofa::defaulttype::Vec< N, real >::cross(), sofa::core::componentmodel::topology::BaseMeshTopology::getEdgeIndex(), sofa::core::componentmodel::topology::BaseMeshTopology::getNbEdges(), sofa::core::componentmodel::topology::Topology::getNbPoints(), sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::getOppositePoint(), sofa::core::componentmodel::topology::BaseMeshTopology::getTriangleEdgeShell(), sofa::core::componentmodel::topology::BaseMeshTopology::getTriangleVertexShell(), sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::is_triangle_in_plane(), and sofa::component::topology::PointSetGeometryAlgorithms< DataTypes >::m_topology.
| void sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::writeMSHfile | ( | const char * | filename | ) | [inline] |
Write the current mesh into a msh file.
Reimplemented from sofa::component::topology::EdgeSetGeometryAlgorithms< DataTypes >.
Reimplemented in sofa::component::topology::TetrahedronSetGeometryAlgorithms< DataTypes >.
Definition at line 1365 of file TriangleSetGeometryAlgorithms.inl.
References sofa::core::componentmodel::topology::BaseMeshTopology::getTriangles(), and sofa::component::topology::PointSetGeometryAlgorithms< DataTypes >::m_topology.
1.5.7.1