PbRegularCartesianGrid3D Class Reference
[Property/Data]

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

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

Inheritance diagram for PbRegularCartesianGrid3D:
PbGrid3D PbMesh3D PbMesh PbBase

List of all members.

Public Member Functions

 PbRegularCartesianGrid3D (SbBool isDataDuplicate=TRUE)
 PbRegularCartesianGrid3D (const PbRegularCartesianGrid3D &mesh)
 PbRegularCartesianGrid3D (int num_x, int num_y, int num_z, float x_min, float y_min, float z_min, float x_max, float y_max, float z_max, SbBool isDataDuplicate=TRUE)
 ~PbRegularCartesianGrid3D ()
PbRegularCartesianGrid3Doperator= (const PbRegularCartesianGrid3D &mesh)
void setGeometry (int num_x, int num_y, int num_z, float x_min, float y_min, float z_min, float x_max, float y_max, float z_max)
void getGeometry (int &num_x, int &num_y, int &num_z, float &x_min, float &y_min, float &z_min, float &x_max, float &y_max, float &z_max) const
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
virtual const PbCellgetCell (int cell_index) const
virtual SbVec3f getNodeCoord (int nod_index) const
virtual SbVec3f getNodeCoord (int i, int j, int k) const
virtual float getVolume () const
void setCoordinates (const float *xnod, const float *ynod, const float *znod)
void getCoordinates (const float *&xnod, const float *&ynod, const float *&znod, int &size_xnod, int &size_ynod, int &size_znod) const

Friends

int operator== (const PbRegularCartesianGrid3D &m1, const PbRegularCartesianGrid3D &m2)
int operator!= (const PbRegularCartesianGrid3D &m1, const PbRegularCartesianGrid3D &m2)

Detailed Description

MeshViz Defines a regular cartesian grid volume mesh.

Class to define a volume mesh represented by a grid, with cartesian coordinates, of which the lines are parallel to X-axis, Y-axis or Z-axis. This mesh is said regular because the gap between 2 consecutive parallel lines is constant.

The geometry of such a mesh is defined by the 3 dimensions of its grid (num_x, num_y, num_z), and by its bounding box (x_min, y_min, z_min, x_max, y_max, z_max)

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.


Constructor & Destructor Documentation

PbRegularCartesianGrid3D::PbRegularCartesianGrid3D ( SbBool  isDataDuplicate = TRUE  ) 

Constructor of a default simple mesh.

See also PbMesh for more explanations about data duplication.

PbRegularCartesianGrid3D::PbRegularCartesianGrid3D ( const PbRegularCartesianGrid3D mesh  ) 

Copy constructor.

PbRegularCartesianGrid3D::PbRegularCartesianGrid3D ( int  num_x,
int  num_y,
int  num_z,
float  x_min,
float  y_min,
float  z_min,
float  x_max,
float  y_max,
float  z_max,
SbBool  isDataDuplicate = TRUE 
)

Constructor of a 3D regular grid mesh.

See also PbMesh for more explanations about data duplication.

PbRegularCartesianGrid3D::~PbRegularCartesianGrid3D (  ) 

Destructor.


Member Function Documentation

virtual const PbCell* PbRegularCartesianGrid3D::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 a PbVoxelCell.

Reimplemented from PbMesh.

virtual const PbCell* PbRegularCartesianGrid3D::findContainingCell ( const SbVec3f point,
float  tolerance,
SbVec3f pcoord,
const PbCell adjacent_cell 
) const [virtual]

Reimplemented from PbMesh.

virtual const PbCell* PbRegularCartesianGrid3D::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.

Implements PbMesh.

void PbRegularCartesianGrid3D::getCoordinates ( const float *&  xnod,
const float *&  ynod,
const float *&  znod,
int &  size_xnod,
int &  size_ynod,
int &  size_znod 
) const [inline, virtual]

Get the current coordinates of the nodes of this mesh.

Parameters:
xnod array of 2 floats, min and max x coord
ynod array of 2 floats, min and max y coord
znod array of 2 floats, min and max z coord
size_xnod : size of the array xnod = 2
size_ynod : size of the array ynod = 2
size_znod : size of the array znod = 2

Reimplemented from PbMesh.

void PbRegularCartesianGrid3D::getGeometry ( int &  num_x,
int &  num_y,
int &  num_z,
float &  x_min,
float &  y_min,
float &  z_min,
float &  x_max,
float &  y_max,
float &  z_max 
) const [inline]

Gets the mesh geometry.

virtual SbVec3f PbRegularCartesianGrid3D::getNodeCoord ( int  i,
int  j,
int  k 
) const [inline, virtual]

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

Implements PbGrid3D.

virtual SbVec3f PbRegularCartesianGrid3D::getNodeCoord ( int  nod_index  )  const [virtual]

Gets the coordinates of a node defined by its index.

Implements PbGrid3D.

virtual float PbRegularCartesianGrid3D::getVolume (  )  const [inline, virtual]

Gets the volume of the mesh.

Reimplemented from PbMesh3D.

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

Assignment operator.

Reimplemented from PbGrid3D.

void PbRegularCartesianGrid3D::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.

Parameters:
xnod array of 2 floats, min and max x coord
ynod array of 2 floats, min and max y coord
znod array of 2 floats, min and max z coord

Reimplemented from PbMesh.

void PbRegularCartesianGrid3D::setGeometry ( int  num_x,
int  num_y,
int  num_z,
float  x_min,
float  y_min,
float  z_min,
float  x_max,
float  y_max,
float  z_max 
)

Defines a new geometry.


Friends And Related Function Documentation

int operator!= ( const PbRegularCartesianGrid3D m1,
const PbRegularCartesianGrid3D m2 
) [friend]

Inequality comparison operator.

int operator== ( const PbRegularCartesianGrid3D m1,
const PbRegularCartesianGrid3D m2 
) [friend]

Equality comparison operator.


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

Open Inventor Toolkit reference manual, generated on 15 Mar 2023
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/