Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
PbIndexedMesh3D Class Reference

MeshViz Defines a volume mesh of polyhedrons. More...

#include <MeshViz/3Ddata/PbIndexedMesh3D.h>

+ Inheritance diagram for PbIndexedMesh3D:

Public Member Functions

 PbIndexedMesh3D (SbBool is_data_duplicate=TRUE)
 Constructor of a default simple mesh.
 
 PbIndexedMesh3D (const PbIndexedMesh3D &mesh)
 Copy constructor.
 
 PbIndexedMesh3D (int num_nodes, const float *x_nod, const float *y_nod, const float *z_nod, int num_cells, const int *cell_index, const int *cell_type, SbBool is_data_duplicate=TRUE)
 Constructor of a 3D volume mesh.
 
 ~PbIndexedMesh3D ()
 Destructor.
 
PbIndexedMesh3Doperator= (const PbIndexedMesh3D &mesh)
 Assignment operator.
 
void setGeometry (int num_nodes, const float *x_nod, const float *y_nod, const float *z_nod, int num_cells, const int *cell_index, const int *cell_type)
 Sets a new geometry.
 
void setCoordinates (const float *x_nod, const float *y_nod, const float *z_nod)
 Set new node coordinates without modifying the mesh topology.
 
void getCoordinates (const float *&xnod, const float *&ynod, const float *&znod, int &size_xnod, int &size_ynod, int &size_znod) const
 Get the current coordinates of the nodes of this mesh.
 
void getGeometry (int &num_nodes, const float *&x_nod, const float *&y_nod, const float *&z_nod, int &num_cells, const int *&cell_index, const int *&cell_type) const
 Gets the current mesh geometry.
 
void getNodes (int &num_nodes, const float *&x_nod, const float *&y_nod, const float *&z_nod) const
 Gets the mesh nodes coordinate arrays.
 
virtual SbVec3f getNodeCoord (int nod_index) const
 Gets the coordinates of a node.
 
virtual void getNodeOwnerCellsInd (int nod_index, PbArrayOfInt &owner_cells) const
 Gets the list of index of cells that own the node "nod_index".
 
virtual const PbCellgetCell (int cell_index) const
 Gets the cell which index is cell_index.
 
- Public Member Functions inherited from PbMesh3D
virtual float getVolume () const
 Gets the volume of the mesh.
 
virtual float getArea () const
 Returns always 0.
 
- Public Member Functions inherited from PbMesh
 PbMesh (SbBool is_data_duplicated=TRUE)
 Constructor.
 
 PbMesh (const PbMesh &mesh)
 Copy constructor.
 
 ~PbMesh ()
 Destructor.
 
PbMeshoperator= (const PbMesh &mesh)
 Assignment operator.
 
int getNumNodes () const
 Gets the number of nodes in the mesh.
 
int getNumCells () const
 Gets the number of cells in the mesh.
 
SbBox3f getBoundingBox () const
 Gets the bounding box of the mesh.
 
SbBool isDataDuplicated () const
 Returns TRUE if mesh's data are duplicated, FALSE otherwise.
 
virtual void addValuesSet (int set_index, const float *val, const SbString &set_name="")
 Adds a set of scalar values.
 
void addValuesSet (int set_index, const float *val, DataBinding binding, const SbString &set_name="")
 Adds a set of scalar values that can be located either at nodes or at cells.
 
DataBinding getValuesBinding (int set_index) const
 Gets the binding of the scalar value set.
 
virtual void addStringsSet (int set_index, const SbString *val, const SbString &set_name="")
 Adds a set of string values .
 
virtual void addVecsSet (int set_index, const SbVec3f *val, const SbString &set_name="")
 Adds a set of vector values .
 
virtual const SbStringgetValuesSetName (int set_index) const
 Gets the name associated to a scalar values set.
 
virtual const SbStringgetStringsSetName (int set_index) const
 Gets the name associated to a string values set.
 
virtual const SbStringgetVecsSetName (int set_index) const
 Gets the name associated to a vec values set.
 
virtual const float * getValuesSet (int set_index) const
 Gets a set of scalar values.
 
virtual const SbStringgetStringsSet (int set_index) const
 Gets a set of string values.
 
virtual const SbVec3fgetVecsSet (int set_index) const
 Gets a set of vector values.
 
virtual SbBool removeValuesSet (int set_index)
 Remove a set of scalar values.
 
virtual SbBool removeStringsSet (int set_index)
 Remove a set of string values.
 
