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

MeshViz Defines an abstract surface mesh. More...

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

+ Inheritance diagram for PbMesh2D:

Public Types

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...
 

Public Member Functions

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.
 
virtual SbVec3f getNodeCoord (int nod_index) const =0
 Gets the coordinates of a node.
 
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 getNodeOwnerCellsInd (int nod_index, PbArrayOfInt &owner_cells) const =0
 Gets the list of indices of cells that own the node "nod_index".
 
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 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 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.
 

Detailed Description

MeshViz Defines an abstract surface mesh.

A surface mesh is made of polygonal cells that define a 2D or 3D surface. The topology of this mesh is either regular (see derived class PbGrid2D) or irregular (see derived class PbIndexedMesh2D).

Definition at line 54 of file PbMesh2D.h.

Member Enumeration Documentation

◆ ExtrapolationMethod

Specifies the type of extrapolation used by getFaultMesh() when computing values on the fault lines.

Enumerator
USE_ADJACENT_DERIVS 

Computes the value at a point of the fault line by using the derivatives at its adjacent nodes.

USE_ADJACENT_VALUES 

Computes the value at a point of the fault line as the average values of its adjacent nodes.

Definition at line 89 of file PbMesh2D.h.

Member Function Documentation

◆ addVecsSet()

void PbMesh2D::addVecsSet ( int  set_index,
const SbVec2f val,
const SbString setName = "" 
)

Adds a set of 2D vectors on the mesh.

set_index is the index of the set. Note that even if the isDataDuplicated field is FALSE, this set of 2D vectors is always duplicated in a PbMesh2D object. If you do not want to duplicate your vectors set, you must set is_data_duplicated to FALSE in your mesh constructor and use the method PbMesh::addVecsSet().

◆ getArea()

virtual float PbMesh2D::getArea ( ) const
virtual

Gets the area of the mesh.

Implements PbMesh.

Reimplemented in PbParalCartesianGrid2D, and PbRegularCartesianGrid2D.

◆ getBoundingBox()

virtual SbBox2f PbMesh2D::getBoundingBox ( ) const
virtual

Gets the 2D mesh's bounding box.

◆ getFaultMesh() [1/2]

PbMesh2D * PbMesh2D::getFaultMesh ( int  num_fault_lines,
const int *  fault_line_sizes,
const SbVec3f coord 
) const
inline

Same as calling getFaultMesh(num_fault_lines, fault_line_sizes, coord,PbMesh2D::USE_ADJACENT_DERIVS, PbDefinedValue())

Definition at line 155 of file PbMesh2D.h.

◆ getFaultMesh() [2/2]

PbMesh2D * PbMesh2D::getFaultMesh ( 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.

Each point of the fault line is inserted in the new mesh to cut the cells. The resulting mesh contains the fault lines as holes with "null width".

LIMITATIONS: The coordinates of the fault line must not be outside the mesh geometry. Furthemore, this method may not work correctly if the fault lines contain many segments that cross other segments or if some segments are tangent or almost tangent to other segments.

Parameters
num_fault_linesnumber of fault lines.
fault_line_sizeseach element in this array is the number of points in each line.
For instance, if fault_line_sizes = {3,5}, two fault lines are inserted; the first one has 3 points and the second one has 5 points.
coordthe coordinate of each point of the fault lines. For instance, if fault_line_sizes = {3,5}, coord must contain 8 elements. coord[0] ... coord[2] are the coordinates of the first fault line and coord[3] ... coord[7] are the coordinates of the second fault line.
LIMITATION: These coordinates must be inside the mesh.
extrapol_methodtype of extrapolation used to compute the nodes values on the fault lines. See ExtrapolationMethod
definedValueinstance of a class that is used to determine if a node has a value that should be considered as "defined" or "undefined". getFaultMesh needs to know this because only adjacent nodes with "defined" values are taken into account when computing the value of a node on the fault line. When all adjacent nodes are "undefined", the value at a point of the fault line is set to PbDefinedValue::getUndef().
The default instance of PbDefinedValue assumes all nodes are "defined" (because PbDefinedValue::operator()() returns always TRUE) and that the "undefined" value is 0 (PbDefinedValue::getUndef() returns 0). PbDefinedValue should be subclassed to change these default behaviors.
See also
PbDefinedValue

◆ getVolume()

virtual float PbMesh2D::getVolume ( ) const
inlinevirtual

Always returns 0.

Implements PbMesh.

Definition at line 78 of file PbMesh2D.h.


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