Go to the documentation of this file.
27 template<
typename MT >
296 return 0 !=
rti_.opAborted;
540 template<
typename H >
587 const char range[] =
"",
const char access[] =
"RW") {
603 PWP_UINT value,
const char desc[],
const char access[] =
"RW")
607 sprintf(valBuf,
"%lu", (
unsigned long)value);
625 const char access[] =
"RW")
629 sprintf(valBuf,
"%lu", (
unsigned long)value);
631 sprintf(rangeBuf,
"%lu %lu", (
unsigned long)minVal,
632 (
unsigned long)maxVal);
634 access, desc, rangeBuf);
654 const char access[] =
"RW")
658 sprintf(valBuf,
"%lu", (
unsigned long)value);
660 sprintf(rangeBuf,
"%lu %lu %lu %lu", (
unsigned long)minVal,
661 (
unsigned long)maxVal, (
unsigned long)minTypicalVal,
662 (
unsigned long)maxTypicalVal);
664 access, desc, rangeBuf);
677 PWP_INT value,
const char desc[],
const char access[] =
"RW")
681 sprintf(valBuf,
"%ld", (
long)value);
699 const char access[] =
"RW")
703 sprintf(valBuf,
"%ld", (
long)value);
705 sprintf(rangeBuf,
"%ld %ld", (
long)minVal, (
long)maxVal);
707 access, desc, rangeBuf);
727 const char access[] =
"RW")
731 sprintf(valBuf,
"%ld", (
long)value);
733 sprintf(rangeBuf,
"%ld %ld %ld %ld", (
long)minVal, (
long)maxVal,
734 (
long)minTypicalVal, (
long)maxTypicalVal);
736 access, desc, rangeBuf);
749 PWP_REAL value,
const char desc[],
const char access[] =
"RW")
753 sprintf(valBuf,
"%g", (
double)value);
771 const char access[] =
"RW")
775 sprintf(valBuf,
"%g", (
double)value);
777 sprintf(rangeBuf,
"%g %g", minVal, maxVal);
779 access, desc, rangeBuf);
799 const char access[] =
"RW")
803 sprintf(valBuf,
"%g", (
double)value);
805 sprintf(rangeBuf,
"%g %g %g %g", minVal, maxVal, minTypicalVal,
808 access, desc, rangeBuf);
822 bool value,
const char desc[],
const char range[] =
"",
823 const char access[] =
"RW")
827 (value ?
"1" :
"0"), access, desc, range);
841 const char value[],
const char desc[],
const char range[] =
"",
842 const char access[] =
"RW") {
845 access, desc, range);
859 const char value[],
const char desc[],
const char range[] =
"",
860 const char access[] =
"RW") {
863 access, desc, range);
882 const char value[],
const bool createIfNotExists =
true) {
899 const char *
const vals[] = {
903 "BigEndian|LittleEndian"
905 const int n = (big ? 2 : 0) + (little ? 1 : 0);
931 const bool unstructured,
const bool prismatic) {
932 const char *
const vals[] = {
936 "Structured|Unstructured",
938 "Structured|Prismatic",
939 "Unstructured|Prismatic",
940 "Structured|Unstructured|Prismatic",
942 const int n = (prismatic ? 4 : 0) + (unstructured ? 2 : 0) +
943 (structured ? 1 : 0);
944 return assignInfoValue(rti,
"AllowedElementTopologies", vals[n],
true);
1109 if (
nullptr !=
rti_.
fp) {
1149 #if !defined(PWGM_HIDE_UNSTRUCTURED_API)
1182 #if !defined(PWGM_HIDE_STRUCTURED_API)
1210 #endif // _CAEPLUGIN_H_
PWP_VERSION libVer
software library release version
static bool publishIntValueDef(CAEP_RTITEM &rti, const char key[], PWP_INT value, const char desc[], const char access[]="RW")
Publish a PWP_INT CAE attribute definition without a range.
PWP_UINT32 progMajorSteps_
# of major export steps.
const char * encodingStr() const
Get a string representation of the requested data encoding.
@ PWP_VALTYPE_STRING
transfer value is a const char*
Grid element handle declaration.
static bool assignInfoValue(CAEP_RTITEM &rti, const char key[], const char value[], const bool createIfNotExists=true)
Set a CAE plugin info value.
CaePlugin< CaeUnsGridModel > CaeUnsPlugin
PWP_ENUM_PRECISION precision() const
Get the export's requested numerical precision.
CaePlugin(CAEP_RTITEM *pRti, PWGM_HGRIDMODEL model, const CAEP_WRITEINFO *pWriteInfo)
Template constructor.
PwpFile & runtimeFile()
Get the runtime file object.
static bool allowElementTopologies(CAEP_RTITEM &rti, const bool structured, const bool unstructured, const bool prismatic)
Set the "AllowedElementTopologies" CAE plugin info value.
#define CAEPU_RT_ENCODING_TEXT(rti)
Get the export precision text from CAEP_RTITEM data pointed to by rti.
const char * exportDestination() const
Get the requested file destination string.
const char * copyright
copyright description
PWP_ENUM_VALTYPE
Supported PWP-API getValue() transfer types.
const CAEP_WRITEINFO & writeInfo_
The export options.
const PwpFile & runtimeFile() const
Get the runtime file object.
PWU_RTITEM * pApiData
Pointer to the associated PWU_RTITEM structure.
bool progressIncrement() const
Indicates the completion of a progress sub step within the current major step.
static PWP_VERSIONVAL getInfo(PWP_PLUGININFO &pluginInfo)
Get information about this plugin.
FILE * fp() const
Get the FILE pointer wrapped by the runtime file object.
The data representing a CAE exporter instance.
void sendDebugMsg(const char *msg, PWP_UINT32 id=0) const
Send a debug message.
static PWP_VERSION getVersion()
Get the plugin's release version.
static bool isValid(H h)
Check if a handle is valid.
PWP_BOOL PwpIsLicensed(const char api[], const PWP_LICENSEDATA *pLicenseData)
Determines if plugin api is licensed for use on this machine.
virtual PWP_BOOL write()=0
Called once by run() to perform the export logic.
static bool publishUIntValueDef(CAEP_RTITEM &rti, const char key[], PWP_UINT value, const char desc[], PWP_UINT minVal, PWP_UINT maxVal, const char access[]="RW")
Publish a PWP_UINT CAE attribute definition with a min and max range.
PWP_BOOL caeuProgressIncr(CAEP_RTITEM *pRti)
Completes a progress tracking sub-step.
static bool useCustomIndexing(CAEP_RTITEM &rti)
Sets the "IndexScheme" CAE plugin info value to "Custom".
PwpFile rtFile_
runtime file object
bool isLittleEndian() const
Check if little endian byte ordering is requested.
An opaque handle to a grid model.
PWP_BOOL caeuProgressEndStep(CAEP_RTITEM *pRti)
Completes a progress tracking major step.
bool isBigEndian() const
Check if big endian byte ordering is requested.
PWP_VERSIONVAL PwpGetPluginInfo(PWP_PLUGININFO *pInfo)
Get information about this plugin.
PWP_ENDIANNESS PwuGetOsEndianness(void)
Query the OS's native endianness.
const char * dimensionStr() const
Get a string representation of the requested data dimensionality.
void caeuSendInfoMsg(CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
Send an info text message (PWP_MSGID_INFO) to the framework.
PWP_ENUM_PRECISION precision
export precision.
void caeuSendDebugMsg(CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
Send a debug text message (PWP_MSGID_DEBUG) to the framework.
static bool publishUIntValueDef(CAEP_RTITEM &rti, const char key[], PWP_UINT value, const char desc[], const char access[]="RW")
Publish a PWP_UINT CAE attribute definition without a range.
bool isDimension2D() const
Check if 2D is requested.
static bool publishRealValueDef(CAEP_RTITEM &rti, const char key[], PWP_REAL value, const char desc[], const char access[]="RW")
Publish a PWP_REAL CAE attribute definition without a range.
PWP_UINT32 BCCnt
The number of BC definitions.
Pointwise Grid Model API Specification (PWGM-API)
FILE * fp() const
Get the FILE pointer.
static bool allowByteOrders(CAEP_RTITEM &rti, const bool big, const bool little)
Set the "AllowedFileByteOrders" CAE plugin info value.
PWP_ENUM_ENCODING
File encoding values.
static bool isValid(PWGM_HELEMENT h)
Check if an element handle is valid.
bool wrap(FILE *fp, std::string filename=std::string(), int mode=0)
Take ownership of fp opened using pwpFileOpen(filename, mode).
const char * author
company/author description
PWP_BOOL caeuProgressBeginStep(CAEP_RTITEM *pRti, PWP_UINT32 total)
Begins a progress tracking step.
PWP_ENDIANNESS byteOrder
export byte order.
PWP_VERSION pwpVer
plugin conforms to this PWP-API version
void caeuSendErrorMsg(CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
Send an error text message (PWP_MSGID_ERROR) to the framework.
CaePlugin & operator=(const CaePlugin &rhs)
Private assignment operator.
#define CAEPU_RT_DIM_TEXT(rti)
Get the export dimension text from CAEP_RTITEM data pointed to by rti.
#define PWP_HEGRP_ISVALID(h)
Test the validity of a PWP_DECLARE_HELEMGROUP() handle.
@ PWP_VALTYPE_REAL
transfer value is a PWP_REAL
PWP_BOOL caeuAssignInfoValue(const char key[], const char value[], bool createIfNotExists)
Creates a key/value pair that defines a CAE info attribute.
static bool meshLinkSupported(CAEP_RTITEM &rti, const bool on)
Set the "MeshLinkSupported" CAE plugin info value.
void sendWarningMsg(const char *msg, PWP_UINT32 id=0) const
Send a warning message.
PWP_ENUM_ENCODING encoding
export file encoding.
virtual ~CaePlugin()
Destructor.
virtual bool endExport()
Called once by run() at the end of an export sequence.
static PWP_VERSION getApiVersion()
Get the plugin's API version.
static bool publishBoolValueDef(CAEP_RTITEM &rti, const char key[], bool value, const char desc[], const char range[]="", const char access[]="RW")
Publish a boolean CAE attribute definition.
static bool publishUIntValueDef(CAEP_RTITEM &rti, const char key[], PWP_UINT value, const char desc[], PWP_UINT minVal, PWP_UINT maxVal, PWP_UINT minTypicalVal, PWP_UINT maxTypicalVal, const char access[]="RW")
Publish a PWP_UINT CAE attribute definition with a min and max range and a typical min and max range.
CAEP_RTITEM & rti_
The plugin's runtime item data.
Pointwise CAE Plugin API (CAEP-API)
static bool shadowBcTypes(CAEP_RTITEM &rti, const char *const shadowTypes)
Set the "ShadowBcTypes" CAE plugin info value.
void sendInfoMsg(const char *msg, PWP_UINT32 id=0) const
Send an information message.
bool aborted() const
Check if an export has been aborted.
The API information returned by plugins for each supported API.
static bool publishRealValueDef(CAEP_RTITEM &rti, const char key[], PWP_REAL value, const char desc[], PWP_REAL minVal, PWP_REAL maxVal, PWP_REAL minTypicalVal, PWP_REAL maxTypicalVal, const char access[]="RW")
Publish a PWP_REAL CAE attribute definition with a min and max range and a typical min and max range.
PWP_VOID PwpSetLanguage(const char language[])
Sets the active language.
bool isDimension3D() const
Check if 3D is requested.
const char * precisionStr() const
Get a string representation of the requested data precision.
const MT & model() const
Get the grid model object.
PWP_ENUM_DIMENSION dimension
export dimensionality.
void caeuSendWarningMsg(CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
Send a warning text message (PWP_MSGID_WARNING) to the framework.
PWP_ENUM_DIMENSION dimension() const
Get the export's requested dimensionality.
const char * support
support description (phone, web-link).
CaePlugin< CaeStrGridModel > CaeStrPlugin
static const char * getAuthorInfo()
Get the plugin's author description string.
Provides general information about a plugin.
static bool publishStringValueDef(CAEP_RTITEM &rti, const char key[], const char value[], const char desc[], const char range[]="", const char access[]="RW")
Publish a string CAE attribute definition.
static bool publishIntValueDef(CAEP_RTITEM &rti, const char key[], PWP_INT value, const char desc[], PWP_INT minVal, PWP_INT maxVal, const char access[]="RW")
Publish a PWP_INT CAE attribute definition with a min and max range.
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.
bool isLicensed(const PWP_LICENSEDATA &license) const
Check if license data is valid.
static bool publishValueDef(CAEP_RTITEM &rti, const char key[], PWP_ENUM_VALTYPE type, const char value[], const char desc[], const char range[]="", const char access[]="RW")
Publish a typed CAE attribute definition.
PWP_ENDIANNESS
Flags used to indicate endianness or control endian behaviors in functions.
PWP_BOOL conditionsOnly
Set to PWP_TRUE if only Conditions exported.
PWP_ENDIANNESS setByteOrder(PWP_ENDIANNESS order)
Set the byte order used for writes.
PWP_ENUM_PRECISION setPrecision(PWP_ENUM_PRECISION precision)
Set the floating point precision used for writes.
@ PWP_VALTYPE_BOOL
transfer value is a PWP_BOOL
PWP_UINT32 PWP_VERSIONVAL
Version data component value.
@ PWP_VALTYPE_INT
transfer value is a PWP_INT
bool isBinaryEncoding() const
Check if binary encoding is requested.
void setProgressMajorSteps(PWP_UINT32 steps)
Set the number of major export steps.
MT model_
The grid model being exported.
bool isUnformattedEncoding() const
Check if FORTRAN unformatted encoding is requested.
static PWP_ENDIANNESS mapToBigLittle(PWP_ENDIANNESS byteOrder)
Map a byte ordering value to PWP_ENDIAN_BIG or PWP_ENDIAN_LITTLE based on getOsByteOrder().
bool progressEndStep() const
Indicates the end of a major progress step.
bool isAsciiEncoding() const
Check if ascii encoding is requested.
bool conditionsOnly() const
Check if only BCs are to be exported.
CAE export write control information.
virtual bool beginExport()
Called once by run() at the start of an export sequence.
void setLanguage(const char language[])
Set the active language.
void wrapRuntimeFile()
Pass ownership of the runtime FILE pointer to a PwpFile object.
PWP_APIINFO apiInfo
The PWP-API instance information.
@ PWP_ENCODING_UNFORMATTED
PWP_ENDIANNESS byteOrder() const
Get the export's requested byte order.
@ PWP_VALTYPE_ENUM
transfer value is a const char*
const char * fileDest
requested file destination.
const CAEP_FORMATINFO & formatInfo() const
Get the plugin's export format settings.
static bool useOneBasedIndexing(CAEP_RTITEM &rti)
Sets the "IndexScheme" CAE plugin info value to "OneBased".
Pointwise Plugin API (PWP-API)
static bool publishIntValueDef(CAEP_RTITEM &rti, const char key[], PWP_INT value, const char desc[], PWP_INT minVal, PWP_INT maxVal, PWP_INT minTypicalVal, PWP_INT maxTypicalVal, const char access[]="RW")
Publish a PWP_INT CAE attribute definition with a min and max range and a typical min and max range.
PWP_ENUM_ENCODING encoding() const
Get the export's requested data encoding.
CAEP_FORMATINFO FormatInfo
The CAE Plugin format data.
static const char * getSupportInfo()
Get the plugin's support description string.
bool isDoublePrecision() const
Check if double numerical precision is requested.
PWP_ENUM_DIMENSION
Supported dimensionality values.
@ PWP_VALTYPE_UINT
transfer value is a PWP_UINT
static bool publishEnumValueDef(CAEP_RTITEM &rti, const char key[], const char value[], const char desc[], const char range[]="", const char access[]="RW")
Publish an enumerated CAE attribute definition.
static const char * getCopyrightInfo()
Get the plugin's copyright description string.
static bool useZeroBasedIndexing(CAEP_RTITEM &rti)
Sets the "IndexScheme" CAE plugin info value to "ZeroBased".
FILE * fp
Runtime FILE pointer.
static PWP_ENDIANNESS getOsEndianness()
Query the OS's native endianness.
Installation's license data. NOT IMPLEMENTED YET.
static bool publishRealValueDef(CAEP_RTITEM &rti, const char key[], PWP_REAL value, const char desc[], PWP_REAL minVal, PWP_REAL maxVal, const char access[]="RW")
Publish a PWP_REAL CAE attribute definition with a min and max range.
const PWP_APIINFO & apiInfo() const
Get the plugin's API settings.
MT & model()
Get the grid model object.
#define CAEPU_RT_PREC_TEXT(rti)
Get the export precision text from CAEP_RTITEM data pointed to by rti.
void sendErrorMsg(const char *msg, PWP_UINT32 id=0) const
Send an error message.
PWP_ENUM_PRECISION
File precision values.
const char * name
full API spec name
bool progressBeginStep(PWP_UINT32 steps) const
Indicates the start of a major progress step.
#define PWGM_HELEMENT_ISVALID(h)
returns non-zero value if handle is valid
PWP_BOOL run()
Starts the export sequence.
bool isSinglePrecision() const
Check if single numerical precision is requested.