virtual SbBool removeVecsSet (int set_index)
 Remove a set of vector values.
 
virtual void removeAllValuesSet ()
 Remove all sets of scalar values.
 
virtual void removeAllStringsSet ()
 Remove all sets of strings values.
 
virtual void removeAllVecsSet ()
 Remove all sets of vector values.
 
virtual int getNumValuesSet () const
 Gets the number of set of scalar values.
 
virtual int getNumStringsSet () const
 Gets the number of set of string values.
 
virtual int getNumVecsSet () const
 Gets the number of set of vector values.
 
virtual SbBool getMinValuesSet (int set_index, float &min) const
 Gets the min of a set of scalars.
 
virtual SbBool getMinVecsSet (int set_index, float &min) const
 Gets the min module of a set of vectors.
 
virtual SbBool getMaxValuesSet (int set_index, float &max) const
 Gets the max of a set of scalars.
 
virtual SbBool getMaxVecsSet (int set_index, float &max) const
 Gets the max module of a set of vectors.
 
virtual void getNodesOwnerCellsInd (const PbArrayOfInt &nod_indices, PbArrayOfInt &owner_cells) const
 Gets the list of indices of cells that own the list of nodes "nod_indices".
 
virtual void getAdjacentCellsIndByNode (int cell_index, PbArrayOfInt &adjacent_cells) const
 Gets the list of indices of cells that are adjacent (by a node) to cell_index.
 
virtual void getAdjacentCellsIndByFacet (int cell_index, PbArrayOfInt &adjacent_cells) const
 Gets the list of indices of cells that are adjacent (by a facet) to cell_index.
 
virtual SbBox3f getSmallestCellBox (int &cell_index) const
 Gets the smallest cell's bounding box, returns also the index of this cell.
 
virtual SbBox3f getBiggestCellBox (int &cell_index) const
 Gets the biggest cell's bounding box, returns also the index of this cell.
 
virtual const PbCellfindContainingCell (const SbVec3f &point, float tolerance, SbVec3f &pcoord, const PbCell *adjacent_cell) const
 
virtual const PbCellfindContainingCell (const SbVec3f &point, float tolerance, SbVec3f &pcoord) const
 Find the cell that contains the point.
 
- Public Member Functions inherited from PbBase
void enableConnection (SbBool flag)
 Activates/deactivates the mechanism of connection.
 
SbBool isConnectionEnabled () const
 Returns TRUE if the connection mechanism is active, otherwise FALSE.
 
void touch ()
 Simulates the changing of an instance of this object, so all connected objects are informed of this change.
 
PbBaseoperator= (const PbBase &base)
 Assignment operator.
 

Friends

int operator== (const PbIndexedMesh3D &m1, const PbIndexedMesh3D &m2)
 Equality comparison operator.
 
int operator!= (const PbIndexedMesh3D &m1, const PbIndexedMesh3D &m2)
 Inequality comparison operator.
 

Additional Inherited Members

- Public Types inherited from PbMesh
enum  DataBinding {
  PER_CELL = PoMeshProperty::PER_CELL ,
  PER_NODE = PoMeshProperty::PER_NODE
}
 Data binding. More...
 

Detailed Description

MeshViz Defines a volume mesh of polyhedrons.

Class to define an indexed 3D mesh. Each cell of this type of mesh is a polyhedron with 4, 5, 6 or 8 nodes. Each polyhedron is defined by a list of node indices.

The nodes coordinates are defined by 3 arrays x_nod, y_nod, z_nod of num_nodes floats. The cells are defined by the array cell_type (size num_cells) and cell_index. cell_type[n] defines the number of nodes in the n-th cells: if cell_type[i] = 4, the i-th cell is a tetrahedron, if cell_type[i] = 5 it is a pyramid, if cell_type[i] = 6 it is a prism, and if cell_type[i] = 8 it is an hexahedron. cell_index is an array of S integers, where S = cell_type[0] + cell_type[1] + ... + cell_type[num_nodes - 1]. cell_index contains the num_cells lists of node indices which define each cell topology.

Each facet of a cell may have 2 references in the mesh, that is, one facet is common to 2 cells. The facets which are referred to once in the mesh define the mesh skin.

The values on the mesh nodes are defined by the PbMesh::addValuesSet(set_index,val) method, where val argument is an array of num_nodes floats.

Definition at line 63 of file PbIndexedMesh3D.h.

Constructor & Destructor Documentation

