Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
MxPolyhedronCellExtract Class Reference

MeshViz 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)
 Gets the barycentric weights in the given polyhedron cell of the given point.
 
static double getLongestDistance (const MiGeometryI &meshGeometry, const MiVolumeCell *polyhedronCell)
 Gets the longest distance inside the given polyhedron cell.
 
static double getShortestDistance (const MiGeometryI &meshGeometry, const MiVolumeCell *polyhedronCell)
 Gets the shortest distance inside the given polyhedron cell.
 
static bool isPointInsideCell (const MiGeometryI &meshGeometry, const MiVolumeCell *polyhedronCell, const MbVec3d &point, std::vector< double > &weights)
 Checks if a point is inside the given polyhedron cell.
 
static MbVec3d getFacetNormal (size_t facet, const MiGeometryI &meshGeometry, const MiVolumeCell *polyhedronCell)
 Computes the average normal to a planar or almost-planar polygon facet of a the given polyhedron cell.
 

Detailed Description

MeshViz Utility class for polyhedron cells.

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).

Definition at line 53 of file MxPolyhedronCellExtract.h.

Member Function Documentation

◆ getFacetNormal()

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.

Parameters
[in]facetThe number of the facet in the polyhedron cell.
[in]meshGeometryThe geometry of the mesh.
[in]polyhedronCellThe input cell.

◆ getLongestDistance()

static double MxPolyhedronCellExtract::getLongestDistance ( const MiGeometryI meshGeometry,
const MiVolumeCell polyhedronCell 
)
static

Gets the longest distance inside the given polyhedron cell.

Parameters
[in]meshGeometryThe geometry of the mesh.
[in]polyhedronCellThe input cell.

◆ getShortestDistance()

static double MxPolyhedronCellExtract::getShortestDistance ( const MiGeometryI meshGeometry,
const MiVolumeCell polyhedronCell 
)
static

Gets the shortest distance inside the given polyhedron cell.

Parameters
[in]meshGeometryThe geometry of the mesh.
[in]polyhedronCellThe input cell.

◆ getWeight()

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.

Note
Each node coordinate of the given cell is retrieved in the following way:
meshGeometry.getCoord(polyhedronCell->getNodeIndex(i)) 
for each i with 0 <= i < polyhedronCell->getNumNodes()
Parameters
[in]meshGeometryThe geometry of the mesh.
[in]polyhedronCellThe input cell.
[in]pointThe input point given in the same space coordinate as meshGeometry.
[out]weightsThis 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)

◆ isPointInsideCell()

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.

Note
Each node coordinate of the given cell is retrieved in the following way:
meshGeometry.getCoord(polyhedronCell->getNodeIndex(i)) 
for each i with 0 <= i < polyhedronCell->getNumNodes()
Parameters
[in]meshGeometryThe geometry of the mesh.
[in]polyhedronCellThe input cell.
[in]pointThe input point given in the same space coordinate as meshGeometry.
[out]weightsThis 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)

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