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  // dont 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 
274  void sendWarningMsg(const char *msg, PWP_UINT32 id = 0) const {
275  caeuSendWarningMsg(&rti_, msg, id);
276  }
277 
279 
284  void sendErrorMsg(const char *msg, PWP_UINT32 id = 0) const {
285  caeuSendErrorMsg(&rti_, msg, id);
286  }
288 
290 
295  bool aborted() const {
296  return 0 != rti_.opAborted;
297  }
298 
304 
307 
310  bool conditionsOnly() const {
311  return 0 != writeInfo_.conditionsOnly;
312  }
313 
315 
319  return writeInfo_.precision;
320  }
321 
323 
326  bool isSinglePrecision() const {
327  return PWP_PRECISION_SINGLE == precision();
328  }
329 
331 
334  bool isDoublePrecision() const {
335  return PWP_PRECISION_DOUBLE == precision();
336  }
337 
339 
342  const char * precisionStr() const {
343  return CAEPU_RT_PREC_TEXT(&rti_);
344  }
345 
347 
352  return writeInfo_.encoding;
353  }
354 
356 
359  bool isAsciiEncoding() const {
360  return PWP_ENCODING_ASCII == encoding();
361  }
362 
364 
367  bool isBinaryEncoding() const {
368  return PWP_ENCODING_BINARY == encoding();
369  }
370 
372 
375  bool isUnformattedEncoding() const {
377  }
378 
380 
383  const char * encodingStr() const {
384  return CAEPU_RT_ENCODING_TEXT(&rti_);
385  }
386 
388 
392  return writeInfo_.dimension;
393  }
394 
396 
399  bool isDimension3D() const {
400  return PWP_DIMENSION_3D == dimension();
401  }
402 
404 
407  bool isDimension2D() const {
408  return PWP_DIMENSION_2D == dimension();
409  }
410 
412 
415  const char * dimensionStr() const {
416  return CAEPU_RT_DIM_TEXT(&rti_);
417  }
418 
420 
424  // Force return to be one of PWP_ENDIAN_LITTLE or PWP_ENDIAN_BIG
426  }
427 
429 
432  bool isBigEndian() const {
433  return PWP_ENDIAN_BIG == byteOrder();
434  }
435 
437 
440  bool isLittleEndian() const {
441  return PWP_ENDIAN_LITTLE == byteOrder();
442  }
444 
446 
451  bool isLicensed(const PWP_LICENSEDATA &license) const {
452  return 0 != PwpIsLicensed(rti_.pApiData->apiInfo.name, &license);
453  }
454 
456 
464  void setLanguage(const char language[]) {
465  return PwpSetLanguage(language);
466  }
467 
469 
473  return PwuGetOsEndianness();
474  }
475 
477 
481  static PWP_VERSIONVAL getInfo(PWP_PLUGININFO &pluginInfo) {
482  return PwpGetPluginInfo(&pluginInfo);
483  }
484 
486 
490  PWP_PLUGININFO info;
491  PwpGetPluginInfo(&info);
492  return info.pwpVer;
493  }
494 
496 
500  PWP_PLUGININFO info;
501  PwpGetPluginInfo(&info);
502  return info.libVer;
503  }
504 
506 
509  static const char * getAuthorInfo() {
510  PWP_PLUGININFO info;
511  PwpGetPluginInfo(&info);
512  return info.author;
513  }
514 
516 
519  static const char * getSupportInfo() {
520  PWP_PLUGININFO info;
521  PwpGetPluginInfo(&info);
522  return info.support;
523  }
524 
526 
529  static const char * getCopyrightInfo() {
530  PWP_PLUGININFO info;
531  PwpGetPluginInfo(&info);
532  return info.copyright;
533  }
534 
536 
540  template< typename H >
541  static bool isValid(H h) {
542  return PWP_HEGRP_ISVALID(h);
543  }
544 
546 
550  static bool isValid(PWGM_HELEMENT h) {
551  return PWGM_HELEMENT_ISVALID(h);
552  }
553 
561 
564 
585  static bool publishValueDef(CAEP_RTITEM &rti, const char key[],
586  PWP_ENUM_VALTYPE type, const char value[], const char desc[],
587  const char range[] = "", const char access[] = "RW") {
588  (void)rti.BCCnt; // silence unused arg warning
589  return 0 != caeuPublishValueDefinition(key, type, value, access,
590  desc, range);
591  }
592 
594 
602  static bool publishUIntValueDef(CAEP_RTITEM &rti, const char key[],
603  PWP_UINT value, const char desc[], const char access[] = "RW")
604  {
605  (void)rti.BCCnt; // silence unused arg warning
606  char valBuf[64];
607  sprintf(valBuf, "%lu", (unsigned long)value);
608  return 0 != caeuPublishValueDefinition(key, PWP_VALTYPE_UINT, valBuf,
609  access, desc, "");
610  }
611 
613 
623  static bool publishUIntValueDef(CAEP_RTITEM &rti, const char key[],
624  PWP_UINT value, const char desc[], PWP_UINT minVal, PWP_UINT maxVal,
625  const char access[] = "RW")
626  {
627  (void)rti.BCCnt; // silence unused arg warning
628  char valBuf[64];
629  sprintf(valBuf, "%lu", (unsigned long)value);
630  char rangeBuf[128];
631  sprintf(rangeBuf, "%lu %lu", (unsigned long)minVal,
632  (unsigned long)maxVal);
633  return 0 != caeuPublishValueDefinition(key, PWP_VALTYPE_UINT, valBuf,
634  access, desc, rangeBuf);
635  }
636 
639 
651  static bool publishUIntValueDef(CAEP_RTITEM &rti, const char key[],
652  PWP_UINT value, const char desc[], PWP_UINT minVal, PWP_UINT maxVal,
653  PWP_UINT minTypicalVal, PWP_UINT maxTypicalVal,
654  const char access[] = "RW")
655  {
656  (void)rti.BCCnt; // silence unused arg warning
657  char valBuf[64];
658  sprintf(valBuf, "%lu", (unsigned long)value);
659  char rangeBuf[128];
660  sprintf(rangeBuf, "%lu %lu %lu %lu", (unsigned long)minVal,
661  (unsigned long)maxVal, (unsigned long)minTypicalVal,
662  (unsigned long)maxTypicalVal);
663  return 0 != caeuPublishValueDefinition(key, PWP_VALTYPE_UINT, valBuf,
664  access, desc, rangeBuf);
665  }
666 
668 
676  static bool publishIntValueDef(CAEP_RTITEM &rti, const char key[],
677  PWP_INT value, const char desc[], const char access[] = "RW")
678  {
679  (void)rti.BCCnt; // silence unused arg warning
680  char valBuf[64];
681  sprintf(valBuf, "%ld", (long)value);
682  return 0 != caeuPublishValueDefinition(key, PWP_VALTYPE_INT, valBuf,
683  access, desc, "");
684  }
685 
687 
697  static bool publishIntValueDef(CAEP_RTITEM &rti, const char key[],
698  PWP_INT value, const char desc[], PWP_INT minVal, PWP_INT maxVal,
699  const char access[] = "RW")
700  {
701  (void)rti.BCCnt; // silence unused arg warning
702  char valBuf[64];
703  sprintf(valBuf, "%ld", (long)value);
704  char rangeBuf[128];
705  sprintf(rangeBuf, "%ld %ld", (long)minVal, (long)maxVal);
706  return 0 != caeuPublishValueDefinition(key, PWP_VALTYPE_INT, valBuf,
707  access, desc, rangeBuf);
708  }
709 
712 
724  static bool publishIntValueDef(CAEP_RTITEM &rti, const char key[],
725  PWP_INT value, const char desc[], PWP_INT minVal, PWP_INT maxVal,
726  PWP_INT minTypicalVal, PWP_INT maxTypicalVal,
727  const char access[] = "RW")
728  {
729  (void)rti.BCCnt; // silence unused arg warning
730  char valBuf[64];
731  sprintf(valBuf, "%ld", (long)value);
732  char rangeBuf[128];
733  sprintf(rangeBuf, "%ld %ld %ld %ld", (long)minVal, (long)maxVal,
734  (long)minTypicalVal, (long)maxTypicalVal);
735  return 0 != caeuPublishValueDefinition(key, PWP_VALTYPE_INT, valBuf,
736  access, desc, rangeBuf);
737  }
738 
740 
748  static bool publishRealValueDef(CAEP_RTITEM &rti, const char key[],
749  PWP_REAL value, const char desc[], const char access[] = "RW")
750  {
751  (void)rti.BCCnt; // silence unused arg warning
752  char valBuf[64];
753  sprintf(valBuf, "%g", (double)value);
754  return 0 != caeuPublishValueDefinition(key, PWP_VALTYPE_REAL, valBuf,
755  access, desc, "");
756  }
757 
759 
769  static bool publishRealValueDef(CAEP_RTITEM &rti, const char key[],
770  PWP_REAL value, const char desc[], PWP_REAL minVal, PWP_REAL maxVal,
771  const char access[] = "RW")
772  {
773  (void)rti.BCCnt; // silence unused arg warning
774  char valBuf[64];
775  sprintf(valBuf, "%g", (double)value);
776  char rangeBuf[128];
777  sprintf(rangeBuf, "%g %g", minVal, maxVal);
778  return 0 != caeuPublishValueDefinition(key, PWP_VALTYPE_REAL, valBuf,
779  access, desc, rangeBuf);
780  }
781 
784 
796  static bool publishRealValueDef(CAEP_RTITEM &rti, const char key[],
797  PWP_REAL value, const char desc[], PWP_REAL minVal, PWP_REAL maxVal,
798  PWP_REAL minTypicalVal, PWP_REAL maxTypicalVal,
799  const char access[] = "RW")
800  {
801  (void)rti.BCCnt; // silence unused arg warning
802  char valBuf[64];
803  sprintf(valBuf, "%g", (double)value);
804  char rangeBuf[128];
805  sprintf(rangeBuf, "%g %g %g %g", minVal, maxVal, minTypicalVal,
806  maxTypicalVal);
807  return 0 != caeuPublishValueDefinition(key, PWP_VALTYPE_REAL, valBuf,
808  access, desc, rangeBuf);
809  }
810 
812 
821  static bool publishBoolValueDef(CAEP_RTITEM &rti, const char key[],
822  bool value, const char desc[], const char range[] = "",
823  const char access[] = "RW")
824  {
825  (void)rti.BCCnt; // silence unused arg warning
827  (value ? "1" : "0"), access, desc, range);
828  }
829 
831 
840  static bool publishStringValueDef(CAEP_RTITEM &rti, const char key[],
841  const char value[], const char desc[], const char range[] = "",
842  const char access[] = "RW") {
843  (void)rti.BCCnt; // silence unused arg warning
844  return 0 != caeuPublishValueDefinition(key, PWP_VALTYPE_STRING, value,
845  access, desc, range);
846  }
847 
849 
858  static bool publishEnumValueDef(CAEP_RTITEM &rti, const char key[],
859  const char value[], const char desc[], const char range[] = "",
860  const char access[] = "RW") {
861  (void)rti.BCCnt; // silence unused arg warning
862  return 0 != caeuPublishValueDefinition(key, PWP_VALTYPE_ENUM, value,
863  access, desc, range);
864  }
865 
867 
881  static bool assignInfoValue(CAEP_RTITEM &rti, const char key[],
882  const char value[], const bool createIfNotExists = true) {
883  (void)rti.BCCnt; // silence unused arg warning
884  return 0 != caeuAssignInfoValue(key, value, createIfNotExists);
885  }
886 
888 
897  static bool allowByteOrders(CAEP_RTITEM &rti, const bool big,
898  const bool little) {
899  const char * const vals[] = {
900  /* 0 */ 0, // erase "AllowedFileByteOrders" info value
901  /* 1 */ "LittleEndian",
902  /* 2 */ "BigEndian",
903  /* 3 */ "BigEndian|LittleEndian"
904  };
905  const int n = (big ? 2 : 0) + (little ? 1 : 0);
906  return assignInfoValue(rti, "AllowedFileByteOrders", vals[n], true);
907  }
908 
910 
930  static bool allowElementTopologies(CAEP_RTITEM &rti, const bool structured,
931  const bool unstructured, const bool prismatic) {
932  const char * const vals[] = {
933  /* 0 */ 0, // erase "AllowedElementTopologies" info value
934  /* 1 */ "Structured",
935  /* 2 */ "Unstructured",
936  /* 3 */ "Structured|Unstructured",
937  /* 4 */ "Prismatic",
938  /* 5 */ "Structured|Prismatic",
939  /* 6 */ "Unstructured|Prismatic",
940  /* 7 */ "Structured|Unstructured|Prismatic",
941  };
942  const int n = (prismatic ? 4 : 0) + (unstructured ? 2 : 0) +
943  (structured ? 1 : 0);
944  return assignInfoValue(rti, "AllowedElementTopologies", vals[n], true);
945  }
946 
948 
961  static bool meshLinkSupported(CAEP_RTITEM &rti, const bool on) {
962  return assignInfoValue(rti, "MeshLinkSupported", (on ? "1" : "0"));
963  }
964 
966 
977  static bool useZeroBasedIndexing(CAEP_RTITEM &rti) {
978  return assignInfoValue(rti, "IndexScheme", "ZeroBased");
979  }
980 
982 
993  static bool useOneBasedIndexing(CAEP_RTITEM &rti) {
994  return assignInfoValue(rti, "IndexScheme", "OneBased");
995  }
996 
998 
1019  static bool useCustomIndexing(CAEP_RTITEM &rti) {
1020  return assignInfoValue(rti, "IndexScheme", "Custom");
1021  }
1022 
1024 
1039  static bool shadowBcTypes(CAEP_RTITEM &rti, const char * const shadowTypes)
1040  {
1041  return assignInfoValue(rti, "ShadowBcTypes", shadowTypes, true);
1042  }
1044 
1045 private:
1046 
1048 
1057  virtual bool beginExport()
1058  {
1059  return true;
1060  }
1061 
1063 
1069  virtual PWP_BOOL write() = 0;
1070 
1072 
1080  virtual bool endExport()
1081  {
1082  return true;
1083  }
1084 
1086  CaePlugin(const CaePlugin &src);
1087 
1089  CaePlugin & operator=(const CaePlugin &rhs);
1090 
1092 
1109  if (nullptr != rti_.fp) {
1110  int mode = 0;
1111  switch (encoding()) {
1112  case PWP_ENCODING_ASCII:
1113  mode = pwpWrite | pwpAscii;
1114  break;
1115  case PWP_ENCODING_BINARY:
1116  mode = pwpWrite | pwpBinary;
1117  break;
1119  mode = pwpWrite | pwpUnformatted;
1120  break;
1121  default:
1122  break;
1123  }
1124  rtFile_.wrap(rti_.fp, exportDestination(), mode);
1125  rti_.fp = nullptr; // rtFile_ now owns rti_.fp
1126  }
1127  else {
1128  rtFile_.wrap(nullptr);
1129  }
1132  }
1133 
1134 protected:
1136  MT model_;
1140 };
1141 
1142 #include "CaePluginImpl.h"
1143 
1144 
1145 //***************************************************************************
1146 //***************************************************************************
1147 //***************************************************************************
1148 
1149 #if !defined(PWGM_HIDE_UNSTRUCTURED_API)
1150 #include "CaeUnsGridModel.h"
1151 
1175 #endif
1176 
1177 
1178 //***************************************************************************
1179 //***************************************************************************
1180 //***************************************************************************
1181 
1182 #if !defined(PWGM_HIDE_STRUCTURED_API)
1183 #include "CaeStrGridModel.h"
1184 
1208 #endif
1209 
1210 #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:676
CaePlugin::progMajorSteps_
PWP_UINT32 progMajorSteps_
# of major export steps.
Definition: CaePlugin.h:1138
CaePlugin::encodingStr
const char * encodingStr() const
Get a string representation of the requested data encoding.
Definition: CaePlugin.h:383
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:881
CaeUnsPlugin
CaePlugin< CaeUnsGridModel > CaeUnsPlugin
Definition: CaePlugin.h:1174
CaePlugin::precision
PWP_ENUM_PRECISION precision() const
Get the export's requested numerical precision.
Definition: CaePlugin.h:318
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:930
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:1137
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:481
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:499
CaePlugin::isValid
static bool isValid(H h)
Check if a handle is valid.
Definition: CaePlugin.h:541
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:623
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:1019
CaePlugin::rtFile_
PwpFile rtFile_
runtime file object
Definition: CaePlugin.h:1139
CaePlugin::isLittleEndian
bool isLittleEndian() const
Check if little endian byte ordering is requested.
Definition: CaePlugin.h:440
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:432
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:415
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:602
PWP_DIMENSION_2D
@ PWP_DIMENSION_2D
Definition: apiPWP.h:764
CaePlugin::isDimension2D
bool isDimension2D() const
Check if 2D is requested.
Definition: CaePlugin.h:407
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:748
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:897
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:550
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:961
CaePlugin::sendWarningMsg
void sendWarningMsg(const char *msg, PWP_UINT32 id=0) const
Send a warning message.
Definition: CaePlugin.h:274
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:1080
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:489
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:821
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:651
CaePlugin::rti_
CAEP_RTITEM & rti_
The plugin's runtime item data.
Definition: CaePlugin.h:1135
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:1039
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:295
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:796
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:399
CaePlugin::precisionStr
const char * precisionStr() const
Get a string representation of the requested data precision.
Definition: CaePlugin.h:342
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:391
PWP_PLUGININFO::support
const char * support
support description (phone, web-link).
Definition: apiPWP.h:676
CaeStrPlugin
CaePlugin< CaeStrGridModel > CaeStrPlugin
Definition: CaePlugin.h:1207
CaePlugin::getAuthorInfo
static const char * getAuthorInfo()
Get the plugin's author description string.
Definition: CaePlugin.h:509
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:840
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:697
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:451
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:585
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:367
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:1136
CaePlugin::isUnformattedEncoding
bool isUnformattedEncoding() const
Check if FORTRAN unformatted encoding is requested.
Definition: CaePlugin.h:375
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:359
CaePlugin::conditionsOnly
bool conditionsOnly() const
Check if only BCs are to be exported.
Definition: CaePlugin.h:310
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:1057
CaePlugin::setLanguage
void setLanguage(const char language[])
Set the active language.
Definition: CaePlugin.h:464
CaePlugin::wrapRuntimeFile
void wrapRuntimeFile()
Pass ownership of the runtime FILE pointer to a PwpFile object.
Definition: CaePlugin.h:1108
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:423
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:993
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:724
CaePlugin::encoding
PWP_ENUM_ENCODING encoding() const
Get the export's requested data encoding.
Definition: CaePlugin.h:351
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:519
CaePlugin::isDoublePrecision
bool isDoublePrecision() const
Check if double numerical precision is requested.
Definition: CaePlugin.h:334
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:858
CaePlugin::getCopyrightInfo
static const char * getCopyrightInfo()
Get the plugin's copyright description string.
Definition: CaePlugin.h:529
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:977
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:472
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:769
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:284
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:326