Build a triangle cell. More...
#include <MeshVizXLM/mesh/cell/MbTriangleCell.h>
Public Member Functions | |
MbTriangleCell (size_t n0, size_t n1, size_t n2) | |
virtual size_t | getNumEdges () const |
virtual size_t | getNumNodes () const |
virtual size_t | getNodeIndex (size_t nod) const |
virtual double | getRelativeSize (const MiGeometryI *meshGeometry) const |
virtual bool | isPointInsideCell (const MiGeometryI &meshGeometry, const MbVec3d &point, std::vector< double > &weights) const |
MbTriangleCell::MbTriangleCell | ( | size_t | n0, | |
size_t | n1, | |||
size_t | n2 | |||
) |
Construct a triangle defined by its list of indices.
virtual size_t MbTriangleCell::getNodeIndex | ( | size_t | nod | ) | const [inline, virtual] |
Gets a node id of this cell.
For instance getNodeIndex(0) returns the first node id of this cell.
nod | must be in the interval [0-2] |
Implements MiCell.
virtual size_t MbTriangleCell::getNumEdges | ( | ) | const [virtual] |
Gets the number of edges.
virtual size_t MbTriangleCell::getNumNodes | ( | ) | const [virtual] |
Gets the number of nodes.
Implements MiCell.
virtual double MbTriangleCell::getRelativeSize | ( | const MiGeometryI * | meshGeometry | ) | const [inline, virtual] |
Gets the relative size of the cell.
This method is used only by the MoMeshCellShape to display node names if using the relative offset feature and the streamline extraction to adapt the step integration to the size of the cell. getRelativeSize() should return a value depending on the size of the cell even if the default implementation returns 1. For instance, getRelativeSize() can return the length of the longest edge of this cell, or the length of its diagonal.
If getRelativeSize() returns a constant value for any cell, the stream line extraction uses a constant number of step integration anywhere in the mesh. Returning a constant implies that all the cells are supposed to have the same size. getRelativeSize() must not return 0.
[in] | meshGeometry | the geometry of the mesh. Used to retrieve the node coordinates of this cell. |
Reimplemented from MiCell.
virtual bool MbTriangleCell::isPointInsideCell | ( | const MiGeometryI & | meshGeometry, | |
const MbVec3d & | point, | |||
std::vector< double > & | weights | |||
) | const [inline, virtual] |
Checks if a point is inside or outside a cell.
This method is not pure virtual because it is not used by all extraction classes. However using an extraction class that uses this method (i.e. streamline) will generate an exception. An application does not need to override this method if no such extraction class is used.
[in] | meshGeometry | The geometry of the mesh. Used to retrieve the node coordinates of this cell. |
[in] | point | The point to be checked. |
[out] | weights | Must contain at least as many elements as the number of nodes in this cell (see getWeight()). |
weight[i] = wi
Reimplemented from MiCell.