Pointwise Plugin SDK
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members

The grid model base class. More...

#include <CaeGridModel.h>

+ Inheritance diagram for CaeGridModel:
+ Collaboration diagram for CaeGridModel:

Public Member Functions

PWP_UINT32 blockCount () const
 Get the number of blocks in the model. More...
 
template<typename T >
bool getAttribute (const char *name, T &val) const
 Templated method that gets the value of a published plugin attribute. More...
 
 operator PWGM_HGRIDMODEL () const
 The PWGM_HGRIDMODEL cast operator. More...
 
CaeGridModeloperator= (const CaeGridModel &rhs)
 The assignment operator. More...
 
bool getAttribute (const char *name, const char *&val, const char *defVal) const
 Overloaded method that gets the value of a published plugin attribute. More...
 
bool getAttribute (const char *name, PWP_UINT &val, PWP_UINT defVal) const
 Overloaded method that gets the value of a published plugin attribute. More...
 
bool getAttribute (const char *name, PWP_UINT32 &val, PWP_UINT32 defVal) const
 Overloaded method that gets the value of a published plugin attribute. More...
 
bool getAttribute (const char *name, PWP_INT &val, PWP_INT defVal) const
 Overloaded method that gets the value of a published plugin attribute. More...
 
bool getAttribute (const char *name, PWP_INT32 &val, PWP_INT32 defVal) const
 Overloaded method that gets the value of a published plugin attribute. More...
 
bool getAttribute (const char *name, PWP_REAL &val, PWP_REAL defVal) const
 Overloaded method that gets the value of a published plugin attribute. More...
 
bool getAttribute (const char *name, PWP_FLOAT &val, PWP_FLOAT defVal) const
 Overloaded method that gets the value of a published plugin attribute. More...
 
bool getAttribute (const char *name, bool &val, bool defVal) const
 Overloaded method that gets the value of a published plugin attribute. More...
 
bool getAttributeEnum (const char *name, const char *&val, const char *defVal) const
 Overloaded method that gets the value of a published plugin attribute. More...
 

Protected Member Functions

 CaeGridModel (PWGM_HGRIDMODEL model)
 Constructor. More...
 
 CaeGridModel (const CaeGridModel &src)
 Copy constructor. More...
 
 ~CaeGridModel ()
 Destructor. More...
 

Protected Attributes

PWGM_HGRIDMODEL model_
 The bound PWGM_HGRIDMODEL. More...
 

Detailed Description

The grid model base class.

The CaeGridModel class implements the data and functionality common to both structured and unstructured grid models. This common interface consists of a collection of blocks and a collection of named attribute values of a specific type.

The blocks are indexed from 0 to CaeGridModel::blockCount() - 1. Each block has associated condition data.

The attribute values are accessed by name. Several common attributes are published by the SDK for use by all plugins. Additional, custom attributes can be published by the plugin itself. All attributes are settable by the user through the Pointwise user interface or through the glyph scripting language.

CaeGridModel is subclassed by the CaeUnsGridModel and CaeStrGridModel classes. These subclasses implement the functionality specific to each grid model type.

Definition at line 48 of file CaeGridModel.h.

Constructor & Destructor Documentation

◆ CaeGridModel() [1/2]

CaeGridModel::CaeGridModel ( PWGM_HGRIDMODEL  model)
protected

Constructor.

This class is not used directly by plugins.

Parameters
modelThe model handle to bind.
See also
CaeUnsGridModel, CaeStrGridModel

Definition at line 21 of file CaeGridModel.cxx.

◆ CaeGridModel() [2/2]

CaeGridModel::CaeGridModel ( const CaeGridModel src)
protected

Copy constructor.

Binds this model to the same model as src.

Parameters
srcA grid model instance.

Definition at line 26 of file CaeGridModel.cxx.

◆ ~CaeGridModel()

CaeGridModel::~CaeGridModel ( )
protected

Destructor.

Definition at line 31 of file CaeGridModel.cxx.

Member Function Documentation

