Defines an abstract grid surface mesh. More...
#include <MeshViz/3Ddata/PbGrid2D.h>
Public Member Functions | |
PbGrid2D (SbBool is_data_duplicate=TRUE) | |
PbGrid2D (const PbGrid2D &mesh) | |
~PbGrid2D () | |
PbGrid2D & | operator= (const PbGrid2D &mesh) |
void | setGeometry (int num_x, int num_y, const float *x, const float *y) |
void | setGeometry (int num_x, int num_y, const float *x, const float *y, const float *z) |
void | getGeometry (int &num_x, int &num_y, const float *&x, const float *&y) const |
void | getGeometry (int &num_x, int &num_y, const float *&x, const float *&y, const float *&z) const |
virtual SbVec3f | getNodeCoord (int nod_index) const =0 |
virtual SbVec3f | getNodeCoord (int i, int j) const =0 |
void | getDim (int &num_x, int &num_y) const |
virtual void | getNodeOwnerCellsInd (int nod_index, PbArrayOfInt &owner_cells) const |
virtual void | getAdjacentCellsIndByNode (int cell_index, PbArrayOfInt &adjacent_cells) const |
virtual void | getAdjacentCellsIndByFacet (int cell_index, PbArrayOfInt &adjacent_cells) const |
void | getNodeIndices (int nod_index, int &i, int &j) const |
void | getCellIndices (int cell_index, int &i, int &j) const |
This class defines a mesh of which topology is a regular grid made of num_x * num_y nodes. Each node with index (i, j) in the mesh (except for points along the mesh border) is connected to four points with indices (i+1,j), (i,j+1), (i-1,j), (i,j-1).
The values on the mesh nodes are defined by the PbMesh::addValuesSet() method, where val argument is an array of num_x * num_y floats.
PbGrid2D::PbGrid2D | ( | SbBool | is_data_duplicate = TRUE |
) | [inline] |
Constructor.
See also PbMesh for more explanations about data duplication.
PbGrid2D::PbGrid2D | ( | const PbGrid2D & | mesh | ) |
Copy constructor.
PbGrid2D::~PbGrid2D | ( | ) |
Destructor.
virtual void PbGrid2D::getAdjacentCellsIndByFacet | ( | int | cell_index, | |
PbArrayOfInt & | adjacent_cells | |||
) | const [virtual] |
Gets the list of index of cells that are adjacent (by an edge) to cell_index.
Two cells are adjacent by an edge is they own at least one mesh's edge in common
Reimplemented from PbMesh.
virtual void PbGrid2D::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.
void PbGrid2D::getCellIndices | ( | int | cell_index, | |
int & | i, | |||
int & | j | |||
) | const [inline] |
Calculates indices i,j that verify cell_index = i*(num_y-1) + j.
void PbGrid2D::getDim | ( | int & | num_x, | |
int & | num_y | |||
) | const [inline] |
Gets the dimensions num_x, num_y of the grid.
void PbGrid2D::getGeometry | ( | int & | num_x, | |
int & | num_y, | |||
const float *& | x, | |||
const float *& | y, | |||
const float *& | z | |||
) | const |
Gets the mesh 3D geometry.
x-y-z can be used like a vector (i.e. x[n]). Attention! For a 2D mesh, z is NULL.
void PbGrid2D::getGeometry | ( | int & | num_x, | |
int & | num_y, | |||
const float *& | x, | |||
const float *& | y | |||
) | const |
Gets the mesh 2D geometry.
x-y must be used like a vector (i.e. x[n])
virtual SbVec3f PbGrid2D::getNodeCoord | ( | int | i, | |
int | j | |||
) | const [pure virtual] |
Gets the coordinates of a node defined by its i,j indices on the grid.
Implemented in PbCartesianGrid2D, PbParalCartesianGrid2D, PbPolarGrid2D, and PbRegularCartesianGrid2D.
virtual SbVec3f PbGrid2D::getNodeCoord | ( | int | nod_index | ) | const [pure virtual] |
Gets the coordinates of a node defined by its index.
Implements PbMesh.
Implemented in PbCartesianGrid2D, PbParalCartesianGrid2D, PbPolarGrid2D, and PbRegularCartesianGrid2D.
void PbGrid2D::getNodeIndices | ( | int | nod_index, | |
int & | i, | |||
int & | j | |||
) | const [inline] |
Calculates indices i,j that verify nod_index = i*num_y + j.
virtual void PbGrid2D::getNodeOwnerCellsInd | ( | int | nod_index, | |
PbArrayOfInt & | owner_cells | |||
) | const [virtual] |
Gets the list of index of cells that own the node "nod_index".
Implements PbMesh.
Assignment operator.
Reimplemented from PbMesh2D.
Reimplemented in PbCartesianGrid2D, PbParalCartesianGrid2D, PbPolarGrid2D, and PbRegularCartesianGrid2D.
void PbGrid2D::setGeometry | ( | int | num_x, | |
int | num_y, | |||
const float * | x, | |||
const float * | y, | |||
const float * | z | |||
) |
Defines a 3D surface 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. Idem for y array. The size of z array is always num_x * num_y.
void PbGrid2D::setGeometry | ( | int | num_x, | |
int | num_y, | |||
const float * | x, | |||
const float * | y | |||
) |
Defines a 2D surface 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. Idem for y array.