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
 
bool getAttribute (const char *name, PWP_UINT &val, PWP_UINT defVal) const
 
bool getAttribute (const char *name, PWP_UINT32 &val, PWP_UINT32 defVal) const
 
bool getAttribute (const char *name, PWP_INT &val, PWP_INT defVal) const
 
bool getAttribute (const char *name, PWP_INT32 &val, PWP_INT32 defVal) const
 
bool getAttribute (const char *name, PWP_REAL &val, PWP_REAL defVal) const
 
bool getAttribute (const char *name, PWP_FLOAT &val, PWP_FLOAT defVal) const
 
bool getAttribute (const char *name, bool &val, bool defVal) const
 
bool getAttributeEnum (const char *name, const char *&val, const char *defVal) const
 

Protected Member Functions

 CaeGridModel (const CaeGridModel &src)
 Copy constructor. More...
 
 CaeGridModel (PWGM_HGRIDMODEL model)
 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 46 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 19 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 24 of file CaeGridModel.cxx.

◆ ~CaeGridModel()

CaeGridModel::~CaeGridModel ( )
protected

Destructor.

Definition at line 29 of file CaeGridModel.cxx.

Member Function Documentation

◆ blockCount()

PWP_UINT32 CaeGridModel::blockCount ( ) const

Get the number of blocks in the model.

Definition at line 35 of file CaeGridModel.cxx.

References model_, and PwModBlockCount().

◆ getAttribute() [1/9]

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

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 a published value.
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 91 of file CaeGridModel.cxx.

References model_, and PwModGetAttributeBOOL().

◆ getAttribute() [2/9]

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

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 a published value.
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 42 of file CaeGridModel.cxx.

References model_, and PwModGetAttributeString().

Referenced by getAttribute().

◆ getAttribute() [3/9]

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

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 a published value.
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 84 of file CaeGridModel.cxx.

References model_, and PwModGetAttributeFLOAT().

◆ getAttribute() [4/9]

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

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 a published value.
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 63 of file CaeGridModel.cxx.

References model_, and PwModGetAttributeINT().

◆ getAttribute() [5/9]

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

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 a published value.
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");

◆ getAttribute() [6/9]

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

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 a published value.
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 77 of file CaeGridModel.cxx.

References model_, and PwModGetAttributeREAL().

◆ getAttribute() [7/9]

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

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 a published value.
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 49 of file CaeGridModel.cxx.

References model_, and PwModGetAttributeUINT().

◆ getAttribute() [8/9]

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

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 a published value.
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");

◆ 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 126 of file CaeGridModel.h.

References getAttribute().

◆ getAttributeEnum()

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

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 a published value.
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 103 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 140 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 111 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:
CaeGridModel::getAttributeEnum
bool getAttributeEnum(const char *name, const char *&val, const char *defVal) const
Definition: CaeGridModel.cxx:103
PWP_UINT
PWP_UINT32 PWP_UINT
unsigned integer same size as void*
Definition: apiPWP.h:285
CaeGridModel::getAttribute
bool getAttribute(const char *name, const char *&val, const char *defVal) const
Definition: CaeGridModel.cxx:42