◆ blockCount()

PWP_UINT32 CaeGridModel::blockCount ( ) const

Get the number of blocks in the model.

Definition at line 37 of file CaeGridModel.cxx.

References model_, and PwModBlockCount().

◆ getAttribute() [1/9]

bool CaeGridModel::getAttribute ( const char *  name,
const char *&  val,
const char *  defVal 
) const

Overloaded method that gets the value of a published plugin attribute.

Plugin attributes are created in a plugin's create() function using one of the CaePlugin::publishXxxValueDef() methods.

Parameters
nameThe published attribute name.
valThe published attribute value.
defValIf name does not exist, this value is returned.
Returns
true if name is published.
See also
CaePlugin::publishValueDef(), CaePlugin::publishUIntValueDef(), CaePlugin::publishIntValueDef(), CaePlugin::publishRealValueDef(), CaePlugin::publishBoolValueDef(), CaePlugin::publishStringValueDef(), CaePlugin::publishEnumValueDef()
Sample usage:
const char *strVal;
getAttribute("mystring", strVal, "default");
PWP_UINT uintVal;
getAttribute("myuint", uintVal, 3);
const char *enumVal;
getAttributeEnum("myenum", enumVal, "option1");

Definition at line 44 of file CaeGridModel.cxx.

References model_, and PwModGetAttributeString().

Referenced by getAttribute().

◆ getAttribute() [2/9]

bool CaeGridModel::getAttribute ( const char *  name,
PWP_UINT val,
PWP_UINT  defVal 
) const

Overloaded method that gets the value of a published plugin attribute.

Plugin attributes are created in a plugin's create() function using one of the CaePlugin::publishXxxValueDef() methods.

Parameters
nameThe published attribute name.
valThe published attribute value.
defValIf name does not exist, this value is returned.
Returns
true if name is published.
See also
CaePlugin::publishValueDef(), CaePlugin::publishUIntValueDef(), CaePlugin::publishIntValueDef(), CaePlugin::publishRealValueDef(), CaePlugin::publishBoolValueDef(), CaePlugin::publishStringValueDef(), CaePlugin::publishEnumValueDef()
Sample usage:
const char *strVal;
getAttribute("mystring", strVal, "default");
PWP_UINT uintVal;
getAttribute("myuint", uintVal, 3);
const char *enumVal;
getAttributeEnum("myenum", enumVal, "option1");

Definition at line 51 of file CaeGridModel.cxx.

References model_, and PwModGetAttributeUINT().

◆ getAttribute() [3/9]

bool CaeGridModel::getAttribute ( const char *  name,
PWP_UINT32 val,
PWP_UINT32  defVal 
) const

Overloaded method that gets the value of a published plugin attribute.

Plugin attributes are created in a plugin's create() function using one of the CaePlugin::publishXxxValueDef() methods.

Parameters
nameThe published attribute name.
valThe published attribute value.
defValIf name does not exist, this value is returned.
Returns
true if name is published.
See also
CaePlugin::publishValueDef(), CaePlugin::publishUIntValueDef(), CaePlugin::publishIntValueDef(), CaePlugin::publishRealValueDef(), CaePlugin::publishBoolValueDef(), CaePlugin::publishStringValueDef(), CaePlugin::publishEnumValueDef()
Sample usage:
const char *strVal;
getAttribute("mystring", strVal, "default");
PWP_UINT uintVal;
getAttribute("myuint", uintVal, 3);
const char *enumVal;
getAttributeEnum("myenum", enumVal, "option1");

Definition at line 58 of file CaeGridModel.cxx.

References model_, and PwModGetAttributeUINT32().

◆ getAttribute() [4/9]

bool CaeGridModel::getAttribute ( const char *  name,
PWP_INT val,
PWP_INT  defVal 
) const

Overloaded method that gets the value of a published plugin attribute.

Plugin attributes are created in a plugin's create() function using one of the CaePlugin::publishXxxValueDef() methods.

