SOFA API  c76874b7
Open source framework for multi-physics simuation
sofa::component::topology::QuadSetGeometryAlgorithms< DataTypes > Class Template Reference

#include <QuadSetTopologyAlgorithms.h>

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

Detailed Description

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

A class that provides geometry information on an QuadSet.

Protected Attributes

Data< boolshowQuadIndices
 Debug : view Quad indices. More...
 
Data< bool_drawQuads
 if true, draw the quads in the topology More...
 
Data< sofa::helper::types::RGBAColor_drawColor
 RGB code color used to draw quads. More...
 
- Protected Attributes inherited from sofa::component::topology::EdgeSetGeometryAlgorithms< DataTypes >
bool initializedEdgeCubatureTables
 
Data< boolshowEdgeIndices
 Debug : view Edge indices. More...
 
Data< boold_drawEdges
 if true, draw the edges in the topology. More...
 
Data< RGBAColor_drawColor
 
NumericalIntegrationDescriptor< Real, 1 > edgeNumericalIntegration
 include cubature points More...
 
- Protected Attributes inherited from sofa::component::topology::PointSetGeometryAlgorithms< DataTypes >
sofa::core::behavior::MechanicalState< DataTypes > * object
 
sofa::core::topology::BaseMeshTopologym_topology
 
Data< floatd_showIndicesScale
 Debug : scale for view topology indices. More...
 
Data< boold_showPointIndices
 
Data< std::string > d_tagMechanics
 Tage of the Mechanical State associated with the vertex position. More...
 
SingleLink< PointSetGeometryAlgorithms< DataTypes >, sofa::core::topology::BaseMeshTopology, BaseLink::FLAG_STOREPATH|BaseLink::FLAG_STRONGLINKl_topology
 Link to be set to the topology container in the component graph. More...
 

Public Member Functions

 SOFA_CLASS (SOFA_TEMPLATE(QuadSetGeometryAlgorithms, DataTypes), SOFA_TEMPLATE(EdgeSetGeometryAlgorithms, DataTypes))
 
void computeQuadAABB (const QuadID i, Coord &minCoord, Coord &maxCoord) const
 
Coord computeQuadCenter (const QuadID i) const
 
void getQuadVertexCoordinates (const QuadID i, Coord[4]) const
 
void getRestQuadVertexCoordinates (const QuadID i, Coord[4]) const
 
Real computeQuadArea (const QuadID i) const
 Computes the area of quad no i and returns it. More...
 
void computeQuadArea (BasicArrayInterface< Real > &ai) const
 Computes the quad area of all quads are store in the array interface. More...
 
Real computeRestQuadArea (const QuadID i) const
 Computes the initial area of quad no i and returns it. More...
 
defaulttype::Vec< 3, doublecomputeQuadNormal (const QuadID ind_q) const
 Computes the normal vector of a quad indexed by ind_q (not normed) More...
 
bool isQuadInPlane (const QuadID ind_q, const PointID ind_p, const defaulttype::Vec< 3, Real > &plane_vect) const
 Tests if a quad indexed by ind_q (and incident to the vertex indexed by ind_p) is included or not in the plane defined by (ind_p, plane_vect) More...
 
bool isPointInQuad (const QuadID ind_q, const sofa::defaulttype::Vec< 3, Real > &p) const
 
void writeMSHfile (const char *filename) const
 Write the current mesh into a msh file. More...
 
void draw (const core::visual::VisualParams *vparams) override
 
- Public Member Functions inherited from sofa::component::topology::EdgeSetGeometryAlgorithms< DataTypes >
 SOFA_CLASS (SOFA_TEMPLATE(EdgeSetGeometryAlgorithms, DataTypes), SOFA_TEMPLATE(PointSetGeometryAlgorithms, DataTypes))
 
void draw (const core::visual::VisualParams *vparams) override
 
Real computeEdgeLength (const EdgeID i) const
 computes the length of edge no i and returns it More...
 
void computeEdgeLength (BasicArrayInterface< Real > &ai) const
 computes the edge length of all edges and stores it in the array interface More...
 
Real computeRestEdgeLength (const EdgeID i) const
 computes the initial length of edge no i and returns it More...
 
Real computeRestSquareEdgeLength (const EdgeID i) const
 computes the initial square length of edge no i and returns it More...
 
void computeEdgeAABB (const EdgeID i, CPos &minCoord, CPos &maxCoord) const
 
