Pointwise Plugin SDK
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

◆ GRDP_RUNTIME_INSTDATADECL

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

runtimeReadGrid
PWP_BOOL runtimeReadGrid(GRDP_RTITEM *pRti)
GRDP_RTITEM
The data representing a grid importer instance.
Definition: apiGRDPUtils.h:117
GRDP_RTITEM::data
MY_GRDP_DATA * data
Implementation defined runtime instance data macro.
Definition: apiGRDPUtils.h:200
PWP_BOOL
int PWP_BOOL
logical value
Definition: apiPWP.h:303