Parameters
nameThe published attribute name.
valThe published attribute value.
defValIf name does not exist, this value is returned.
Returns
true if name is published.
See also
CaePlugin::publishValueDef(), CaePlugin::publishUIntValueDef(), CaePlugin::publishIntValueDef(), CaePlugin::publishRealValueDef(), CaePlugin::publishBoolValueDef(), CaePlugin::publishStringValueDef(), CaePlugin::publishEnumValueDef()
Sample usage:
const char *strVal;
getAttribute("mystring", strVal, "default");
PWP_UINT uintVal;
getAttribute("myuint", uintVal, 3);
const char *enumVal;
getAttributeEnum("myenum", enumVal, "option1");

Definition at line 65 of file CaeGridModel.cxx.

References model_, and PwModGetAttributeINT().

◆ getAttribute() [5/9]

bool CaeGridModel::getAttribute ( const char *  name,
PWP_INT32 val,
PWP_INT32  defVal 
) const

Overloaded method that gets the value of a published plugin attribute.

Plugin attributes are created in a plugin's create() function using one of the CaePlugin::publishXxxValueDef() methods.

Parameters
nameThe published attribute name.
valThe published attribute value.
defValIf name does not exist, this value is returned.
Returns
true if name is published.
See also
CaePlugin::publishValueDef(), CaePlugin::publishUIntValueDef(), CaePlugin::publishIntValueDef(), CaePlugin::publishRealValueDef(), CaePlugin::publishBoolValueDef(), CaePlugin::publishStringValueDef(), CaePlugin::publishEnumValueDef()
Sample usage:
const char *strVal;
getAttribute("mystring", strVal, "default");
PWP_UINT uintVal;
getAttribute("myuint", uintVal, 3);
const char *enumVal;
getAttributeEnum("myenum", enumVal, "option1");

Definition at line 72 of file CaeGridModel.cxx.

References model_, and PwModGetAttributeINT32().

◆ getAttribute() [6/9]

bool CaeGridModel::getAttribute ( const char *  name,
PWP_REAL val,
PWP_REAL  defVal 
) const

Overloaded method that gets the value of a published plugin attribute.

Plugin attributes are created in a plugin's create() function using one of the CaePlugin::publishXxxValueDef() methods.

Parameters
nameThe published attribute name.
valThe published attribute value.
defValIf name does not exist, this value is returned.
Returns
true if name is published.
See also
CaePlugin::publishValueDef(), CaePlugin::publishUIntValueDef(), CaePlugin::publishIntValueDef(), CaePlugin::publishRealValueDef(), CaePlugin::publishBoolValueDef(), CaePlugin::publishStringValueDef(), CaePlugin::publishEnumValueDef()
Sample usage:
const char *strVal;
getAttribute("mystring", strVal, "default");
PWP_UINT uintVal;
getAttribute("myuint", uintVal, 3);
const char *enumVal;
getAttributeEnum("myenum", enumVal, "option1");

Definition at line 79 of file CaeGridModel.cxx.

References model_, and PwModGetAttributeREAL().

◆ getAttribute() [7/9]

bool CaeGridModel::getAttribute ( const char *  name,
PWP_FLOAT val,
PWP_FLOAT  defVal 
) const

Overloaded method that gets the value of a published plugin attribute.

Plugin attributes are created in a plugin's create() function using one of the CaePlugin::publishXxxValueDef() methods.

Parameters
nameThe published attribute name.
valThe published attribute value.
defValIf name does not exist, this value is returned.
Returns
true if name is published.
See also
CaePlugin::publishValueDef(), CaePlugin::publishUIntValueDef(), CaePlugin::publishIntValueDef(), CaePlugin::publishRealValueDef(), CaePlugin::publishBoolValueDef(), CaePlugin::publishStringValueDef(), CaePlugin::publishEnumValueDef()
Sample usage:
const char *strVal;
getAttribute("mystring", strVal, "default");
PWP_UINT uintVal;
getAttribute("myuint", uintVal, 3);
const char *enumVal;
getAttributeEnum("myenum", enumVal, "option1");

