Pointwise Plugin SDK
|
The unstructured vertex class. More...
#include <CaeUnsVertex.h>
Public Member Functions | |
CaeUnsVertex () | |
Default constructor. More... | |
CaeUnsVertex (const CaeUnsGridModel &model, PWP_UINT32 ndx=0) | |
Model and vertex index constructor. More... | |
CaeUnsVertex (const CaeUnsVertex &src) | |
Copy constructor. More... | |
CaeUnsVertex (PWGM_HVERTEX vertex) | |
Vertex handle constructor. More... | |
bool | dataMod (PWGM_VERTDATA &data) const |
Get the vertex data relative to the model's index space. More... | |
PWP_UINT32 | index () const |
Get the vertex's index. More... | |
bool | indexMod (PWP_UINT32 &ndx) const |
Get the vertex index relative to the model's index space. More... | |
bool | isValid () const |
Determines a vertex's validity. More... | |
CaeUnsGridModel | model () const |
Gets the unstructured grid model of which this vertex is a member. More... | |
CaeUnsVertex & | moveFirst (const CaeUnsGridModel &model) |
Rebinds an instance to the first vertex in a model. More... | |
CaeUnsVertex & | moveNext () |
Rebinds an instance to the next vertex in a model. More... | |
CaeUnsVertex & | movePrev () |
Rebinds an instance to the previous vertex in a model. More... | |
CaeUnsVertex & | moveTo (const CaeUnsGridModel &model, PWP_UINT32 ndx) |
Rebinds an instance to a specific model vertex. More... | |
operator PWGM_HVERTEX () const | |
The PWGM_HVERTEX cast operator. More... | |
CaeUnsVertex & | operator++ () |
Prefix increment to the next vertex in a model. More... | |
CaeUnsVertex | operator++ (int) |
Postfix increment to the next vertex in a model. More... | |
CaeUnsVertex & | operator-- () |
Prefix decrement to the previous vertex in a model. More... | |
CaeUnsVertex | operator-- (int) |
Postfix decrement to the previous vertex in a model. More... | |
CaeUnsVertex & | operator= (const CaeUnsVertex &rhs) |
Assignment operator. More... | |
CaeUnsVertex & | operator= (PWGM_HVERTEX vertex) |
Assignment operator. More... | |
const char * | toString (char *buf=0, const char *delimiter=0, const char *prefix=0, const char *suffix=0) const |
Get a string representation of the vertex. More... | |
PWGM_XYZVAL | x () const |
Get the vertex's x component. More... | |
bool | xyzVal (PWGM_ENUM_XYZ which, PWGM_XYZVAL &val) const |
Get one of the vertex's x, y, or z components. More... | |
PWGM_XYZVAL | y () const |
Get the vertex's y component. More... | |
PWGM_XYZVAL | z () const |
Get the vertex's z component. More... | |
~CaeUnsVertex () | |
Destructor. More... | |
Static Public Member Functions | |
static const char * | toString (const PWGM_VERTDATA &data, char *buf=0, const char *delimiter=0, const char *prefix=0, const char *suffix=0) |
Get a string representation of the vertex data. More... | |
Protected Attributes | |
PWGM_HVERTEX | h_ |
The bound PWGM_HVERTEX. More... | |
The unstructured vertex class.
The CaeUnsVertex class represents a single, xyz point in an unstructured grid model. The grid model vertices are indexed from 0 to CaeUnsGridModel::vertexCount() - 1. The vertices are shared among all grid model elements.
A CaeUnsVertex object is aware of its relative position in the grid model. As a result, a given vertex object can be moved (iterated) to its previous or next neighbor vertex. It can also be moved to the first vertex or to a vertex at a given index. After being moved, a vertex will return information about the vertex at its current position.
The following snippets are extracted from the unstructured XML sample plugin (CaeUnsXMLCPP).
During the execution of the CaeUnsXMLCPP::write()
method, the CaeUnsXMLCPP plugin writes the grid model vertices with a call to its CaeUnsXMLCPP::writeVertices()
method. First, it writes an XML <vertices>
tag. Then it moves through the vertices one by one and calls the CaeUnsXMLCPP::writeVertex()
method. Finally, a closing </vertices>
tag is written. If only boundary conditions are being written or if the export is aborted, vertices are not written.
CaeUnsXMLCPP::writeVertex()
writes a self-closed XML <vertex
/> tag. If the export dimensionality is 3D, the x, y, and z components are written. If the export dimensionality is 2D, only the x and y components are written. In both cases, the numeric precision is set to either 8 or 16 depending on the call to CaePlugin::isSinglePrecision().
Definition at line 57 of file CaeUnsVertex.h.
|
inline |
Default constructor.
Constructs an invalid vertex.
Definition at line 66 of file CaeUnsVertex.h.
References h_.
|
inline |
Vertex handle constructor.
Constructs an unstructured vertex object bound to the specified vertex.
vertex | The vertex handle to bind. |
Definition at line 75 of file CaeUnsVertex.h.
|
inline |
Copy constructor.
Binds this vertex to the same vertex as src.
src | A vertex instance. |
Definition at line 83 of file CaeUnsVertex.h.
References h_.
|
inline |
Model and vertex index constructor.
Constructs an unstructured vertex object bound to the vertex at the specified index.
model | The unstructured grid model. |
ndx | The vertex's index. |
Definition at line 94 of file CaeUnsVertex.h.
|
inline |
Destructor.
Definition at line 99 of file CaeUnsVertex.h.
|
inline |
Get the vertex data relative to the model's index space.
data | The PWGM_VERTDATA buffer. |
Definition at line 120 of file CaeUnsVertex.h.
References h_, and PwVertDataMod().
Referenced by toString().
|
inline |
Get the vertex's index.
Definition at line 111 of file CaeUnsVertex.h.
References h_, and PWGM_HVERTEX_ID.
Referenced by moveNext(), and movePrev().
|
inline |
Get the vertex index relative to the model's index space.
ndx | The index buffer. |
Definition at line 129 of file CaeUnsVertex.h.
References h_, and PwVertIndexMod().
|
inline |
Determines a vertex's validity.
Definition at line 172 of file CaeUnsVertex.h.
References h_, and PWGM_HVERTEX_ISVALID.
|
inline |
Gets the unstructured grid model of which this vertex is a member.
Definition at line 103 of file CaeUnsVertex.h.
References h_, and PWGM_HVERTEX_H.
Referenced by CaeUnsVertex(), moveFirst(), and moveTo().
|
inline |
Rebinds an instance to the first vertex in a model.
model | The unstructured grid model. |
Definition at line 218 of file CaeUnsVertex.h.
|
inline |
Rebinds an instance to the next vertex in a model.
Definition at line 228 of file CaeUnsVertex.h.
References h_, index(), moveTo(), and PWGM_HVERTEX_H.
Referenced by operator++().
|
inline |
Rebinds an instance to the previous vertex in a model.
Definition at line 262 of file CaeUnsVertex.h.
References h_, index(), moveTo(), and PWGM_HVERTEX_H.
Referenced by operator--().
|
inline |
Rebinds an instance to a specific model vertex.
model | The unstructured grid model. |
ndx | The vertex's index. |
Definition at line 206 of file CaeUnsVertex.h.
References h_, model(), and PwModEnumVertices().
Referenced by CaeUnsVertex(), moveFirst(), moveNext(), and movePrev().
|
inline |
|
inline |
Prefix increment to the next vertex in a model.
Definition at line 240 of file CaeUnsVertex.h.
References moveNext().
Referenced by operator++().
|
inline |
Postfix increment to the next vertex in a model.
Definition at line 250 of file CaeUnsVertex.h.
References operator++().
|
inline |
Prefix decrement to the previous vertex in a model.
Definition at line 274 of file CaeUnsVertex.h.
References movePrev().
Referenced by operator--().
|
inline |
Postfix decrement to the previous vertex in a model.
Definition at line 284 of file CaeUnsVertex.h.
References operator--().
|
inline |
Assignment operator.
Rebind this instance to the same vertex as rhs.
rhs | A vertex instance. |
Definition at line 182 of file CaeUnsVertex.h.
References h_.
|
inline |
Assignment operator.
Rebind this instance to the specified vertex handle.
vertex | The vertex handle. |
Definition at line 193 of file CaeUnsVertex.h.
References h_.
|
inline |
Get a string representation of the vertex.
Calls the static overload of this method using the vertex data obtained with a call to dataMod(). See the static overload for parameter usage.
Definition at line 303 of file CaeUnsVertex.h.
References dataMod().
|
inlinestatic |
Get a string representation of the vertex data.
data | The vertex data. |
buf | Pointer to a string buffer. If null, a static, internal buffer is used. |
delimiter | Pointer to a delimiter string. If null, a single space is used. |
prefix | Pointer to a prefix string. If null, prefix is ignored. |
suffix | Pointer to a suffix string. If null, suffix is ignored. |
Definition at line 330 of file CaeUnsVertex.h.
References PWGM_VERTDATA::x, PWGM_VERTDATA::y, and PWGM_VERTDATA::z.
|
inline |
Get the vertex's x component.
Definition at line 147 of file CaeUnsVertex.h.
References PWGM_XYZ_X, and xyzVal().
|
inline |
Get one of the vertex's x, y, or z components.
which | The XYZ component id. |
val | The PWGM_XYZVAL buffer. |
Definition at line 139 of file CaeUnsVertex.h.
References h_, and PwVertXyzVal().
|
inline |
Get the vertex's y component.
Definition at line 156 of file CaeUnsVertex.h.
References PWGM_XYZ_Y, and xyzVal().
|
inline |
Get the vertex's z component.
Definition at line 165 of file CaeUnsVertex.h.
References PWGM_XYZ_Z, and xyzVal().
|
protected |
The bound PWGM_HVERTEX.
Definition at line 354 of file CaeUnsVertex.h.
Referenced by CaeUnsVertex(), dataMod(), index(), indexMod(), isValid(), model(), moveNext(), movePrev(), moveTo(), operator PWGM_HVERTEX(), operator=(), and xyzVal().