Pointwise Plugin SDK
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros
rtGrdpInstanceData.h File Reference

Customizes the typedef GRDP_RTITEM declaration. More...

+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define GRDP_RUNTIME_INSTDATADECL   MY_GRDP_DATA* data;
 Implementation defined runtime instance data macro. More...
 

Detailed Description

Customizes the typedef GRDP_RTITEM declaration.

During import, it is often necessary to keep track of runtime, shared state information. To simplify the addition of this kind of data to a plugin without having to resort to global variables, or adding arguments to functions, a pointer to plugin defined data type is part of GRDP_RTITEM.

To add custom, per-instance data to the GRDP_RTITEM typedef, your plugin should define the struct MY_GRDP_DATA. For example, in runtimeReadGrid.cxx (for local use) or in a project header file (for shared use) you could define:

struct MY_GRDP_DATA {
int count;
int offset;
float scale;
char * name;
};

A pointer to this struct is accessed as pRti->data using the pRti parameter of runtimeReadGrid(GRDP_RTITEM *pRti). By default, pRti->data is set to null.

To use this pointer, a plugin needs to declare and initialize an instance of this struct and assign its address to this pointer. Once set, your plugin can access the MY_GRDP_DATA data members anywhere it has access to the pRti pointer.

An example is shown in the code below.

{
MY_GRDP_DATA localData;
pRti->data = &localData;
// Assuming the definition given above, these are now valid
pRti->data.count;
pRti->data.offset;
pRti->data.scale;
pRti->data.name;
// someFunc also can access this data!
someFunc(pRti);
}

Definition in file rtGrdpInstanceData.h.

Macro Definition Documentation

#define GRDP_RUNTIME_INSTDATADECL   MY_GRDP_DATA* data;

Implementation defined runtime instance data macro.

By default, this macro resolves to MY_GRDP_DATA* data;.

See rtGrdpInstanceData.h for more information.

Definition at line 22 of file rtGrdpInstanceData.h.