Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
PbQuadrangleMesh2D Class Reference

MeshViz Defines a surface mesh of quadrangles. More...

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

+ Inheritance diagram for PbQuadrangleMesh2D:

Public Member Functions

 PbQuadrangleMesh2D (SbBool isDataDuplicate=TRUE)
 Constructor of a default simple mesh.
 
 PbQuadrangleMesh2D (const PbQuadrangleMesh2D &mesh)
 Copy constructor.
 
 PbQuadrangleMesh2D (int num_nodes, const float *x_nod, const float *y_nod, int num_quadrangles, const int32_t *quadrangle_index, SbBool isDataDuplicate=TRUE)
 Constructor of a 2D surface mesh.
 
 PbQuadrangleMesh2D (int num_nodes, const float *x_nod, const float *y_nod, const float *z_nod, int num_quadrangles, const int32_t *quadrangle_index, SbBool isDataDuplicate=TRUE)
 Constructor of a 3D surface mesh.
 
 ~PbQuadrangleMesh2D ()
 Destructor.
 
PbQuadrangleMesh2Doperator= (const PbQuadrangleMesh2D &mesh)
 Assignment operator.
 
void setGeometry (int num_nodes, const float *x_nod, const float *y_nod, int num_quadrangles, const int *quadrangle_index)
 Sets a new 2D geometry.
 
void setGeometry (int num_nodes, const float *x_nod, const float *y_nod, const float *z_nod, int num_quadrangles, const int *quadrangle_index)
 Sets a new 3D geometry.
 
void getGeometry (int &num_nodes, const float *&x_nod, const float *&y_nod, int &num_quadrangles, const int32_t *&quadrangle_index) const
 Gets the current mesh geometry (x, y nodes coordinates).
 
void getGeometry (int &num_nodes, const float *&x_nod, const float *&y_nod, const float *&z_nod, int &num_quadrangles, const int32_t *&quadrangle_index) const
 Gets the current mesh geometry (x, y and z nodes coordinates).
 
void getGeometry (int &num_nodes, const float *&x_nod, const float *&y_nod, int &num_quadrangles, const int32_t **&quadrangle_index) const
 Gets the current mesh geometry (x, y nodes coordinates).
 
void getGeometry (int &num_nodes, const float *&x_nod, const float *&y_nod, const float *&z_nod, int &num_quadrangles, const int32_t **&quadrangle_index) const
 Gets the current mesh geometry (x, y and z nodes coordinates).
 