Coord computeEdgeCenter (const EdgeID i) const
 
Coord computeEdgeDirection (const EdgeID i) const
 
Coord computeRestEdgeDirection (const EdgeID i) const
 
void getEdgeVertexCoordinates (const EdgeID i, Coord[2]) const
 
void getRestEdgeVertexCoordinates (const EdgeID i, Coord[2]) const
 
bool isPointOnEdge (const sofa::defaulttype::Vec< 3, double > &pt, const EdgeID ind_e) const
 
sofa::helper::vector< doublecompute2PointsBarycoefs (const sofa::defaulttype::Vec< 3, double > &p, PointID ind_p1, PointID ind_p2) const
 
sofa::helper::vector< doublecomputeRest2PointsBarycoefs (const sofa::defaulttype::Vec< 3, double > &p, PointID ind_p1, PointID ind_p2) const
 
sofa::helper::vector< doublecomputePointProjectionOnEdge (const EdgeID i, sofa::defaulttype::Vec< 3, double > coord_x, bool &intersected)
 Compute the projection coordinate of a point C on the edge i. Using compute2EdgesIntersection(). More...
 
Coord compute2EdgesIntersection (const Coord edge1[2], const Coord edge2[2], bool &intersected)
 Compute the intersection coordinate of the 2 input straight lines. Lines vector director are computed using coord given in input. More...
 
bool computeEdgePlaneIntersection (EdgeID edgeID, sofa::defaulttype::Vec< 3, Real > pointOnPlane, sofa::defaulttype::Vec< 3, Real > normalOfPlane, sofa::defaulttype::Vec< 3, Real > &intersection)
 
bool computeRestEdgePlaneIntersection (EdgeID edgeID, sofa::defaulttype::Vec< 3, Real > pointOnPlane, sofa::defaulttype::Vec< 3, Real > normalOfPlane, sofa::defaulttype::Vec< 3, Real > &intersection)
 
void writeMSHfile (const char *filename) const
 Write the current mesh into a msh file. More...
 
void computeLocalFrameEdgeWeights (helper::vector< EdgeID > &numEdges, helper::vector< Edge > &edges, helper::vector< Vec3d > &weights) const
 
void initPointAdded (PointID indice, const core::topology::PointAncestorElem &ancestorElem, const helper::vector< VecCoord * > &coordVecs, const helper::vector< VecDeriv * > &derivVecs) override
 Process the added point initialization according to the topology and local coordinates. More...
 
NumericalIntegrationDescriptor< Real, 1 > & getEdgeNumericalIntegrationDescriptor ()
 
- Public Member Functions inherited from sofa::component::topology::PointSetGeometryAlgorithms< DataTypes >
 SOFA_CLASS (SOFA_TEMPLATE(PointSetGeometryAlgorithms, DataTypes), core::topology::GeometryAlgorithms)
 
Angle computeAngle (PointID ind_p0, PointID ind_p1, PointID ind_p2) const
 
void init () override
 
void reinit () override
 
void draw (const core::visual::VisualParams *vparams) override
 
Coord getPointSetCenter () const
 
void getEnclosingSphere (Coord &center, Real &radius) const
 
void getAABB (Real bb[6]) const
 
void getAABB (CPos &minCoord, CPos &maxCoord) const
 Returns the axis aligned bounding box. More...
 
const CoordgetPointPosition (const PointID pointId) const
 
const CoordgetPointRestPosition (const PointID pointId) const
 
sofa::core::behavior::MechanicalState< DataTypes > * getDOF () const
 Returns the object where the mechanical DOFs are stored. More...
 
float getIndicesScale () const
 
void initPointsAdded (const helper::vector< unsigned int > &indices, const helper::vector< core::topology::PointAncestorElem > &ancestorElems, const helper::vector< core::VecCoordId > &coordVecs, const helper::vector< core::VecDerivId > &derivVecs) override
 Called by the MechanicalObject state change callback to initialize added points according to the topology (topology element & local coordinates) More...
 

Protected Member Functions

 QuadSetGeometryAlgorithms ()
 
virtual ~QuadSetGeometryAlgorithms ()
 
- Protected Member Functions inherited from sofa::component::topology::EdgeSetGeometryAlgorithms< DataTypes >
 EdgeSetGeometryAlgorithms ()
 
 ~EdgeSetGeometryAlgorithms () override
 
void defineEdgeCubaturePoints ()
 