◆ PbIndexedMesh3D() [1/3]

PbIndexedMesh3D::PbIndexedMesh3D ( SbBool  is_data_duplicate = TRUE)

Constructor of a default simple mesh.

See also PbMesh for more explanations about data duplication.

◆ PbIndexedMesh3D() [2/3]

PbIndexedMesh3D::PbIndexedMesh3D ( const PbIndexedMesh3D mesh)

Copy constructor.

◆ PbIndexedMesh3D() [3/3]

PbIndexedMesh3D::PbIndexedMesh3D ( int  num_nodes,
const float *  x_nod,
const float *  y_nod,
const float *  z_nod,
int  num_cells,
const int *  cell_index,
const int *  cell_type,
SbBool  is_data_duplicate = TRUE 
)

Constructor of a 3D volume mesh.

See also PbMesh for more explanations about data duplication.

◆ ~PbIndexedMesh3D()

PbIndexedMesh3D::~PbIndexedMesh3D ( )

Destructor.

Member Function Documentation

◆ getCell()

virtual const PbCell * PbIndexedMesh3D::getCell ( int  cell_index) const
virtual

Gets the cell which index is cell_index.

Returns NULL if the cell does not exist or if it is incorrect (ie flat tetrahedron). Attention! this method returns always the same adress of an internal private cell. This private cell is updated each time getCell is called.

Implements PbMesh.

Reimplemented in PbHexahedronMesh3D, and PbTetrahedronMesh3D.

◆ getCoordinates()

void PbIndexedMesh3D::getCoordinates ( const float *&  xnod,
const float *&  ynod,
const float *&  znod,
int &  size_xnod,
int &  size_ynod,
int &  size_znod 
) const
inlinevirtual

Get the current coordinates of the nodes of this mesh.

Parameters
xnodarray of x coord
ynodarray of y coord
znodarray of z coord
size_xnodsize of the array xnod
size_ynodsize of the array ynod
size_znodsize of the array znod

Reimplemented from PbMesh.

Definition at line 132 of file PbIndexedMesh3D.h.

◆ getGeometry()

void PbIndexedMesh3D::getGeometry ( int &  num_nodes,
const float *&  x_nod,
const float *&  y_nod,
const float *&  z_nod,
int &  num_cells,
const int *&  cell_index,
const int *&  cell_type 
) const

Gets the current mesh geometry.

◆ getNodeCoord()

virtual SbVec3f PbIndexedMesh3D::getNodeCoord ( int  nod_index) const
inlinevirtual

Gets the coordinates of a node.

Implements PbMesh.

Definition at line 158 of file PbIndexedMesh3D.h.

◆ getNodeOwnerCellsInd()

virtual void PbIndexedMesh3D::getNodeOwnerCellsInd ( int  nod_index,
PbArrayOfInt owner_cells 
) const
virtual

Gets the list of index of cells that own the node "nod_index".

Implements PbMesh.

◆ getNodes()

void PbIndexedMesh3D::getNodes ( int &  num_nodes,
const float *&  x_nod,
const float *&  y_nod,
const float *&  z_nod 
) const

Gets the mesh nodes coordinate arrays.

◆ operator=()

PbIndexedMesh3D & PbIndexedMesh3D::operator= ( const PbIndexedMesh3D mesh)

Assignment operator.

◆ setCoordinates()

void PbIndexedMesh3D::setCoordinates ( const float *  x_nod,
const float *  y_nod,
const float *  z_nod 
)
virtual

Set new node coordinates without modifying the mesh topology.

For performance reasons, this method should be called instead of setGeometry when doing a mesh deformation animation. It allows to update the coordinates of a existing level surface, skin, cross section etc, without rebuilding them totally.

Reimplemented from PbMesh.

◆ setGeometry()

void PbIndexedMesh3D::setGeometry ( int  num_nodes,
const float *  x_nod,
const float *  y_nod,
const float *  z_nod,
int  num_cells,
const int *  cell_index,
const int *  cell_type 
)

Sets a new geometry.

Friends And Related Symbol Documentation

◆ operator!=

int operator!= ( const PbIndexedMesh3D m1,
const PbIndexedMesh3D m2 
)
friend

Inequality comparison operator.

Definition at line 106 of file PbIndexedMesh3D.h.

◆ operator==

int operator== ( const PbIndexedMesh3D m1,
const PbIndexedMesh3D m2 
)
friend

Equality comparison operator.


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