Pointwise Plugin SDK
rtCaepInstanceData.h File Reference

Customizes the typedef CAEP_RTITEM declaration. More...

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

Go to the source code of this file.

Detailed Description

Customizes the typedef CAEP_RTITEM declaration.

If your plugin needs custom, per-instance CAE data members added to the CAEP_RTITEM typedef, you will need to modify the rtCaepInstanceData.h file.

The SDK file apiCAEPUtils.h includes rtCaepInstanceData.h before the CAEP_RTITEM struct is typedef'ed. The CAEP_RUNTIME_INSTDATADECL macro is used at the end of the struct as shown below. By default, the CAEP_RUNTIME_INSTDATADECL macro resolves to nothing (no data) and does not change the CAEP_RTITEM typedef.

...snip...
Declaring the CAEP_RUNTIME_INSTDATADECL Macro

There are 2 similar approaches to adding data members to the CAEP_RTITEM typedef.

The examples below show the same 4 data members being added to CAEP_RTITEM using the two approaches. Which approach you choose is a matter of personal preference.

Using a Single Struct to Extend CAEP_RTITEM

In rtCaepInstanceData.h, define your custom data struct and then define the CAEP_RUNTIME_INSTDATADECL Macro as if you were declaring an instance of this struct. The code below shows this approach.

struct MY_CAEP_DATA {
int data1;
int data2;
float data3;
char *pStr;
};
// This macro is included in the CAEP_RTITEM structure declaration:
#define CAEP_RUNTIME_INSTDATADECL MY_CAEP_DATA myData;

Your single, struct data member is now part of CAEP_RTITEM. You can access its members using the pRti pointer passed into the runtimeWrite() function as shown in the code below.

PWP_BOOL runtimeWrite(CAEP_RTITEM *pRti, ...snip...)
{
pRti->myData.data1;
pRti->myData.data2;
pRti->myData.data3;
pRti->myData.pStr;
}
Using a Separate Values to Extend CAEP_RTITEM

In rtCaepInstanceData.h, define the CAEP_RUNTIME_INSTDATADECL Macro as if you were declaring your data members as local variables. The code below shows this approach.

// This macro is included in the CAEP_RTITEM structure declaration:
#define CAEP_RUNTIME_INSTDATADECL int data1; \
int data2; \
float data3; \
char *pStr;

Your separate data members are now part of CAEP_RTITEM. You can access them using the pRti pointer passed into the runtimeWrite() function as shown in the code below.

PWP_BOOL runtimeWrite(CAEP_RTITEM *pRti, ...snip...)
{
pRti->data1;
pRti->data2;
pRti->data3;
pRti->pStr;
}
Note
To prevent compiler warnings or errors, be sure to add the appropriate static initializers to rtCaepInitItems.h for your custom data members!

Definition in file rtCaepInstanceData.h.

CAEP_RTITEM
The data representing a CAE exporter instance.
Definition: apiCAEPUtils.h:124
PWP_BOOL
int PWP_BOOL
logical value
Definition: apiPWP.h:303
runtimeWrite
PWP_BOOL runtimeWrite(CAEP_RTITEM *pRti, PWGM_HGRIDMODEL model, const CAEP_WRITEINFO *pWriteInfo)
Definition: cppstr/runtimeWrite.cxx:27