Pointwise Plugin SDK
Classes | Macros | Enumerations | Functions | Variables
apiCAEPUtils.h File Reference

CAEP utilities. More...

#include <stdio.h>
#include <time.h>
#include "apiCAEP.h"
#include "apiPWP.h"
#include "apiPWPUtils.h"
#include "apiGridModel.h"
#include "rtCaepInstanceData.h"
+ Include dependency graph for apiCAEPUtils.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  CAEP_RTITEM
 The data representing a CAE exporter instance. More...
 

Macros

#define CAEP_RUNTIME_INSTDATADECL
 Implementation defined CAE runtime instance data macro. More...
 
#define CAEPU_CLKS_TO_FSECS(c)   ((PWP_FLOAT)(c) / (PWP_FLOAT)CLOCKS_PER_SEC)
 Returns the clock value c as seconds (PWP_FLOAT). More...
 
#define CAEPU_CLKS_TO_HMS(c, h, m, s)
 Returns the clock value c decomposed into hours, minutes, and seconds (PWP_INT32). That is, c == (h * 3600 + m * 60 + s) * CLOCKS_PER_SEC. More...
 
#define CAEPU_CLKS_TO_HOURS(c)   (CAEPU_CLKS_TO_MINS(c) / 60)
 Returns the clock value c as hours (PWP_INT32). Only whole hour values are possible. More...
 
#define CAEPU_CLKS_TO_MINS(c)   (CAEPU_CLKS_TO_SECS(c) / 60)
 Returns the clock value c as minutes (PWP_INT32). Only whole minute values are possible. More...
 
#define CAEPU_CLKS_TO_MSECS(c)   ((PWP_INT32)((c) * 1000) / CLOCKS_PER_SEC)
 Returns the clock value c as milli seconds (PWP_INT32). Only whole ms values are possible. More...
 
#define CAEPU_CLKS_TO_SECS(c)   ((PWP_INT32)(c) / CLOCKS_PER_SEC)
 Returns the clock value c as seconds (PWP_INT32). Only whole second values are possible. More...
 
#define CAEPU_IS_CLKS_ID(id)    PWP_CAST_BOOL(((id) >= 0) && ((id) <= CAEPU_CLKS_LAST))
 Returns PWP_TRUE if id is a valid CAEPU_ENUM_CLOCKS id. More...
 
#define CAEPU_RT_ABORT(rti)   ((rti)->opAborted = PWP_TRUE)
 Used by plugin to mark the export operation as aborted. More...
 
#define CAEPU_RT_CLKS_DIFF(rti, startId, endId)
 Returns the clock time difference between startId and endId as clocks[endId] - clocks[startId]. The ids are validated. More...
 
#define CAEPU_RT_CLKS_DIFF_STEP(rti)    CAEPU_RT_CLKS_DIFF(rti, CAEPU_CLKS_BEGSTEP, CAEPU_CLKS_ENDSTEP)
 Returns the current clock time difference between CAEPU_CLKS_BEGSTEP and CAEPU_CLKS_ENDSTEP. More...
 
#define CAEPU_RT_CLKS_DIFF_TOTAL(rti)    CAEPU_RT_CLKS_DIFF(rti, CAEPU_CLKS_PROGINIT, CAEPU_CLKS_PROGEND)
 Returns the current clock time difference between CAEPU_CLKS_PROGINIT and CAEPU_CLKS_PROGEND. More...
 
#define CAEPU_RT_CLKS_ID(rti, id)   (CAEPU_IS_CLKS_ID(id)? (rti)->clocks[id]: 0)
 Returns the clock time value for the given id. The id is validated. More...
 
#define CAEPU_RT_CLKS_POLL(rti, id)    CAEPU_RT_CLKS_DIFF(rti, id, CAEPU_CLKS_PROGINCR)
 Returns the current clock time difference between id and CAEPU_CLKS_PROGINCR. More...
 
#define CAEPU_RT_CLKS_POLL_STEP(rti)    CAEPU_RT_CLKS_POLL(rti, CAEPU_CLKS_BEGSTEP)
 Returns the current clock time difference between CAEPU_CLKS_BEGSTEP and CAEPU_CLKS_PROGINCR. More...
 
#define CAEPU_RT_CLKS_POLL_TOTAL(rti)    CAEPU_RT_CLKS_POLL(rti, CAEPU_CLKS_PROGINIT)
 Returns the current clock time difference between CAEPU_CLKS_PROGINIT and CAEPU_CLKS_PROGINCR. More...
 
#define CAEPU_RT_DIM(rti)   (rti)->pWriteInfo->dimension
 Get the export dimension from CAEP_RTITEM data pointed to by rti. More...
 
