Open Inventor Release 2024.1.0
 
Loading...
Searching...
No Matches
PbParalCartesianGrid3D Class Reference

MeshViz Defines a parallel cartesian grid volume mesh. More...

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

+ Inheritance diagram for PbParalCartesianGrid3D:

Public Member Functions

 PbParalCartesianGrid3D (SbBool isDataDuplicate=TRUE)
 Constructor of a default simple mesh.
 
 PbParalCartesianGrid3D (const PbParalCartesianGrid3D &)
 Copy constructor.
 
 PbParalCartesianGrid3D (int num_x, int num_y, int num_z, const float *xnod, const float *ynod, const float *znod, SbBool isDataDuplicate=TRUE)
 Constructor of a 3D parallel grid mesh.
 
 ~PbParalCartesianGrid3D ()
 Destructor.
 
PbParalCartesianGrid3Doperator= (const PbParalCartesianGrid3D &mesh)
 Assignment operator.
 
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 mesh's cell that contains the point.
 
virtual const PbCellgetCell (int cell_index) const
 Gets the cell which index is cell_index.
 
virtual SbVec3f getNodeCoord (int nod_index) const
 Gets the coordinates of a node.
 
virtual SbVec3f getNodeCoord (int i, int j, int k) const
 Gets the coordinates of a node defined by its i,j,k indices on the grid.
 
virtual float getVolume () const
 Gets the volume of the mesh.
 
void setCoordinates (const float *xnod, const float *ynod, const float *znod)
 Set new node coordinates without modifying the mesh topology.
 
void getCoordinates (const float *&xnod, const float *&ynod, const float *&znod, int &num_x, int &num_y, int &num_z) const
 Get the current coordinates of the nodes of this mesh.
 
- Public Member Functions inherited from PbCartesianGrid3D
 PbCartesianGrid3D (SbBool is_data_duplicated=TRUE)
 Constructor.
 
 PbCartesianGrid3D (const PbCartesianGrid3D &)
 Copy constructor.
 
 PbCartesianGrid3D (int num_x, int num_y, int num_z, const float *xnod, const float *ynod, const float *znod, SbBool is_data_duplicated=TRUE)
 Constructor of a volume mesh.
 
 ~PbCartesianGrid3D ()
 Destructor.
 
PbCartesianGrid3Doperator= (const PbCartesianGrid3D &mesh)
 Assignment operator.
 
void getGeometry (int &num_x, int &num_y, int &num_z, const float ***&xa, const float ***&ya, const float ***&za) const
 Gets the mesh geometry.
 
void getGeometry (int &num_x, int &num_y, int &num_z, const float *&x, const float *&y, const float *&z) const
 Gets the mesh geometry.
 
- Public Member Functions inherited from PbGrid3D
 PbGrid3D (SbBool is_data_duplicate=TRUE)
 Constructor.
 
 PbGrid3D (const PbGrid3D &mesh)
 Copy constructor.
 
 ~PbGrid3D ()
 Destructor.
 
PbGrid3Doperator= (const PbGrid3D &mesh)
 Assignment operator.
 
void setGeometry (int num_x, int num_y, int num_z, const float *x, const float *y, const float *z)
 Defines a volume mesh geometry.
 
void getGeometry (int &num_x, int &num_y, int &num_z, const float *&x, const float *&y, const float *&z) const
 Gets the mesh geometry.
 
void getDim (int &num_x, int &num_y, int &num_z) const
 Gets the dimensions num_x, num_y, num_z of the grid.
 
virtual void getNodeOwnerCellsInd (int nod_index, PbArrayOfInt &owner_cells) const
 Gets the list of index of cells that own the node "nod_index".
 
virtual void getAdjacentCellsIndByNode (int cell_index, PbArrayOfInt &adjacent_cells) const
 Gets the list of index 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 index of cells that are adjacent (by a facet) to cell_index.
 
void getNodeIndices (int nod_index, int &i, int &j, int &k) const
 Calculates indices i,j,k that verify (i*num_y + j)*num_z + k.
 
void getCellIndices (int cell_index, int &i, int &j, int &k) const
 Calculates indices i,j,k that verify cell_index = (i*(num_y-1) + j)*(num_z-1) + k.
 
- Public Member Functions inherited from PbMesh3D
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 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.
 
- 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 PbParalCartesianGrid3D &m1, const PbParalCartesianGrid3D &m2)
 Equality comparison operator.
 