- Protected Member Functions inherited from sofa::component::topology::PointSetGeometryAlgorithms< DataTypes >
 PointSetGeometryAlgorithms ()
 
 ~PointSetGeometryAlgorithms () override
 

Additional Inherited Members

- Static Public Member Functions inherited from sofa::component::topology::PointSetGeometryAlgorithms< DataTypes >
template<class T >
static bool canCreate (T *&obj, core::objectmodel::BaseContext *context, core::objectmodel::BaseObjectDescription *arg)
 

Attribute details

template<class DataTypes>
Data<sofa::helper::types::RGBAColor> sofa::component::topology::QuadSetGeometryAlgorithms< DataTypes >::_drawColor
protected

RGB code color used to draw quads.

template<class DataTypes>
Data<bool> sofa::component::topology::QuadSetGeometryAlgorithms< DataTypes >::_drawQuads
protected

if true, draw the quads in the topology

template<class DataTypes>
Data<bool> sofa::component::topology::QuadSetGeometryAlgorithms< DataTypes >::showQuadIndices
protected

Debug : view Quad indices.

Constructor details

template<class DataTypes>
sofa::component::topology::QuadSetGeometryAlgorithms< DataTypes >::QuadSetGeometryAlgorithms ( )
inlineprotected
template<class DataTypes>
virtual sofa::component::topology::QuadSetGeometryAlgorithms< DataTypes >::~QuadSetGeometryAlgorithms ( )
inlineprotectedvirtual

Function details

template<class DataTypes >
void sofa::component::topology::QuadSetGeometryAlgorithms< DataTypes >::computeQuadAABB ( const QuadID  i,
Coord minCoord,
Coord maxCoord 
) const
template<class DataTypes >
DataTypes::Real sofa::component::topology::QuadSetGeometryAlgorithms< DataTypes >::computeQuadArea ( const QuadID  i) const

Computes the area of quad no i and returns it.

template<class DataTypes >
void sofa::component::topology::QuadSetGeometryAlgorithms< DataTypes >::computeQuadArea ( BasicArrayInterface< Real > &  ai) const

Computes the quad area of all quads are store in the array interface.

template<class DataTypes >
DataTypes::Coord sofa::component::topology::QuadSetGeometryAlgorithms< DataTypes >::computeQuadCenter ( const QuadID  i) const
template<class DataTypes >
sofa::defaulttype::Vec< 3, double > sofa::component::topology::QuadSetGeometryAlgorithms< DataTypes >::computeQuadNormal ( const QuadID  ind_q) const

Computes the normal vector of a quad indexed by ind_q (not normed)

template<class DataTypes >
DataTypes::Real sofa::component::topology::QuadSetGeometryAlgorithms< DataTypes >::computeRestQuadArea ( const QuadID  i) const

Computes the initial area of quad no i and returns it.

template<class DataTypes >
void sofa::component::topology::QuadSetGeometryAlgorithms< DataTypes >::draw ( const core::visual::VisualParams vparams)
override
template<class DataTypes >
void sofa::component::topology::QuadSetGeometryAlgorithms< DataTypes >::getQuadVertexCoordinates ( const QuadID  i,
Coord  pnt[4] 
) const
template<class DataTypes >
void sofa::component::topology::QuadSetGeometryAlgorithms< DataTypes >::getRestQuadVertexCoordinates ( const QuadID  i,
Coord  pnt[4] 
) const
template<class DataTypes >
bool sofa::component::topology::QuadSetGeometryAlgorithms< DataTypes >::isPointInQuad ( const QuadID  ind_q,
const sofa::defaulttype::Vec< 3, Real > &  p 
) const
template<class DataTypes>
bool sofa::component::topology::QuadSetGeometryAlgorithms< DataTypes >::isQuadInPlane ( const QuadID  ind_q,
const PointID  ind_p,
const defaulttype::Vec< 3, Real > &  plane_vect 
) const

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

template<class DataTypes>
sofa::component::topology::QuadSetGeometryAlgorithms< DataTypes >::SOFA_CLASS ( SOFA_TEMPLATE(QuadSetGeometryAlgorithms< DataTypes >, DataTypes)  ,
SOFA_TEMPLATE(EdgeSetGeometryAlgorithms, DataTypes)   
)
template<typename DataTypes >
void sofa::component::topology::QuadSetGeometryAlgorithms< DataTypes >::writeMSHfile ( const char *  filename) const

Write the current mesh into a msh file.