#define CAEPU_RT_DIM_2D(rti)   CAEPU_RT_DIM_IS(rti, PWP_DIMENSION_2D)
 Returns PWP_TRUE if export dimension is PWP_DIMENSION_2D. More...
 
#define CAEPU_RT_DIM_3D(rti)   CAEPU_RT_DIM_IS(rti, PWP_DIMENSION_3D)
 Returns PWP_TRUE if export dimension is PWP_DIMENSION_3D. More...
 
#define CAEPU_RT_DIM_IS(rti, d)   PWP_CAST_BOOL((d) == CAEPU_RT_DIM(rti))
 Returns PWP_TRUE if export dimension is d. More...
 
#define CAEPU_RT_DIM_TEXT(rti)    caeuDimensionToText((rti)->pWriteInfo->dimension)
 Get the export dimension text from CAEP_RTITEM data pointed to by rti. More...
 
#define CAEPU_RT_ENC_ASCII(rti)   CAEPU_RT_ENC_IS(rti, PWP_ENCODING_ASCII)
 Returns PWP_TRUE if export encoding is PWP_ENCODING_ASCII. More...
 
#define CAEPU_RT_ENC_BINARY(rti)   CAEPU_RT_ENC_IS(rti, PWP_ENCODING_BINARY)
 Returns PWP_TRUE if export encoding is PWP_ENCODING_BINARY. More...
 
#define CAEPU_RT_ENC_IS(rti, e)   PWP_CAST_BOOL((e) == CAEPU_RT_ENCODING(rti))
 Returns PWP_TRUE if export encoding is enc. More...
 
#define CAEPU_RT_ENC_UNFORMATTED(rti)    CAEPU_RT_ENC_IS(rti, PWP_ENCODING_UNFORMATTED)
 Returns PWP_TRUE if export encoding is PWP_ENCODING_UNFORMATTED. More...
 
#define CAEPU_RT_ENCODING(rti)   (rti)->pWriteInfo->encoding
 Get the export encoding from CAEP_RTITEM data pointed to by rti. More...
 
#define CAEPU_RT_ENCODING_TEXT(rti)    caeuEncodeToText((rti)->pWriteInfo->encoding)
 Get the export precision text from CAEP_RTITEM data pointed to by rti. More...
 
#define CAEPU_RT_IS_ABORTED(rti)   PWP_CAST_BOOL((rti)->opAborted)
 Returns PWP_TRUE if the export has been aborted by the user or the plugin itself. More...
 
#define CAEPU_RT_PREC(rti)   (rti)->pWriteInfo->precision
 Get the export precision from CAEP_RTITEM data pointed to by rti. More...
 
#define CAEPU_RT_PREC_DOUBLE(rti)   CAEPU_RT_PREC_IS(rti, PWP_PRECISION_DOUBLE)
 Returns PWP_TRUE if export dimension is PWP_PRECISION_DOUBLE. More...
 
#define CAEPU_RT_PREC_IS(rti, prec)   PWP_CAST_BOOL((prec) == CAEPU_RT_PREC(rti))
 Returns PWP_TRUE if export precision is prec. More...
 
#define CAEPU_RT_PREC_SINGLE(rti)   CAEPU_RT_PREC_IS(rti, PWP_PRECISION_SINGLE)
 Returns PWP_TRUE if export precision is PWP_PRECISION_SINGLE. More...
 
#define CAEPU_RT_PREC_TEXT(rti)    caeuPrecisionToText((rti)->pWriteInfo->precision)
 Get the export precision text from CAEP_RTITEM data pointed to by rti. More...
 
#define CAEPU_RT_TRY(rti, theOp)
 Attempt theOp and abort the export if needed. Returns PWP_FALSE if the export operation is marked as aborted. More...
 

Enumerations

enum  CAEPU_ENUM_CLOCKS {
  CAEPU_CLKS_PROGUPDATE,
  CAEPU_CLKS_PROGINIT,
  CAEPU_CLKS_BEGSTEP,
  CAEPU_CLKS_PROGINCR,
  CAEPU_CLKS_ENDSTEP,
  CAEPU_CLKS_PROGEND
}
 Supported CAEPU clock id values. More...
 

Functions

PWP_BOOL caeuAssignInfoValue (const char key[], const char value[], bool createIfNotExists=true)
 Creates a key/value pair that defines a CAE info attribute. More...
 
const char * caeuDimensionToText (PWP_ENUM_DIMENSION dim)
 Converts a PWP_ENUM_DIMENSION value to a text string representation. More...
 
const char * caeuEncodeToText (PWP_ENUM_ENCODING enc)
 Converts a PWP_ENUM_ENCODING value to a text string representation. More...
 
