Utility class for polyhedron cells. More...
#include <MeshVizXLM/extractors/MxPolyhedronCellExtract.h>
Static Public Member Functions | |
static void | getWeight (const MiGeometryI &meshGeometry, const MiVolumeCell *polyhedronCell, const MbVec3d &point, std::vector< double > &weights) |
static double | getLongestDistance (const MiGeometryI &meshGeometry, const MiVolumeCell *polyhedronCell) |
static double | getShortestDistance (const MiGeometryI &meshGeometry, const MiVolumeCell *polyhedronCell) |
static bool | isPointInsideCell (const MiGeometryI &meshGeometry, const MiVolumeCell *polyhedronCell, const MbVec3d &point, std::vector< double > &weights) |
static MbVec3d | getFacetNormal (size_t facet, const MiGeometryI &meshGeometry, const MiVolumeCell *polyhedronCell) |
Utility class that provides a static implementation of the MiVolumeCell's methods for a polyhedron cell. This class is provided to make easier the creation of a class that implements the MiVolumeCell interface for a polyhedron cell.
This implementation of getWeight() method assumes that a polyhedron is defined as a set of oriented polygons such that their normal is pointing to the inside ( each facet vertices are ordered in an counter-clockwise direction looking from the inside).
static MbVec3d MxPolyhedronCellExtract::getFacetNormal | ( | size_t | facet, | |
const MiGeometryI & | meshGeometry, | |||
const MiVolumeCell * | polyhedronCell | |||
) | [static] |
Computes the average normal to a planar or almost-planar polygon facet of a the given polyhedron cell.
This is done by using Newell's method.
[in] | facet | The number of the facet in the polyhedron cell. |
[in] | meshGeometry | The geometry of the mesh. |
[in] | polyhedronCell | The input cell. |
static double MxPolyhedronCellExtract::getLongestDistance | ( | const MiGeometryI & | meshGeometry, | |
const MiVolumeCell * | polyhedronCell | |||
) | [static] |
Gets the longest distance inside the given polyhedron cell.
[in] | meshGeometry | The geometry of the mesh. |
[in] | polyhedronCell | The input cell. |
static double MxPolyhedronCellExtract::getShortestDistance | ( | const MiGeometryI & | meshGeometry, | |
const MiVolumeCell * | polyhedronCell | |||
) | [static] |
Gets the shortest distance inside the given polyhedron cell.
[in] | meshGeometry | The geometry of the mesh. |
[in] | polyhedronCell | The input cell. |
static void MxPolyhedronCellExtract::getWeight | ( | const MiGeometryI & | meshGeometry, | |
const MiVolumeCell * | polyhedronCell, | |||
const MbVec3d & | point, | |||
std::vector< double > & | weights | |||
) | [static] |
Gets the barycentric weights in the given polyhedron cell of the given point.
meshGeometry.getCoord(polyhedronCell->getNodeIndex(i))
[in] | meshGeometry | The geometry of the mesh. |
[in] | polyhedronCell | The input cell. |
[in] | point | The input point given in the same space coordinate as meshGeometry. |
[out] | weights | This method computes the N values weights[0,N-1], where N=polyhedronCell->getNumNodes(). It assumes the weights vector array has been already allocated. Its size must be set to N (at least) before calling this method, using for instance the weights.resize(N) |
static bool MxPolyhedronCellExtract::isPointInsideCell | ( | const MiGeometryI & | meshGeometry, | |
const MiVolumeCell * | polyhedronCell, | |||
const MbVec3d & | point, | |||
std::vector< double > & | weights | |||
) | [static] |
Checks if a point is inside the given polyhedron cell.
All weights must be positive. This static method helps to implement the method MiCell::isPointInsideCell(meshGeometry,point,weights) for a polyhedron cell.
meshGeometry.getCoord(polyhedronCell->getNodeIndex(i))
[in] | meshGeometry | The geometry of the mesh. |
[in] | polyhedronCell | The input cell. |
[in] | point | The input point given in the same space coordinate as meshGeometry. |
[out] | weights | This method computes the N values weights[0,N-1], where N=polyhedronCell->getNumNodes(). It assumes the weights vector array has been already allocated. Its size must be set to N (at least) before calling this method, using for instance the weights.resize(N) |