Pointwise Plugin SDK
CaePlugin.h
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * CAEP Plugin example - PwCaeGridWrite implementation
4  *
5  * (C) 2021 Cadence Design Systems, Inc. All rights reserved worldwide.
6  *
7  ***************************************************************************/
8 
9 
10 #ifndef _CAEPLUGIN_H_
11 #define _CAEPLUGIN_H_
12 
13 #include "apiCAEP.h"
14 #include "apiCAEPUtils.h"
15 #include "apiGridModel.h"
16 #include "apiPWP.h"
17 #include "PwpFile.h"
18 
19 
27 template< typename MT >
28 class CaePlugin {
29 public:
30 
32 
42  *pWriteInfo);
43 
45  virtual ~CaePlugin();
46 
48 
58  PWP_BOOL run();
59 
61 
64  MT & model() {
65  return model_;
66  }
67 
69 
72  const MT & model() const {
73  return model_;
74  }
75 
77 
84  const PwpFile & runtimeFile() const {
86  return rtFile_;
87  }
88 
90  return rtFile_;
91  }
93 
95 
99  FILE * fp() const {
100  return rtFile_.fp();
101  }
102 
104 
113  const char * exportDestination() const {
114  return writeInfo_.fileDest;
115  }
116 
118 
123  const CAEP_FORMATINFO & formatInfo() const {
124  return rti_.FormatInfo;
125  }
126 
128 
132  const PWP_APIINFO & apiInfo() const {
133  return rti_.pApiData->apiInfo;
134  }
135 
152 
155 
191  // Do not allow zero
192  progMajorSteps_ = (steps ? steps : 1);
193  }
194 
196 
204  bool progressBeginStep(PWP_UINT32 steps) const {
205  return 0 != caeuProgressBeginStep(&rti_, steps);
206  }
207 
210 
217  bool progressIncrement() const {
218  return 0 != caeuProgressIncr(&rti_);
219  }
220 
222 
229  bool progressEndStep() const {
230  return 0 != caeuProgressEndStep(&rti_);
231  }
233 
244 
247 
253  void sendInfoMsg(const char *msg, PWP_UINT32 id = 0) const {
254  caeuSendInfoMsg(&rti_, msg, id);
255  }
256 
258 
264  void sendDebugMsg(const char *msg, PWP_UINT32 id = 0) const {
265  caeuSendDebugMsg(&rti_, msg, id);
266  }
267 
269 
275  void sendWarningMsg(const char *msg, PWP_UINT32 id = 0) const {
276  caeuSendWarningMsg(&rti_, msg, id);
277  }
278 
280 
285  void sendErrorMsg(const char *msg, PWP_UINT32 id = 0) const {
286  caeuSendErrorMsg(&rti_, msg, id);
287  }
289 
291 
296  bool aborted() const {
297  return 0 != rti_.opAborted;
298  }
299 
305 
308 
311  bool conditionsOnly() const {
312  return 0 != writeInfo_.conditionsOnly;
313  }
314 
316 
320  return writeInfo_.precision;
321  }
322 
324 
327  bool isSinglePrecision() const {
328  return PWP_PRECISION_SINGLE == precision();
329  }
330 
332 
335  bool isDoublePrecision() const {
336  return PWP_PRECISION_DOUBLE == precision();
337  }
338 
340 
343  const char * precisionStr() const {
344  return CAEPU_RT_PREC_TEXT(&rti_);
345  }
346 
348 
353  return writeInfo_.encoding;
354  }
355 
357 
360  bool isAsciiEncoding() const {
361  return PWP_ENCODING_ASCII == encoding();
362  }
363 
365 
368  bool isBinaryEncoding() const {
369  return PWP_ENCODING_BINARY == encoding();
370  }
371 
373 
376  bool isUnformattedEncoding() const {
378  }
379 
381 
384  const char * encodingStr() const {
385  return CAEPU_RT_ENCODING_TEXT(&rti_);
386  }
387 
389 
393  return writeInfo_.dimension;
394  }
395 
397 
400  bool isDimension3D() const {
401  return PWP_DIMENSION_3D == dimension();
402  }
403 
405 
408  bool isDimension2D() const {
409  return PWP_DIMENSION_2D == dimension();
410  }
411 
413 
416  const char * dimensionStr() const {
417  return CAEPU_RT_DIM_TEXT(&rti_);
418  }
419 
421 
425  // Force return to be one of PWP_ENDIAN_LITTLE or PWP_ENDIAN_BIG
427  }
428 
430 
433  bool isBigEndian() const {
434  return PWP_ENDIAN_BIG == byteOrder();
435  }
436 
438 
441  bool isLittleEndian() const {
442  return PWP_ENDIAN_LITTLE == byteOrder();
443  }
445 
447 
452  bool isLicensed(const PWP_LICENSEDATA &license) const {
453  return 0 != PwpIsLicensed(rti_.pApiData->apiInfo.name, &license);
454  }
455 
457 
465  void setLanguage(const char language[]) {
466  return PwpSetLanguage(language);
467  }
468 
470 
474  return PwuGetOsEndianness();
475  }
476 
478 
482  static PWP_VERSIONVAL getInfo(PWP_PLUGININFO &pluginInfo) {
483  return PwpGetPluginInfo(&pluginInfo);
484  }
485 
487 
491  PWP_PLUGININFO info;
492  PwpGetPluginInfo(&info);
493  return info.pwpVer;
494  }
495 
497 
501  PWP_PLUGININFO info;
502  PwpGetPluginInfo(&info);
503  return info.libVer;
504  }
505 
507 
510  static const char * getAuthorInfo() {
511  PWP_PLUGININFO info;
512  PwpGetPluginInfo(&info);
513  return info.author;
514  }
515 
517 
520  static const char * getSupportInfo() {
521  PWP_PLUGININFO info;
522  PwpGetPluginInfo(&info);
523  return info.support;
524  }
525 
527 
530  static const char * getCopyrightInfo() {
531  PWP_PLUGININFO info;
532  PwpGetPluginInfo(&info);
533  return info.copyright;
534  }
535 
537 
541  template< typename H >
542  static bool isValid(H h) {
543  return PWP_HEGRP_ISVALID(h);
544  }
545 
547 
551  static bool isValid(PWGM_HELEMENT h) {
552  return PWGM_HELEMENT_ISVALID(h);
553  }
554 
562 
565 
586  static bool publishValueDef(CAEP_RTITEM &rti, const char key[],
587  PWP_ENUM_VALTYPE type, const char value[], const char desc[],
588  const char range[] = "", const char access[] = "RW") {
589  (void)rti.BCCnt; // silence unused arg warning
590  return 0 != caeuPublishValueDefinition(key, type, value, access,
591  desc, range);
592  }
593 
595 
603  static bool publishUIntValueDef(CAEP_RTITEM &rti, const char key[],
604  PWP_UINT value, const char desc[], const char access[] = "RW")
605  {
606  (void)rti.BCCnt; // silence unused arg warning
607  char valBuf[64];
608  sprintf(valBuf, "%lu", (unsigned long)value);
609  return 0 != caeuPublishValueDefinition(key, PWP_VALTYPE_UINT, valBuf,
610  access, desc, "");
611  }
612 
614 
624  static bool publishUIntValueDef(CAEP_RTITEM &rti, const char key[],
625  PWP_UINT value, const char desc[], PWP_UINT minVal, PWP_UINT maxVal,
626  const char access[] = "RW")
627  {
628  (void)rti.BCCnt; // silence unused arg warning
629  char valBuf[64];
630  sprintf(valBuf, "%lu", (unsigned long)value);
631  char rangeBuf[128];
632  sprintf(rangeBuf, "%lu %lu", (unsigned long)minVal,
633  (unsigned long)maxVal);
634  return 0 != caeuPublishValueDefinition(key, PWP_VALTYPE_UINT, valBuf,
635  access, desc, rangeBuf);
636  }
637 
640 
652  static bool publishUIntValueDef(CAEP_RTITEM &rti, const char key[],
653  PWP_UINT value, const char desc[], PWP_UINT minVal, PWP_UINT maxVal,
654  PWP_UINT minTypicalVal, PWP_UINT maxTypicalVal,
655  const char access[] = "RW")
656  {
657  (void)rti.BCCnt; // silence unused arg warning
658  char valBuf[64];
659  sprintf(valBuf, "%lu", (unsigned long)value);
660  char rangeBuf[128];
661  sprintf(rangeBuf, "%lu %lu %lu %lu", (unsigned long)minVal,
662  (unsigned long)maxVal, (unsigned long)minTypicalVal,
663  (unsigned long)maxTypicalVal);
664  return 0 != caeuPublishValueDefinition(key, PWP_VALTYPE_UINT, valBuf,
665  access, desc, rangeBuf);
666  }
667 
669 
677  static bool publishIntValueDef(CAEP_RTITEM &rti, const char key[],
678  PWP_INT value, const char desc[], const char access[] = "RW")
679  {
680  (void)rti.BCCnt; // silence unused arg warning
681  char valBuf[64];
682  sprintf(valBuf, "%ld", (long)value);
683  return 0 != caeuPublishValueDefinition(key, PWP_VALTYPE_INT, valBuf,
684  access, desc, "");
685  }
686 
688 
698  static bool publishIntValueDef(CAEP_RTITEM &rti, const char key[],
699  PWP_INT value, const char desc[], PWP_INT minVal, PWP_INT maxVal,
700  const char access[] = "RW")
701  {
702  (void)rti.BCCnt; // silence unused arg warning
703  char valBuf[64];
704  sprintf(valBuf, "%ld", (long)value);
705  char rangeBuf[128];
706  sprintf(rangeBuf, "%ld %ld", (long)minVal, (long)maxVal);
707  return 0 != caeuPublishValueDefinition(key, PWP_VALTYPE_INT, valBuf,
708  access, desc, rangeBuf);
709  }
710 
713 
725  static bool publishIntValueDef(CAEP_RTITEM &rti, const char key[],
726  PWP_INT value, const char desc[], PWP_INT minVal, PWP_INT maxVal,
727  PWP_INT minTypicalVal, PWP_INT maxTypicalVal,
728  const char access[] = "RW")
729  {
730  (void)rti.BCCnt; // silence unused arg warning
731  char valBuf[64];
732  sprintf(valBuf, "%ld", (long)value);
733  char rangeBuf[128];
734  sprintf(rangeBuf, "%ld %ld %ld %ld", (long)minVal, (long)maxVal,
735  (long)minTypicalVal, (long)maxTypicalVal);
736  return 0 != caeuPublishValueDefinition(key, PWP_VALTYPE_INT, valBuf,
737  access, desc, rangeBuf);
738  }
739 
741 
749  static bool publishRealValueDef(CAEP_RTITEM &rti, const char key[],
750  PWP_REAL value, const char desc[], const char access[] = "RW")
751  {
752  (void)rti.BCCnt; // silence unused arg warning
753  char valBuf[64];
754  sprintf(valBuf, "%g", (double)value);
755  return 0 != caeuPublishValueDefinition(key, PWP_VALTYPE_REAL, valBuf,
756  access, desc, "");
757  }
758 
760 
770  static bool publishRealValueDef(CAEP_RTITEM &rti, const char key[],
771  PWP_REAL value, const char desc[], PWP_REAL minVal, PWP_REAL maxVal,
772  const char access[] = "RW")
773  {
774  (void)rti.BCCnt; // silence unused arg warning
775  char valBuf[64];
776  sprintf(valBuf, "%g", (double)value);
777  char rangeBuf[128];
778  sprintf(rangeBuf, "%g %g", minVal, maxVal);
779  return 0 != caeuPublishValueDefinition(key, PWP_VALTYPE_REAL, valBuf,
780  access, desc, rangeBuf);
781  }
782 
785 
797  static bool publishRealValueDef(CAEP_RTITEM &rti, const char key[],
798  PWP_REAL value, const char desc[], PWP_REAL minVal, PWP_REAL maxVal,
799  PWP_REAL minTypicalVal, PWP_REAL maxTypicalVal,
800  const char access[] = "RW")
801  {
802  (void)rti.BCCnt; // silence unused arg warning
803  char valBuf[64];
804  sprintf(valBuf, "%g", (double)value);
805  char rangeBuf[128];
806  sprintf(rangeBuf, "%g %g %g %g", minVal, maxVal, minTypicalVal,
807  maxTypicalVal);
808  return 0 != caeuPublishValueDefinition(key, PWP_VALTYPE_REAL, valBuf,
809  access, desc, rangeBuf);
810  }
811 
813 
822  static bool publishBoolValueDef(CAEP_RTITEM &rti, const char key[],
823  bool value, const char desc[], const char range[] = "",
824  const char access[] = "RW")
825  {
826  (void)rti.BCCnt; // silence unused arg warning
828  (value ? "1" : "0"), access, desc, range);
829  }
830 
832 
841  static bool publishStringValueDef(CAEP_RTITEM &rti, const char key[],
842  const char value[], const char desc[], const char range[] = "",
843  const char access[] = "RW") {
844  (void)rti.BCCnt; // silence unused arg warning
845  return 0 != caeuPublishValueDefinition(key, PWP_VALTYPE_STRING, value,
846  access, desc, range);
847  }
848 
850 
859  static bool publishEnumValueDef(CAEP_RTITEM &rti, const char key[],
860  const char value[], const char desc[], const char range[] = "",
861  const char access[] = "RW") {
862  (void)rti.BCCnt; // silence unused arg warning
863  return 0 != caeuPublishValueDefinition(key, PWP_VALTYPE_ENUM, value,
864  access, desc, range);
865  }
866 
868 
882  static bool assignInfoValue(CAEP_RTITEM &rti, const char key[],
883  const char value[], const bool createIfNotExists = true) {
884  (void)rti.BCCnt; // silence unused arg warning
885  return 0 != caeuAssignInfoValue(key, value, createIfNotExists);
886  }
887 
889 
898  static bool allowByteOrders(CAEP_RTITEM &rti, const bool big,
899  const bool little) {
900  const char * const vals[] = {
901  /* 0 */ 0, // erase "AllowedFileByteOrders" info value
902  /* 1 */ "LittleEndian",
903  /* 2 */ "BigEndian",
904  /* 3 */ "BigEndian|LittleEndian"
905  };
906  const int n = (big ? 2 : 0) + (little ? 1 : 0);
907  return assignInfoValue(rti, "AllowedFileByteOrders", vals[n], true);
908  }
909 
911 
931  static bool allowElementTopologies(CAEP_RTITEM &rti, const bool structured,
932  const bool unstructured, const bool prismatic) {
933  const char * const vals[] = {
934  /* 0 */ 0, // erase "AllowedElementTopologies" info value
935  /* 1 */ "Structured",
936  /* 2 */ "Unstructured",
937  /* 3 */ "Structured|Unstructured",
938  /* 4 */ "Prismatic",
939  /* 5 */ "Structured|Prismatic",
940  /* 6 */ "Unstructured|Prismatic",
941  /* 7 */ "Structured|Unstructured|Prismatic",
942  };
943  const int n = (prismatic ? 4 : 0) + (unstructured ? 2 : 0) +
944  (structured ? 1 : 0);
945  return assignInfoValue(rti, "AllowedElementTopologies", vals[n], true);
946  }
947 
949 
962  static bool meshLinkSupported(CAEP_RTITEM &rti, const bool on) {
963  return assignInfoValue(rti, "MeshLinkSupported", (on ? "1" : "0"));
964  }
965 
967 
978  static bool useZeroBasedIndexing(CAEP_RTITEM &rti) {
979  return assignInfoValue(rti, "IndexScheme", "ZeroBased");
980  }
981 
983 
994  static bool useOneBasedIndexing(CAEP_RTITEM &rti) {
995  return assignInfoValue(rti, "IndexScheme", "OneBased");
996  }
997 
999 
1020  static bool useCustomIndexing(CAEP_RTITEM &rti) {
1021  return assignInfoValue(rti, "IndexScheme", "Custom");
1022  }
1023 
1025 
1040  static bool shadowBcTypes(CAEP_RTITEM &rti, const char * const shadowTypes)
1041  {
1042  return assignInfoValue(rti, "ShadowBcTypes", shadowTypes, true);
1043  }
1045 
1046 private:
1047 
1049 
1058  virtual bool beginExport()
1059  {
1060  return true;
1061  }
1062 
1064 
1070  virtual PWP_BOOL write() = 0;
1071 
1073 
1081  virtual bool endExport()
1082  {
1083  return true;
1084  }
1085 
1087  CaePlugin(const CaePlugin &src);
1088 
1090  CaePlugin & operator=(const CaePlugin &rhs);
1091 
1093 
1110  if (nullptr != rti_.fp) {
1111  int mode = 0;
1112  switch (encoding()) {
1113  case PWP_ENCODING_ASCII:
1114  mode = pwpWrite | pwpAscii;
1115  break;
1116  case PWP_ENCODING_BINARY:
1117  mode = pwpWrite | pwpBinary;
1118  break;
1120  mode = pwpWrite | pwpUnformatted;
1121  break;
1122  default:
1123  break;
1124  }
1125  rtFile_.wrap(rti_.fp, exportDestination(), mode);
1126  rti_.fp = nullptr; // rtFile_ now owns rti_.fp
1127  }
1128  else {
1129  rtFile_.wrap(nullptr);
1130  }
1133  }
1134 
1135 protected:
1137  MT model_;
1141 };
1142 
1143 #include "CaePluginImpl.h"
1144 
1145 
1146 //***************************************************************************
1147 //***************************************************************************
1148 //***************************************************************************
1149 
1150 #if !defined(PWGM_HIDE_UNSTRUCTURED_API)
1151 #include "CaeUnsGridModel.h"
1152 
1176 #endif
1177 
1178 
1179 //***************************************************************************
1180 //***************************************************************************
1181 //***************************************************************************
1182 
1183 #if !defined(PWGM_HIDE_STRUCTURED_API)
1184 #include "CaeStrGridModel.h"
1185 
1209 #endif
1210 
1211 #endif // _CAEPLUGIN_H_
PWP_PLUGININFO::libVer
PWP_VERSION libVer
software library release version
Definition: apiPWP.h:670
CaePlugin::publishIntValueDef
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.
Definition: CaePlugin.h:677
CaePlugin::progMajorSteps_
PWP_UINT32 progMajorSteps_
# of major export steps.
Definition: CaePlugin.h:1139
CaePlugin::encodingStr
const char * encodingStr() const
Get a string representation of the requested data encoding.
Definition: CaePlugin.h:384
PWP_VALTYPE_STRING
@ PWP_VALTYPE_STRING
transfer value is a const char*
Definition: apiPWP.h:697
CaePlugin
Definition: CaePlugin.h:28
PWGM_HELEMENT
Grid element handle declaration.
Definition: apiGridModel.h:427
pwpBinary
@ pwpBinary
Definition: pwpPlatform.h:89
CaePlugin::assignInfoValue
static bool assignInfoValue(CAEP_RTITEM &rti, const char key[], const char value[], const bool createIfNotExists=true)
Set a CAE plugin info value.
Definition: CaePlugin.h:882
CaeUnsPlugin
CaePlugin< CaeUnsGridModel > CaeUnsPlugin
Definition: CaePlugin.h:1175
CaePlugin::precision
PWP_ENUM_PRECISION precision() const
Get the export's requested numerical precision.
Definition: CaePlugin.h:319
CaePlugin::CaePlugin
CaePlugin(CAEP_RTITEM *pRti, PWGM_HGRIDMODEL model, const CAEP_WRITEINFO *pWriteInfo)
Template constructor.
Definition: CaePluginImpl.h:17
CaePlugin::runtimeFile
PwpFile & runtimeFile()
Get the runtime file object.
Definition: CaePlugin.h:89
CaePlugin::allowElementTopologies
static bool allowElementTopologies(CAEP_RTITEM &rti, const bool structured, const bool unstructured, const bool prismatic)
Set the "AllowedElementTopologies" CAE plugin info value.
Definition: CaePlugin.h:931
PWP_PRECISION_DOUBLE
@ PWP_PRECISION_DOUBLE
Definition: apiPWP.h:804
CAEPU_RT_ENCODING_TEXT
#define CAEPU_RT_ENCODING_TEXT(rti)
Get the export precision text from CAEP_RTITEM data pointed to by rti.
Definition: apiCAEPUtils.h:834
PWP_DIMENSION_3D
@ PWP_DIMENSION_3D
Definition: apiPWP.h:765
CaePlugin::exportDestination
const char * exportDestination() const
Get the requested file destination string.
Definition: CaePlugin.h:113
PWP_PLUGININFO::copyright
const char * copyright
copyright description
Definition: apiPWP.h:679
PWP_ENUM_VALTYPE
PWP_ENUM_VALTYPE
Supported PWP-API getValue() transfer types.
Definition: apiPWP.h:696
CaePlugin::writeInfo_
const CAEP_WRITEINFO & writeInfo_
The export options.
Definition: CaePlugin.h:1138
CaePlugin::runtimeFile
const PwpFile & runtimeFile() const
Get the runtime file object.
Definition: CaePlugin.h:85
PWP_UINT32
unsigned int PWP_UINT32
32-bit unsigned integer
Definition: apiPWP.h:210
CAEP_RTITEM::pApiData
PWU_RTITEM * pApiData
Pointer to the associated PWU_RTITEM structure.
Definition: apiCAEPUtils.h:133
CaePlugin::progressIncrement
bool progressIncrement() const
Indicates the completion of a progress sub step within the current major step.
Definition: CaePlugin.h:217
CaePlugin::getInfo
static PWP_VERSIONVAL getInfo(PWP_PLUGININFO &pluginInfo)
Get information about this plugin.
Definition: CaePlugin.h:482
CaePlugin::fp
FILE * fp() const
Get the FILE pointer wrapped by the runtime file object.
Definition: CaePlugin.h:99
CAEP_RTITEM
The data representing a CAE exporter instance.
Definition: apiCAEPUtils.h:124
CaePlugin::sendDebugMsg
void sendDebugMsg(const char *msg, PWP_UINT32 id=0) const
Send a debug message.
Definition: CaePlugin.h:264
CaePlugin::getVersion
static PWP_VERSION getVersion()
Get the plugin's release version.
Definition: CaePlugin.h:500
CaePlugin::isValid
static bool isValid(H h)
Check if a handle is valid.
Definition: CaePlugin.h:542
PWP_ENDIAN_BIG
@ PWP_ENDIAN_BIG
Definition: apiPWP.h:827
PwpIsLicensed
PWP_BOOL PwpIsLicensed(const char api[], const PWP_LICENSEDATA *pLicenseData)
Determines if plugin api is licensed for use on this machine.
Definition: apiPWP.cxx:110
CaePluginImpl.h
CaePlugin::write
virtual PWP_BOOL write()=0
Called once by run() to perform the export logic.
CaePlugin::publishUIntValueDef
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.
Definition: CaePlugin.h:624
pwpUnformatted
@ pwpUnformatted
Definition: pwpPlatform.h:93
CAEP_FORMATINFO
The information returned for each supported CAEP exporter.
Definition: apiCAEP.h:98
caeuProgressIncr
PWP_BOOL caeuProgressIncr(CAEP_RTITEM *pRti)
Completes a progress tracking sub-step.
Definition: apiCAEPUtils.cxx:89
CaePlugin::useCustomIndexing
static bool useCustomIndexing(CAEP_RTITEM &rti)
Sets the "IndexScheme" CAE plugin info value to "Custom".
Definition: CaePlugin.h:1020
CaePlugin::rtFile_
PwpFile rtFile_
runtime file object
Definition: CaePlugin.h:1140
CaePlugin::isLittleEndian
bool isLittleEndian() const
Check if little endian byte ordering is requested.
Definition: CaePlugin.h:441
PWGM_HGRIDMODEL
An opaque handle to a grid model.
Definition: apiGridModel.h:326
caeuProgressEndStep
PWP_BOOL caeuProgressEndStep(CAEP_RTITEM *pRti)
Completes a progress tracking major step.
Definition: apiCAEPUtils.cxx:146
CaePlugin::isBigEndian
bool isBigEndian() const
Check if big endian byte ordering is requested.
Definition: CaePlugin.h:433
PwpGetPluginInfo
PWP_VERSIONVAL PwpGetPluginInfo(PWP_PLUGININFO *pInfo)
Get information about this plugin.
Definition: apiPWP.cxx:92
PWP_UINT
PWP_UINT32 PWP_UINT
unsigned integer same size as void*
Definition: apiPWP.h:285
PwuGetOsEndianness
PWP_ENDIANNESS PwuGetOsEndianness(void)
Query the OS's native endianness.
Definition: apiPWPUtils.cxx:218
CaePlugin::dimensionStr
const char * dimensionStr() const
Get a string representation of the requested data dimensionality.
Definition: CaePlugin.h:416
caeuSendInfoMsg
void caeuSendInfoMsg(CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
Send an info text message (PWP_MSGID_INFO) to the framework.
Definition: apiCAEPUtils.cxx:224
CAEP_WRITEINFO::precision
PWP_ENUM_PRECISION precision
export precision.
Definition: apiCAEP.h:199
caeuSendDebugMsg
void caeuSendDebugMsg(CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
Send a debug text message (PWP_MSGID_DEBUG) to the framework.
Definition: apiCAEPUtils.cxx:215
CaePlugin::publishUIntValueDef
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.
Definition: CaePlugin.h:603
PWP_DIMENSION_2D
@ PWP_DIMENSION_2D
Definition: apiPWP.h:764
CaePlugin::isDimension2D
bool isDimension2D() const
Check if 2D is requested.
Definition: CaePlugin.h:408
CaePlugin::publishRealValueDef
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.
Definition: CaePlugin.h:749
pwpAscii
@ pwpAscii
Definition: pwpPlatform.h:95
CAEP_RTITEM::BCCnt
PWP_UINT32 BCCnt
The number of BC definitions.
Definition: apiCAEPUtils.h:146
apiGridModel.h
Pointwise Grid Model API Specification (PWGM-API)
PwpFile::fp
FILE * fp() const
Get the FILE pointer.
Definition: PwpFile.h:767
CaePlugin::allowByteOrders
static bool allowByteOrders(CAEP_RTITEM &rti, const bool big, const bool little)
Set the "AllowedFileByteOrders" CAE plugin info value.
Definition: CaePlugin.h:898
PWP_ENUM_ENCODING
PWP_ENUM_ENCODING
File encoding values.
Definition: apiPWP.h:782
CaePlugin::isValid
static bool isValid(PWGM_HELEMENT h)
Check if an element handle is valid.
Definition: CaePlugin.h:551
PwpFile::wrap
bool wrap(FILE *fp, std::string filename=std::string(), int mode=0)
Take ownership of fp opened using pwpFileOpen(filename, mode).
Definition: PwpFile.cxx:568
PWP_PLUGININFO::author
const char * author
company/author description
Definition: apiPWP.h:673
caeuProgressBeginStep
PWP_BOOL caeuProgressBeginStep(CAEP_RTITEM *pRti, PWP_UINT32 total)
Begins a progress tracking step.
Definition: apiCAEPUtils.cxx:70
CAEP_WRITEINFO::byteOrder
PWP_ENDIANNESS byteOrder
export byte order.
Definition: apiCAEP.h:207
PWP_PLUGININFO::pwpVer
PWP_VERSION pwpVer
plugin conforms to this PWP-API version
Definition: apiPWP.h:667
caeuSendErrorMsg
void caeuSendErrorMsg(CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
Send an error text message (PWP_MSGID_ERROR) to the framework.
Definition: apiCAEPUtils.cxx:242
CaePlugin::operator=
CaePlugin & operator=(const CaePlugin &rhs)
Private assignment operator.
Definition: CaePluginImpl.h:76
CAEPU_RT_DIM_TEXT
#define CAEPU_RT_DIM_TEXT(rti)
Get the export dimension text from CAEP_RTITEM data pointed to by rti.
Definition: apiCAEPUtils.h:778
PWP_HEGRP_ISVALID
#define PWP_HEGRP_ISVALID(h)
Test the validity of a PWP_DECLARE_HELEMGROUP() handle.
Definition: apiPWP.h:383
PWP_VALTYPE_REAL
@ PWP_VALTYPE_REAL
transfer value is a PWP_REAL
Definition: apiPWP.h:700
caeuAssignInfoValue
PWP_BOOL caeuAssignInfoValue(const char key[], const char value[], bool createIfNotExists)
Creates a key/value pair that defines a CAE info attribute.
Definition: apiCAEPUtils.cxx:262
CaePlugin::meshLinkSupported
static bool meshLinkSupported(CAEP_RTITEM &rti, const bool on)
Set the "MeshLinkSupported" CAE plugin info value.
Definition: CaePlugin.h:962
CaePlugin::sendWarningMsg
void sendWarningMsg(const char *msg, PWP_UINT32 id=0) const
Send a warning message.
Definition: CaePlugin.h:275
CAEP_WRITEINFO::encoding
PWP_ENUM_ENCODING encoding
export file encoding.
Definition: apiCAEP.h:195
CaePlugin::~CaePlugin
virtual ~CaePlugin()
Destructor.
Definition: CaePluginImpl.h:28
CaePlugin::endExport
virtual bool endExport()
Called once by run() at the end of an export sequence.
Definition: CaePlugin.h:1081
PWP_REAL
double PWP_REAL
64-bit real
Definition: apiPWP.h:264
CaePlugin::getApiVersion
static PWP_VERSION getApiVersion()
Get the plugin's API version.
Definition: CaePlugin.h:490
CaePlugin::publishBoolValueDef
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.
Definition: CaePlugin.h:822
CaePlugin::publishUIntValueDef
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.
Definition: CaePlugin.h:652
CaePlugin::rti_
CAEP_RTITEM & rti_
The plugin's runtime item data.
Definition: CaePlugin.h:1136
apiCAEP.h
Pointwise CAE Plugin API (CAEP-API)
CaePlugin::shadowBcTypes
static bool shadowBcTypes(CAEP_RTITEM &rti, const char *const shadowTypes)
Set the "ShadowBcTypes" CAE plugin info value.
Definition: CaePlugin.h:1040
CaePlugin::sendInfoMsg
void sendInfoMsg(const char *msg, PWP_UINT32 id=0) const
Send an information message.
Definition: CaePlugin.h:253
CaePlugin::aborted
bool aborted() const
Check if an export has been aborted.
Definition: CaePlugin.h:296
PWP_APIINFO
The API information returned by plugins for each supported API.
Definition: apiPWP.h:652
pwpWrite
@ pwpWrite
Definition: pwpPlatform.h:77
CaePlugin::publishRealValueDef
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.
Definition: CaePlugin.h:797
PwpSetLanguage
PWP_VOID PwpSetLanguage(const char language[])
Sets the active language.
Definition: apiPWP.cxx:130
CaePlugin::isDimension3D
bool isDimension3D() const
Check if 3D is requested.
Definition: CaePlugin.h:400
CaePlugin::precisionStr
const char * precisionStr() const
Get a string representation of the requested data precision.
Definition: CaePlugin.h:343
CaePlugin::model
const MT & model() const
Get the grid model object.
Definition: CaePlugin.h:72
CAEP_WRITEINFO::dimension
PWP_ENUM_DIMENSION dimension
export dimensionality.
Definition: apiCAEP.h:203
caeuSendWarningMsg
void caeuSendWarningMsg(CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
Send a warning text message (PWP_MSGID_WARNING) to the framework.
Definition: apiCAEPUtils.cxx:233
CaePlugin::dimension
PWP_ENUM_DIMENSION dimension() const
Get the export's requested dimensionality.
Definition: CaePlugin.h:392
PWP_PLUGININFO::support
const char * support
support description (phone, web-link).
Definition: apiPWP.h:676
CaeStrPlugin
CaePlugin< CaeStrGridModel > CaeStrPlugin
Definition: CaePlugin.h:1208
CaePlugin::getAuthorInfo
static const char * getAuthorInfo()
Get the plugin's author description string.
Definition: CaePlugin.h:510
PWP_ENDIAN_LITTLE
@ PWP_ENDIAN_LITTLE
Definition: apiPWP.h:826
PWP_PLUGININFO
Provides general information about a plugin.
Definition: apiPWP.h:664
PWP_ENCODING_ASCII
@ PWP_ENCODING_ASCII
Definition: apiPWP.h:783
CaePlugin::publishStringValueDef
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.
Definition: CaePlugin.h:841
CaePlugin::publishIntValueDef
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.
Definition: CaePlugin.h:698
caeuPublishValueDefinition
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.
Definition: apiCAEPUtils.cxx:252
CaePlugin::isLicensed
bool isLicensed(const PWP_LICENSEDATA &license) const
Check if license data is valid.
Definition: CaePlugin.h:452
PWP_ENCODING_BINARY
@ PWP_ENCODING_BINARY
Definition: apiPWP.h:784
CaePlugin::publishValueDef
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.
Definition: CaePlugin.h:586
PWP_ENDIANNESS
PWP_ENDIANNESS
Flags used to indicate endianness or control endian behaviors in functions.
Definition: apiPWP.h:822
CAEP_WRITEINFO::conditionsOnly
PWP_BOOL conditionsOnly
Set to PWP_TRUE if only Conditions exported.
Definition: apiCAEP.h:191
PWP_INT
PWP_INT32 PWP_INT
integer same size as void*
Definition: apiPWP.h:282
PwpFile::setByteOrder
PWP_ENDIANNESS setByteOrder(PWP_ENDIANNESS order)
Set the byte order used for writes.
Definition: PwpFile.cxx:627
PwpFile::setPrecision
PWP_ENUM_PRECISION setPrecision(PWP_ENUM_PRECISION precision)
Set the floating point precision used for writes.
Definition: PwpFile.cxx:643
PWP_VALTYPE_BOOL
@ PWP_VALTYPE_BOOL
transfer value is a PWP_BOOL
Definition: apiPWP.h:702
PWP_VERSIONVAL
PWP_UINT32 PWP_VERSIONVAL
Version data component value.
Definition: apiPWP.h:469
PWP_BOOL
int PWP_BOOL
logical value
Definition: apiPWP.h:303
PWP_VALTYPE_INT
@ PWP_VALTYPE_INT
transfer value is a PWP_INT
Definition: apiPWP.h:698
CaePlugin::isBinaryEncoding
bool isBinaryEncoding() const
Check if binary encoding is requested.
Definition: CaePlugin.h:368
CaePlugin::setProgressMajorSteps
void setProgressMajorSteps(PWP_UINT32 steps)
Set the number of major export steps.
Definition: CaePlugin.h:190
CaePlugin::model_
MT model_
The grid model being exported.
Definition: CaePlugin.h:1137
CaePlugin::isUnformattedEncoding
bool isUnformattedEncoding() const
Check if FORTRAN unformatted encoding is requested.
Definition: CaePlugin.h:376
PwpFile::mapToBigLittle
static PWP_ENDIANNESS mapToBigLittle(PWP_ENDIANNESS byteOrder)
Map a byte ordering value to PWP_ENDIAN_BIG or PWP_ENDIAN_LITTLE based on getOsByteOrder().
Definition: PwpFile.cxx:1205
CaePlugin::progressEndStep
bool progressEndStep() const
Indicates the end of a major progress step.
Definition: CaePlugin.h:229
CaePlugin::isAsciiEncoding
bool isAsciiEncoding() const
Check if ascii encoding is requested.
Definition: CaePlugin.h:360
CaePlugin::conditionsOnly
bool conditionsOnly() const
Check if only BCs are to be exported.
Definition: CaePlugin.h:311
CaeUnsGridModel.h
CAEP_WRITEINFO
CAE export write control information.
Definition: apiCAEP.h:184
CaePlugin::beginExport
virtual bool beginExport()
Called once by run() at the start of an export sequence.
Definition: CaePlugin.h:1058
CaePlugin::setLanguage
void setLanguage(const char language[])
Set the active language.
Definition: CaePlugin.h:465
CaePlugin::wrapRuntimeFile
void wrapRuntimeFile()
Pass ownership of the runtime FILE pointer to a PwpFile object.
Definition: CaePlugin.h:1109
PWU_RTITEM::apiInfo
PWP_APIINFO apiInfo
The PWP-API instance information.
Definition: apiPWPUtils.h:48
PWP_ENCODING_UNFORMATTED
@ PWP_ENCODING_UNFORMATTED
Definition: apiPWP.h:785
CaePlugin::byteOrder
PWP_ENDIANNESS byteOrder() const
Get the export's requested byte order.
Definition: CaePlugin.h:424
PWP_VALTYPE_ENUM
@ PWP_VALTYPE_ENUM
transfer value is a const char*
Definition: apiPWP.h:701
CAEP_WRITEINFO::fileDest
const char * fileDest
requested file destination.
Definition: apiCAEP.h:187
PwpFile
Writes solver files.
Definition: PwpFile.h:110
CaePlugin::formatInfo
const CAEP_FORMATINFO & formatInfo() const
Get the plugin's export format settings.
Definition: CaePlugin.h:123
CaePlugin::useOneBasedIndexing
static bool useOneBasedIndexing(CAEP_RTITEM &rti)
Sets the "IndexScheme" CAE plugin info value to "OneBased".
Definition: CaePlugin.h:994
apiPWP.h
Pointwise Plugin API (PWP-API)
CaePlugin::publishIntValueDef
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.
Definition: CaePlugin.h:725
CaePlugin::encoding
PWP_ENUM_ENCODING encoding() const
Get the export's requested data encoding.
Definition: CaePlugin.h:352
CaeStrGridModel.h
CAEP_RTITEM::FormatInfo
CAEP_FORMATINFO FormatInfo
The CAE Plugin format data.
Definition: apiCAEPUtils.h:129
CaePlugin::getSupportInfo
static const char * getSupportInfo()
Get the plugin's support description string.
Definition: CaePlugin.h:520
CaePlugin::isDoublePrecision
bool isDoublePrecision() const
Check if double numerical precision is requested.
Definition: CaePlugin.h:335
PWP_ENUM_DIMENSION
PWP_ENUM_DIMENSION
Supported dimensionality values.
Definition: apiPWP.h:763
PWP_VALTYPE_UINT
@ PWP_VALTYPE_UINT
transfer value is a PWP_UINT
Definition: apiPWP.h:699
CaePlugin::publishEnumValueDef
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.
Definition: CaePlugin.h:859
CaePlugin::getCopyrightInfo
static const char * getCopyrightInfo()
Get the plugin's copyright description string.
Definition: CaePlugin.h:530
PWP_VERSION
Version data.
Definition: apiPWP.h:476
apiCAEPUtils.h
CAEP utilities.
CaePlugin::useZeroBasedIndexing
static bool useZeroBasedIndexing(CAEP_RTITEM &rti)
Sets the "IndexScheme" CAE plugin info value to "ZeroBased".
Definition: CaePlugin.h:978
CAEP_RTITEM::fp
FILE * fp
Runtime FILE pointer.
Definition: apiCAEPUtils.h:199
CaePlugin::getOsEndianness
static PWP_ENDIANNESS getOsEndianness()
Query the OS's native endianness.
Definition: CaePlugin.h:473
PWP_LICENSEDATA
Installation's license data. NOT IMPLEMENTED YET.
Definition: apiPWP.h:491
CaePlugin::publishRealValueDef
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.
Definition: CaePlugin.h:770
PWP_PRECISION_SINGLE
@ PWP_PRECISION_SINGLE
Definition: apiPWP.h:803
CaePlugin::apiInfo
const PWP_APIINFO & apiInfo() const
Get the plugin's API settings.
Definition: CaePlugin.h:132
CaePlugin::model
MT & model()
Get the grid model object.
Definition: CaePlugin.h:64
PwpFile.h
CAEPU_RT_PREC_TEXT
#define CAEPU_RT_PREC_TEXT(rti)
Get the export precision text from CAEP_RTITEM data pointed to by rti.
Definition: apiCAEPUtils.h:806
CaePlugin::sendErrorMsg
void sendErrorMsg(const char *msg, PWP_UINT32 id=0) const
Send an error message.
Definition: CaePlugin.h:285
PWP_ENUM_PRECISION
PWP_ENUM_PRECISION
File precision values.
Definition: apiPWP.h:802
PWP_APIINFO::name
const char * name
full API spec name
Definition: apiPWP.h:655
CaePlugin::progressBeginStep
bool progressBeginStep(PWP_UINT32 steps) const
Indicates the start of a major progress step.
Definition: CaePlugin.h:204
PWGM_HELEMENT_ISVALID
#define PWGM_HELEMENT_ISVALID(h)
returns non-zero value if handle is valid
Definition: apiGridModel.h:429
CaePlugin::run
PWP_BOOL run()
Starts the export sequence.
Definition: CaePluginImpl.h:34
CaePlugin::isSinglePrecision
bool isSinglePrecision() const
Check if single numerical precision is requested.
Definition: CaePlugin.h:327