Definition at line 86 of file CaeGridModel.cxx.

References model_, and PwModGetAttributeFLOAT().

◆ getAttribute() [8/9]

bool CaeGridModel::getAttribute ( const char *  name,
bool &  val,
bool  defVal 
) const

Overloaded method that gets the value of a published plugin attribute.

Plugin attributes are created in a plugin's create() function using one of the CaePlugin::publishXxxValueDef() methods.

Parameters
nameThe published attribute name.
valThe published attribute value.
defValIf name does not exist, this value is returned.
Returns
true if name is published.
See also
CaePlugin::publishValueDef(), CaePlugin::publishUIntValueDef(), CaePlugin::publishIntValueDef(), CaePlugin::publishRealValueDef(), CaePlugin::publishBoolValueDef(), CaePlugin::publishStringValueDef(), CaePlugin::publishEnumValueDef()
Sample usage:
const char *strVal;
getAttribute("mystring", strVal, "default");
PWP_UINT uintVal;
getAttribute("myuint", uintVal, 3);
const char *enumVal;
getAttributeEnum("myenum", enumVal, "option1");

Definition at line 93 of file CaeGridModel.cxx.

References model_, and PwModGetAttributeBOOL().

◆ getAttribute() [9/9]

template<typename T >
bool CaeGridModel::getAttribute ( const char *  name,
T &  val 
) const
inline

Templated method that gets the value of a published plugin attribute.

Gets an attribute's value without providing a default value.

Parameters
nameThe published attribute name.
valThe published attribute value.
Returns
true if name is published.
See also
CaePlugin::publishValueDef(), CaePlugin::publishUIntValueDef(), CaePlugin::publishIntValueDef(), CaePlugin::publishRealValueDef(), CaePlugin::publishBoolValueDef(), CaePlugin::publishStringValueDef(), CaePlugin::publishEnumValueDef()
Sample usage:
// Must check the return to see if the attribute value is valid.
PWP_UINT uintVal;
if (!getAttribute("baduint", uintVal)) {
// baduint is not published
}

Definition at line 128 of file CaeGridModel.h.

References getAttribute().

◆ getAttributeEnum()

bool CaeGridModel::getAttributeEnum ( const char *  name,
const char *&  val,
const char *  defVal 
) const

Overloaded method that gets the value of a published plugin attribute.

Plugin attributes are created in a plugin's create() function using one of the CaePlugin::publishXxxValueDef() methods.

Parameters
nameThe published attribute name.
valThe published attribute value.
defValIf name does not exist, this value is returned.
Returns
true if name is published.
See also
CaePlugin::publishValueDef(), CaePlugin::publishUIntValueDef(), CaePlugin::publishIntValueDef(), CaePlugin::publishRealValueDef(), CaePlugin::publishBoolValueDef(), CaePlugin::publishStringValueDef(), CaePlugin::publishEnumValueDef()
Sample usage:
const char *strVal;
getAttribute("mystring", strVal, "default");
PWP_UINT uintVal;
getAttribute("myuint", uintVal, 3);
const char *enumVal;
getAttributeEnum("myenum", enumVal, "option1");

Definition at line 105 of file CaeGridModel.cxx.

References model_, and PwModGetAttributeEnum().

◆ operator PWGM_HGRIDMODEL()

CaeGridModel::operator PWGM_HGRIDMODEL ( ) const
inline

The PWGM_HGRIDMODEL cast operator.

Definition at line 142 of file CaeGridModel.h.

References model_.

◆ operator=()

CaeGridModel & CaeGridModel::operator= ( const CaeGridModel rhs)

The assignment operator.

Rebind this instance to the same grid model as rhs.

Parameters
rhsA grid model instance.
Returns
A self reference.

Definition at line 113 of file CaeGridModel.cxx.

References model_.

Member Data Documentation

◆ model_

PWGM_HGRIDMODEL CaeGridModel::model_
protected

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