Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
PbGrid3D Class Referenceabstract

MeshViz Defines an abstract grid volume mesh. More...

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

+ Inheritance diagram for PbGrid3D:

Public Member Functions

 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.
 
virtual SbVec3f getNodeCoord (int nod_index) const =0
 Gets the coordinates of a node defined by its index.
 
virtual SbVec3f getNodeCoord (int i, int j, int k) const =0
 Gets the coordinates of a node defined by its i,j,k indices on the grid.
 
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 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 const PbCellgetCell (int cell_index) const =0
 Gets the cell with index 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.
 
virtual void setCoordinates (const float *x_nod, const float *y_nod, const float *z_nod)
 Set new node coordinates without modifying the mesh topology.
 
virtual 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.
 
- 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.
 

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 an abstract grid volume mesh.

This class defines a mesh of which topology is a regular grid made of num_x

  • num_y * num_z nodes. Each node with index (i,j,k) in the mesh (except for points along the mesh border) is connected to six points with indices (i+1,j,k), (i,j+1,k), (i-1,j,k), (i,j-1,k), (i,j,k-1), (i,j,k+1).

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

Definition at line 44 of file PbGrid3D.h.

Constructor & Destructor Documentation

◆ PbGrid3D() [1/2]

PbGrid3D::PbGrid3D ( SbBool  is_data_duplicate = TRUE)
inline

Constructor.

See also PbMesh for more explanations about data duplication.

Definition at line 52 of file PbGrid3D.h.

◆ PbGrid3D() [2/2]

PbGrid3D::PbGrid3D ( const PbGrid3D mesh)

Copy constructor.

◆ ~PbGrid3D()

PbGrid3D::~PbGrid3D ( )

Destructor.

Member Function Documentation

◆ getAdjacentCellsIndByFacet()

virtual void PbGrid3D::getAdjacentCellsIndByFacet ( int  cell_index,
PbArrayOfInt adjacent_cells 
) const
virtual

Gets the list of index of cells that are adjacent (by a facet) to cell_index.

Two cells are adjacent by facet is they own at least one mesh's facet in common

Reimplemented from PbMesh.

◆ getAdjacentCellsIndByNode()

virtual void PbGrid3D::getAdjacentCellsIndByNode ( int  cell_index,
PbArrayOfInt adjacent_cells 
) const
virtual

Gets the list of index of cells that are adjacent (by a node) to cell_index.

Two cells are adjacent by a node is they own at least one mesh's node in common.

Reimplemented from PbMesh.

◆ getCellIndices()

void PbGrid3D::getCellIndices ( int  cell_index,
int &  i,
int &  j,
int &  k 
) const
inline

Calculates indices i,j,k that verify cell_index = (i*(num_y-1) + j)*(num_z-1) + k.

Definition at line 171 of file PbGrid3D.h.

◆ getDim()

void PbGrid3D::getDim ( int &  num_x,
int &  num_y,
int &  num_z 
) const
inline

Gets the dimensions num_x, num_y, num_z of the grid.

Definition at line 96 of file PbGrid3D.h.

◆ getGeometry()

void PbGrid3D::getGeometry ( int &  num_x,
int &  num_y,
int &  num_z,
const float *&  x,
const float *&  y,
const float *&  z 
) const

Gets the mesh geometry.

x-y-z must be used like a vector (i.e. x[n]).

◆ getNodeCoord() [1/2]

virtual SbVec3f PbGrid3D::getNodeCoord ( int  i,
int  j,
int  k 
) const
pure virtual

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

Implemented in PbCartesianGrid3D, PbParalCartesianGrid3D, and PbRegularCartesianGrid3D.

◆ getNodeCoord() [2/2]

virtual SbVec3f PbGrid3D::getNodeCoord ( int  nod_index) const
pure virtual

Gets the coordinates of a node defined by its index.

Implements PbMesh.

Implemented in PbCartesianGrid3D, PbParalCartesianGrid3D, and PbRegularCartesianGrid3D.

◆ getNodeIndices()

void PbGrid3D::getNodeIndices ( int  nod_index,
int &  i,
int &  j,
int &  k 
) const
inline

Calculates indices i,j,k that verify (i*num_y + j)*num_z + k.

Definition at line 160 of file PbGrid3D.h.

◆ getNodeOwnerCellsInd()

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

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

Implements PbMesh.

◆ operator=()

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

Assignment operator.

◆ setGeometry()

void PbGrid3D::setGeometry ( int  num_x,
int  num_y,
int  num_z,
const float *  x,
const float *  y,
const float *  z 
)

Defines a volume mesh geometry.

The size of the x array depends on the derived class that calls this method. It is either num_x or num_x * num_y * num_z. Idem for y and z array.


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