virtual void getNodesOwnerCellsInd (const PbArrayOfInt &nod_indices, 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.
 
virtual void setElemOrientation (ElemOrientation elem_orient)
 Changes orientation of cells during visualization of 2D surface mesh.
 
- Public Member Functions inherited from PbIndexedMesh2D
 PbIndexedMesh2D (SbBool is_data_duplicate=TRUE)
 Constructor of a default simple mesh.
 
 PbIndexedMesh2D (const PbIndexedMesh2D &mesh)
 Copy constructor.
 
 PbIndexedMesh2D (int num_nodes, const float *x_nod, const float *y_nod, int num_cells, const int *cell_index, const int *cell_type, SbBool is_data_duplicate=TRUE)
 Constructor of a 2D surface mesh.
 
 PbIndexedMesh2D (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 surface mesh.
 
 ~PbIndexedMesh2D ()
 Destructor.
 
PbIndexedMesh2Doperator= (const PbIndexedMesh2D &mesh)
 Assignment operator.
 
void setGeometry (int num_nodes, const float *x_nod, const float *y_nod, int num_cells, const int *cell_index, const int *cell_type)
 Sets a new 2D geometry.
 
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 3D geometry.
 
void getGeometry (int &numNode, const float *&x_nod, const float *&y_nod, const float *&z_nod, int &num_cells, const int32_t *&cell_index, const int32_t *&cell_type) const
 Gets the current mesh geometry (x, y and z nodes coordinates).
 
void getGeometry (int &numNode, const float *&x_nod, const float *&y_nod, int &num_cells, const int32_t *&cell_index, const int32_t *&cell_type) const
 Gets the current mesh geometry (x, y nodes coordinates).
 
void getNodes (int &num_nodes, const float *&x_nod, const float *&y_nod, const float *&z_nod) const
 Gets the mesh nodes coordinates (x,y,z coordinates)
 
void getNodes (int &num_nodes, const float *&x_nod, const float *&y_nod) const
 Gets the mesh nodes coordinates (only x,y coordinates)
 
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".
 
- Public Member Functions inherited from PbMesh2D
void addVecsSet (int set_index, const SbVec2f *val, const SbString &setName="")
 Adds a set of 2D vectors on the mesh.
 
virtual SbBox2f getBoundingBox () const
 Gets the 2D mesh's bounding box.
 
virtual float getVolume () const
 Always returns 0.
 
virtual float getArea () const
 Gets the area of the mesh.
 
PbMesh2DgetFaultMesh (int num_fault_lines, const int *fault_line_sizes, const SbVec3f *coord, ExtrapolationMethod extrapol_method, PbDefinedValue &definedValue) const
 Builds a new mesh by inserting some fault lines in this mesh.
 
PbMesh2DgetFaultMesh (int num_fault_lines, const int *fault_line_sizes, const SbVec3f *coord) const
 Same as calling getFaultMesh(num_fault_lines, fault_line_sizes, coord,PbMesh2D::USE_ADJACENT_DERIVS, PbDefinedValue())
 
- 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 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 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.
 
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.
 

Friends

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

Additional Inherited Members

- Public Types inherited from PbIndexedMesh2D
enum  ElemOrientation {
  ORIENTATION_AS_IS ,
  ORIENTATION_ZPOS ,
  ORIENTATION_ZNEG
}
 Cell orientation for visualization of 2D surface mesh. More...
 
- Public Types inherited from PbMesh2D
enum  ExtrapolationMethod {
  USE_ADJACENT_DERIVS ,
  USE_ADJACENT_VALUES
}
 Specifies the type of extrapolation used by getFaultMesh() when computing values on the fault lines. More...
 
- 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 surface mesh of quadrangles.

Class to define an indexed 2D mesh made up of quadrangles cells. This mesh is defined by a list of quadrangles. Each quadrangles is defined by 4 indices of nodes.

The nodes coordinates are defined by 2 (or 3) arrays x_nod, y_nod, (and z_nod) of num_nodes floats. The quadrangles are defined by the array quadrangle_index of num_quadrangles*4 integers. quadrangle_index[(n*4)+p] is the p-th node index of the n-th quadrangle of the mesh (0 <= p <= 4). Each quadrangle must be numbered by repecting the following rule : the edge linking the first and the second index must not be a diagonal of the quadrangle.

Each edge of a quadrangle may have 2 references in the mesh, that is, one edge is common to 2 quadrangles. The edges which are referred to once in the mesh define the limits of the mesh.

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 58 of file PbQuadrangleMesh2D.h.

Constructor & Destructor Documentation

◆ PbQuadrangleMesh2D() [1/4]

PbQuadrangleMesh2D::PbQuadrangleMesh2D ( SbBool  isDataDuplicate = TRUE)

Constructor of a default simple mesh.

See also PbMesh for more explanations about data duplication.

◆ PbQuadrangleMesh2D() [2/4]

PbQuadrangleMesh2D::PbQuadrangleMesh2D ( const PbQuadrangleMesh2D mesh)

Copy constructor.

◆ PbQuadrangleMesh2D() [3/4]

PbQuadrangleMesh2D::PbQuadrangleMesh2D ( int  num_nodes,
const float *  x_nod,
const float *  y_nod,
int  num_quadrangles,
const int32_t *  quadrangle_index,
SbBool  isDataDuplicate = TRUE 
)

Constructor of a 2D surface mesh.

See also PbMesh for more explanations about data duplication.

◆ PbQuadrangleMesh2D() [4/4]

PbQuadrangleMesh2D::PbQuadrangleMesh2D ( int  num_nodes,
const float *  x_nod,
const float *  y_nod,
const float *  z_nod,
int  num_quadrangles,
const int32_t *  quadrangle_index,
SbBool  isDataDuplicate = TRUE 
)

Constructor of a 3D surface mesh.

See also PbMesh for more explanations about data duplication.

◆ ~PbQuadrangleMesh2D()

PbQuadrangleMesh2D::~PbQuadrangleMesh2D ( )

Destructor.

Member Function Documentation

◆ getCell()

virtual const PbCell * PbQuadrangleMesh2D::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 PbQuadrangleCell object. Attention! this method returns always the same adress of an internal private cell. This private cell is updated each time getCell is called.

Reimplemented from PbIndexedMesh2D.

◆ getGeometry() [1/4]

void PbQuadrangleMesh2D::getGeometry ( int &  num_nodes,
const float *&  x_nod,
const float *&  y_nod,
const float *&  z_nod,
int &  num_quadrangles,
const int32_t *&  quadrangle_index 
) const

Gets the current mesh geometry (x, y and z nodes coordinates).

◆ getGeometry() [2/4]

void PbQuadrangleMesh2D::getGeometry ( int &  num_nodes,
const float *&  x_nod,
const float *&  y_nod,
const float *&  z_nod,
int &  num_quadrangles,
const int32_t **&  quadrangle_index 
) const

Gets the current mesh geometry (x, y and z nodes coordinates).

quadrangle_index must be used like a matrix. (i.e. quadrangle_index[cell_index][n], with 0 <= n <= 4)

◆ getGeometry() [3/4]

void PbQuadrangleMesh2D::getGeometry ( int &  num_nodes,
const float *&  x_nod,
const float *&  y_nod,
int &  num_quadrangles,
const int32_t *&  quadrangle_index 
) const

Gets the current mesh geometry (x, y nodes coordinates).

◆ getGeometry() [4/4]

void PbQuadrangleMesh2D::getGeometry ( int &  num_nodes,
const float *&  x_nod,
const float *&  y_nod,
int &  num_quadrangles,
const int32_t **&  quadrangle_index 
) const

Gets the current mesh geometry (x, y nodes coordinates).

quadrangle_index must be used like a matrix. (i.e. quadrangle_index[cell_index][n], with 0 <= n <= 4)

◆ getNodesOwnerCellsInd()

virtual void PbQuadrangleMesh2D::getNodesOwnerCellsInd ( const PbArrayOfInt nod_indices,
PbArrayOfInt owner_cells 
) const
virtual

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

Reimplemented from PbMesh.

◆ operator=()

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

Assignment operator.

◆ setElemOrientation()

virtual void PbQuadrangleMesh2D::setElemOrientation ( ElemOrientation  elem_orient)
virtual

Changes orientation of cells during visualization of 2D surface mesh.

The ordering of the indices of an cell defines the direction of its normal vector and so its orientation. When the mesh is visualized in 2D, the direction of the normal of an cell is either Z+ or Z-. If any cell of the mesh does not have the same orientation, it can change the representation because the lighting depends on the orientation.

Reimplemented from PbIndexedMesh2D.

◆ setGeometry() [1/2]

void PbQuadrangleMesh2D::setGeometry ( int  num_nodes,
const float *  x_nod,
const float *  y_nod,
const float *  z_nod,
int  num_quadrangles,
const int *  quadrangle_index 
)

Sets a new 3D geometry.

◆ setGeometry() [2/2]

void PbQuadrangleMesh2D::setGeometry ( int  num_nodes,
const float *  x_nod,
const float *  y_nod,
int  num_quadrangles,
const int *  quadrangle_index 
)

Sets a new 2D geometry.

Friends And Related Symbol Documentation

◆ operator!=

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

Inequality comparison operator.

Definition at line 107 of file PbQuadrangleMesh2D.h.

◆ operator==

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

Equality comparison operator.


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