int operator!= (const PbParalCartesianGrid3D &m1, const PbParalCartesianGrid3D &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 parallel cartesian grid volume mesh.

Class to define a volume mesh represented by a grid, with cartesian coordinates, where the lines are parallel to X, Y or Z axis. This mesh is defined by num_x lines orthogonal to X axis, num_y lines orthogonal to Y axis and num_z lines orthogonal to Z axis, and by one or two values at each vertices of the mesh. This mesh is comparable to a set of parallel PbParalCartesianGrid2D. x is an array of num_x floats, y an array of num_y floats, and z an array of num_z floats.

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

Definition at line 49 of file PbParalCartesianGrid3D.h.

Constructor & Destructor Documentation

◆ PbParalCartesianGrid3D() [1/3]

PbParalCartesianGrid3D::PbParalCartesianGrid3D ( SbBool  isDataDuplicate = TRUE)

Constructor of a default simple mesh.

See also PbMesh for more explanations about data duplication.

◆ PbParalCartesianGrid3D() [2/3]

PbParalCartesianGrid3D::PbParalCartesianGrid3D ( const PbParalCartesianGrid3D )

Copy constructor.

◆ PbParalCartesianGrid3D() [3/3]

PbParalCartesianGrid3D::PbParalCartesianGrid3D ( int  num_x,
int  num_y,
int  num_z,
const float *  xnod,
const float *  ynod,
const float *  znod,
SbBool  isDataDuplicate = TRUE 
)

Constructor of a 3D parallel grid mesh.

See also PbMesh for more explanations about data duplication.

◆ ~PbParalCartesianGrid3D()

PbParalCartesianGrid3D::~PbParalCartesianGrid3D ( )

Destructor.

Member Function Documentation

◆ findContainingCell() [1/2]

virtual const PbCell * PbParalCartesianGrid3D::findContainingCell ( const SbVec3f point,
float  tolerance,
SbVec3f pcoord 
) const
virtual

Find the mesh's cell that contains the point.

If the (optional) adjacent cell is given, searching the containing cell starts by the cells around this adjacent one. Returns also the parametric coordinates of the point in the found cell. Parametric coordinates are the coordinates of the point relative to a topologically equivalent unit cell. A point is inside a cell if its parametric coordinates range from 0 to 1. However we use a test with a tolerance value: a point is inside the cell if its parametric coordinates p verify -tolerance <= p <= 1+tolerance. Parametric coordinates are useful to interpolate the value in the cell (see PbCell::getValue). Attention! This method returns always the same address of an internal private cell. This private cell is updated each time findContainingCell is called. If the cell exists, it returns always a PbVoxelCell object.

Reimplemented from PbMesh.

◆ findContainingCell() [2/2]

virtual const PbCell * PbParalCartesianGrid3D::findContainingCell ( const SbVec3f point,
float  tolerance,
SbVec3f pcoord,
const PbCell adjacent_cell 
) const
virtual

Reimplemented from PbMesh.

◆ getCell()

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

Gets the cell which index is cell_index.

Returns NULL if the cell does not exist, otherwise returns always a PbVoxelCell object. Attention! This method returns always the same address of an internal private cell. This private cell is updated each time getCell is called.

Reimplemented from PbCartesianGrid3D.

◆ getCoordinates()

void PbParalCartesianGrid3D::getCoordinates ( const float *&  xnod,
const float *&  ynod,
const float *&  znod,
int &  num_x,
int &  num_y,
int &  num_z 
) 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
num_x: size of the array xnod
num_y: size of the array ynod
num_z: size of the array znod

Reimplemented from PbCartesianGrid3D.

Definition at line 149 of file PbParalCartesianGrid3D.h.

◆ getNodeCoord() [1/2]

virtual SbVec3f PbParalCartesianGrid3D::getNodeCoord ( int  i,
int  j,
int  k 
) const
inlinevirtual

Gets the coordinates of a node defined by its i,j,k indices on the grid.

Reimplemented from PbCartesianGrid3D.

Definition at line 124 of file PbParalCartesianGrid3D.h.

◆ getNodeCoord() [2/2]

virtual SbVec3f PbParalCartesianGrid3D::getNodeCoord ( int  nod_index) const
virtual

Gets the coordinates of a node.

Reimplemented from PbCartesianGrid3D.

◆ getVolume()

virtual float PbParalCartesianGrid3D::getVolume ( ) const
inlinevirtual

Gets the volume of the mesh.

Reimplemented from PbMesh3D.

Definition at line 129 of file PbParalCartesianGrid3D.h.

◆ operator=()

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

Assignment operator.

◆ setCoordinates()

void PbParalCartesianGrid3D::setCoordinates ( const float *  xnod,
const float *  ynod,
const float *  znod 
)
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 PbCartesianGrid3D.

Friends And Related Symbol Documentation

◆ operator!=

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

Inequality comparison operator.

Definition at line 88 of file PbParalCartesianGrid3D.h.

◆ operator==

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

Equality comparison operator.


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