PWP_BOOL caeuExportBndryConditionsOnly (PWGM_HGRIDMODEL model)
 Get the user-requested bc export option. More...
 
PWP_BOOL caeuExportStructuredAsUnstructured (PWGM_HGRIDMODEL model)
 Get the user-requested structured grid handling. More...
 
PWP_ENDIANNESS caeuFileByteOrder (PWGM_HGRIDMODEL model)
 Get the user-requested file byte order. More...
 
int caeuFileClose (CAEP_RTITEM *pRti, const CAEP_WRITEINFO *pWriteInfo)
 Closes pRti for file I/O as specified by pWriteInfo. More...
 
PWP_ENUM_ENCODING caeuFileEncoding (PWGM_HGRIDMODEL model)
 Get the user-requested file encoding. More...
 
int caeuFileOpen (CAEP_RTITEM *pRti, const CAEP_WRITEINFO *pWriteInfo)
 Prepare pRti for file I/O as specified by pWriteInfo. More...
 
PWP_ENUM_PRECISION caeuFilePrecision (PWGM_HGRIDMODEL model)
 Get the user-requested file precision. More...
 
CAEP_RTITEMcaeuFindFormatById (PWP_UINT32 id)
 Find an item in caepRtItem[] by it's id. More...
 
CAEP_RTITEMcaeuFindFormatByName (const char name[])
 Find an item in caepRtItem[] by it's name. More...
 
const char * caeuPrecisionToText (PWP_ENUM_PRECISION prec)
 Converts a PWP_ENUM_PRECISION value to a text string representation. More...
 
PWP_BOOL caeuProgressBeginStep (CAEP_RTITEM *pRti, PWP_UINT32 total)
 Begins a progress tracking step. More...
 
void caeuProgressEnd (CAEP_RTITEM *pRti, PWP_BOOL ok)
 Ends all progress tracking. More...
 
PWP_BOOL caeuProgressEndStep (CAEP_RTITEM *pRti)
 Completes a progress tracking major step. More...
 
PWP_BOOL caeuProgressIncr (CAEP_RTITEM *pRti)
 Completes a progress tracking sub-step. More...
 
PWP_BOOL caeuProgressInit (CAEP_RTITEM *pRti, PWP_UINT32 cnt)
 Initializes a progress tracking session. More...
 
PWP_BOOL caeuPublishHighOrderValueDefinitions (const PWP_UINT32 maxPolynomialDegree)
 Enables support for the export of high order meshes and publishes all needed value definitions. More...
 
PWP_BOOL caeuPublishMeshLinkValueDefinitions (const char *indexScheme)
 Enables support for the export of MeshLink data and publishes all needed value definitions. More...
 
PWP_BOOL caeuPublishValueDefinition (const char key[], PWP_ENUM_VALTYPE type, const char value[], const char access[], const char desc[], const char range[])
 Creates a collection of key/value pairs that represent a published CAE attribute definition. More...
 
void caeuSendDebugMsg (CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
 Send a debug text message (PWP_MSGID_DEBUG) to the framework. More...
 
void caeuSendErrorMsg (CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
 Send an error text message (PWP_MSGID_ERROR) to the framework. More...
 
void caeuSendInfoMsg (CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
 Send an info text message (PWP_MSGID_INFO) to the framework. More...
 
void caeuSendWarningMsg (CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
 Send a warning text message (PWP_MSGID_WARNING) to the framework. More...
 

Variables

PWP_UINT32 caepFormatCnt
 The number of entries in caepRtItem[] array. More...
 
CAEP_RTITEM caepRtItem []
 The runtime array of CAEP_RTITEM items. More...
 

Detailed Description

CAEP utilities.

A collection of helpful data and functions useful to CAEP compliant plugins.

Progress functions

Functions used to maintain progress status during an export.

These functions access data stored in a CAEP_RTITEM instance to track the progress and forward calls the appropriate PwuProgressBegin(), PwuProgressEnd(), PwuProgressStatus(), PwuProgressNextStep(), PwuProgressQuit() functions.

File functions

Functions used to open and close a CAE export file using CAEP_WRITEINFO runtime settings.

Search functions

Functions used to find an entry in the CAEP_RTITEM array.

Definition in file apiCAEPUtils.h.

Macro Definition Documentation

◆ CAEP_RUNTIME_INSTDATADECL

#define CAEP_RUNTIME_INSTDATADECL

Implementation defined CAE runtime instance data macro.

By default, this macro resolves to nothing (no data).

If a plugin needs additional runtime instance data, the developer may add data members to the CAEP_RTITEM structure by editing the rtCaepInstanceData.h header.

Definition at line 63 of file apiCAEPUtils.h.