Pointwise Plugin SDK
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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_BOOL conditionsOnly
Set to PWP_TRUE if only Conditions exported.
Definition: apiCAEP.h:191
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
const char * encodingStr() const
Get a string representation of the requested data encoding.
Definition: CaePlugin.h:383
bool progressEndStep() const
Indicates the end of a major progress step.
Definition: CaePlugin.h:229
const char * dimensionStr() const
Get a string representation of the requested data dimensionality.
Definition: CaePlugin.h:415
bool conditionsOnly() const
Check if only BCs are to be exported.
Definition: CaePlugin.h:310
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
PWP_ENUM_VALTYPE
Supported PWP-API getValue() transfer types.
Definition: apiPWP.h:696
void sendWarningMsg(const char *msg, PWP_UINT32 id=0) const
Send a warning message.
Definition: CaePlugin.h:274
Grid element handle declaration.
Definition: apiGridModel.h:427
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
transfer value is a PWP_REAL
Definition: apiPWP.h:700
static PWP_VERSIONVAL getInfo(PWP_PLUGININFO &pluginInfo)
Get information about this plugin.
Definition: CaePlugin.h:481
CaePlugin< CaeStrGridModel > CaeStrPlugin
Definition: CaePlugin.h:1207
PWP_ENUM_ENCODING encoding
export file encoding.
Definition: apiCAEP.h:195
unsigned int PWP_UINT32
32-bit unsigned integer
Definition: apiPWP.h:210
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
PWU_RTITEM * pApiData
Pointer to the associated PWU_RTITEM structure.
Definition: apiCAEPUtils.h:133
transfer value is a PWP_INT
Definition: apiPWP.h:698
virtual PWP_BOOL write()=0
Called once by run() to perform the export logic.
FILE * fp() const
Get the FILE pointer.
Definition: PwpFile.h:767
Pointwise Plugin API (PWP-API)
virtual bool endExport()
Called once by run() at the end of an export sequence.
Definition: CaePlugin.h:1080
PWP_ENDIANNESS setByteOrder(PWP_ENDIANNESS order)
Set the byte order used for writes.
Definition: PwpFile.cxx:627
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
CaePlugin< CaeUnsGridModel > CaeUnsPlugin
Definition: CaePlugin.h:1174
The information returned for each supported CAEP exporter.
Definition: apiCAEP.h:98
CaePlugin(CAEP_RTITEM *pRti, PWGM_HGRIDMODEL model, const CAEP_WRITEINFO *pWriteInfo)
Template constructor.
Definition: CaePluginImpl.h:17
void setProgressMajorSteps(PWP_UINT32 steps)
Set the number of major export steps.
Definition: CaePlugin.h:190
void setLanguage(const char language[])
Set the active language.
Definition: CaePlugin.h:464
PWP_UINT32 BCCnt
The number of BC definitions.
Definition: apiCAEPUtils.h:146
Version data.
Definition: apiPWP.h:476
MT model_
The grid model being exported.
Definition: CaePlugin.h:1136
void wrapRuntimeFile()
Pass ownership of the runtime FILE pointer to a PwpFile object.
Definition: CaePlugin.h:1108
Pointwise Grid Model API Specification (PWGM-API)
FILE * fp() const
Get the FILE pointer wrapped by the runtime file object.
Definition: CaePlugin.h:99
PWP_VERSION libVer
software library release version
Definition: apiPWP.h:670
PWP_ENUM_PRECISION
File precision values.
Definition: apiPWP.h:802
static bool isValid(H h)
Check if a handle is valid.
Definition: CaePlugin.h:541
CAEP_FORMATINFO FormatInfo
The CAE Plugin format data.
Definition: apiCAEPUtils.h:129
transfer value is a const char*
Definition: apiPWP.h:697
static bool isValid(PWGM_HELEMENT h)
Check if an element handle is valid.
Definition: CaePlugin.h:550
#define PWP_HEGRP_ISVALID(h)
Test the validity of a PWP_DECLARE_HELEMGROUP() handle.
Definition: apiPWP.h:383
const char * support
support description (phone, web-link).
Definition: apiPWP.h:676
static bool allowElementTopologies(CAEP_RTITEM &rti, const bool structured, const bool unstructured, const bool prismatic)
Set the &quot;AllowedElementTopologies&quot; CAE plugin info value.
Definition: CaePlugin.h:930
void caeuSendErrorMsg(CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
Send an error text message (PWP_MSGID_ERROR) to the framework.
const char * fileDest
requested file destination.
Definition: apiCAEP.h:187
PWP_VOID PwpSetLanguage(const char language[])
Sets the active language.
Definition: apiPWP.cxx:130
PWP_BOOL caeuProgressIncr(CAEP_RTITEM *pRti)
Completes a progress tracking sub-step.
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
const MT & model() const
Get the grid model object.
Definition: CaePlugin.h:72
static bool useZeroBasedIndexing(CAEP_RTITEM &rti)
Sets the &quot;IndexScheme&quot; CAE plugin info value to &quot;ZeroBased&quot;.
Definition: CaePlugin.h:977
PWP_ENUM_ENCODING encoding() const
Get the export&#39;s requested data encoding.
Definition: CaePlugin.h:351
Installation&#39;s license data. NOT IMPLEMENTED YET.
Definition: apiPWP.h:491
PWP_BOOL caeuProgressEndStep(CAEP_RTITEM *pRti)
Completes a progress tracking major step.
const CAEP_FORMATINFO & formatInfo() const
Get the plugin&#39;s export format settings.
Definition: CaePlugin.h:123
#define CAEPU_RT_ENCODING_TEXT(rti)
Get the export precision text from CAEP_RTITEM data pointed to by rti.
Definition: apiCAEPUtils.h:834
MT & model()
Get the grid model object.
Definition: CaePlugin.h:64
void caeuSendWarningMsg(CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
Send a warning text message (PWP_MSGID_WARNING) to the framework.
bool isUnformattedEncoding() const
Check if FORTRAN unformatted encoding is requested.
Definition: CaePlugin.h:375
PwpFile & runtimeFile()
Get the runtime file object.
Definition: CaePlugin.h:89
PWP_BOOL caeuProgressBeginStep(CAEP_RTITEM *pRti, PWP_UINT32 total)
Begins a progress tracking step.
static const char * getCopyrightInfo()
Get the plugin&#39;s copyright description string.
Definition: CaePlugin.h:529
#define CAEPU_RT_DIM_TEXT(rti)
Get the export dimension text from CAEP_RTITEM data pointed to by rti.
Definition: apiCAEPUtils.h:778
PWP_ENUM_DIMENSION dimension() const
Get the export&#39;s requested dimensionality.
Definition: CaePlugin.h:391
bool isSinglePrecision() const
Check if single numerical precision is requested.
Definition: CaePlugin.h:326
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
FILE * fp
Runtime FILE pointer.
Definition: apiCAEPUtils.h:199
CaePlugin & operator=(const CaePlugin &rhs)
Private assignment operator.
Definition: CaePluginImpl.h:76
The API information returned by plugins for each supported API.
Definition: apiPWP.h:652
Writes solver files.
Definition: PwpFile.h:110
PWP_UINT32 progMajorSteps_
# of major export steps.
Definition: CaePlugin.h:1138
transfer value is a PWP_BOOL
Definition: apiPWP.h:702
CAEP utilities.
static bool meshLinkSupported(CAEP_RTITEM &rti, const bool on)
Set the &quot;MeshLinkSupported&quot; CAE plugin info value.
Definition: CaePlugin.h:961
void sendDebugMsg(const char *msg, PWP_UINT32 id=0) const
Send a debug message.
Definition: CaePlugin.h:264
static bool useOneBasedIndexing(CAEP_RTITEM &rti)
Sets the &quot;IndexScheme&quot; CAE plugin info value to &quot;OneBased&quot;.
Definition: CaePlugin.h:993
PWP_ENUM_DIMENSION
Supported dimensionality values.
Definition: apiPWP.h:763
PWP_VERSION pwpVer
plugin conforms to this PWP-API version
Definition: apiPWP.h:667
PWP_BOOL caeuAssignInfoValue(const char key[], const char value[], bool createIfNotExists)
Creates a key/value pair that defines a CAE info attribute.
bool isAsciiEncoding() const
Check if ascii encoding is requested.
Definition: CaePlugin.h:359
int PWP_BOOL
logical value
Definition: apiPWP.h:303
bool isDimension2D() const
Check if 2D is requested.
Definition: CaePlugin.h:407
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
PWP_ENUM_ENCODING
File encoding values.
Definition: apiPWP.h:782
PWP_ENUM_PRECISION setPrecision(PWP_ENUM_PRECISION precision)
Set the floating point precision used for writes.
Definition: PwpFile.cxx:643
bool progressIncrement() const
Indicates the completion of a progress sub step within the current major step.
Definition: CaePlugin.h:217
PWP_BOOL run()
Starts the export sequence.
Definition: CaePluginImpl.h:34
CAE export write control information.
Definition: apiCAEP.h:184
bool aborted() const
Check if an export has been aborted.
Definition: CaePlugin.h:295
void caeuSendDebugMsg(CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
Send a debug text message (PWP_MSGID_DEBUG) to the framework.
const PwpFile & runtimeFile() const
Get the runtime file object.
Definition: CaePlugin.h:85
transfer value is a PWP_UINT
Definition: apiPWP.h:699
static PWP_VERSION getVersion()
Get the plugin&#39;s release version.
Definition: CaePlugin.h:499
Pointwise CAE Plugin API (CAEP-API)
#define PWGM_HELEMENT_ISVALID(h)
returns non-zero value if handle is valid
Definition: apiGridModel.h:429
const char * author
company/author description
Definition: apiPWP.h:673
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
static bool shadowBcTypes(CAEP_RTITEM &rti, const char *const shadowTypes)
Set the &quot;ShadowBcTypes&quot; CAE plugin info value.
Definition: CaePlugin.h:1039
transfer value is a const char*
Definition: apiPWP.h:701
const char * precisionStr() const
Get a string representation of the requested data precision.
Definition: CaePlugin.h:342
void sendInfoMsg(const char *msg, PWP_UINT32 id=0) const
Send an information message.
Definition: CaePlugin.h:253
static const char * getAuthorInfo()
Get the plugin&#39;s author description string.
Definition: CaePlugin.h:509
PWP_ENUM_DIMENSION dimension
export dimensionality.
Definition: apiCAEP.h:203
bool isBinaryEncoding() const
Check if binary encoding is requested.
Definition: CaePlugin.h:367
const char * exportDestination() const
Get the requested file destination string.
Definition: CaePlugin.h:113
PWP_UINT32 PWP_VERSIONVAL
Version data component value.
Definition: apiPWP.h:469
PWP_ENDIANNESS byteOrder() const
Get the export&#39;s requested byte order.
Definition: CaePlugin.h:423
static const char * getSupportInfo()
Get the plugin&#39;s support description string.
Definition: CaePlugin.h:519
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
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.
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
const char * copyright
copyright description
Definition: apiPWP.h:679
PWP_ENDIANNESS byteOrder
export byte order.
Definition: apiCAEP.h:207
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
void caeuSendInfoMsg(CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
Send an info text message (PWP_MSGID_INFO) to the framework.
CAEP_RTITEM & rti_
The plugin&#39;s runtime item data.
Definition: CaePlugin.h:1135
PWP_UINT32 PWP_UINT
unsigned integer same size as void*
Definition: apiPWP.h:285
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
PWP_ENUM_PRECISION precision() const
Get the export&#39;s requested numerical precision.
Definition: CaePlugin.h:318
const char * name
full API spec name
Definition: apiPWP.h:655
bool progressBeginStep(PWP_UINT32 steps) const
Indicates the start of a major progress step.
Definition: CaePlugin.h:204
static PWP_VERSION getApiVersion()
Get the plugin&#39;s API version.
Definition: CaePlugin.h:489
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
PwpFile rtFile_
runtime file object
Definition: CaePlugin.h:1139
PWP_ENDIANNESS
Flags used to indicate endianness or control endian behaviors in functions.
Definition: apiPWP.h:822
#define CAEPU_RT_PREC_TEXT(rti)
Get the export precision text from CAEP_RTITEM data pointed to by rti.
Definition: apiCAEPUtils.h:806
The data representing a CAE exporter instance.
Definition: apiCAEPUtils.h:124
bool isLicensed(const PWP_LICENSEDATA &license) const
Check if license data is valid.
Definition: CaePlugin.h:451
const CAEP_WRITEINFO & writeInfo_
The export options.
Definition: CaePlugin.h:1137
PWP_ENUM_PRECISION precision
export precision.
Definition: apiCAEP.h:199
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
PWP_INT32 PWP_INT
integer same size as void*
Definition: apiPWP.h:282
bool isBigEndian() const
Check if big endian byte ordering is requested.
Definition: CaePlugin.h:432
An opaque handle to a grid model.
Definition: apiGridModel.h:326
static bool allowByteOrders(CAEP_RTITEM &rti, const bool big, const bool little)
Set the &quot;AllowedFileByteOrders&quot; CAE plugin info value.
Definition: CaePlugin.h:897
virtual bool beginExport()
Called once by run() at the start of an export sequence.
Definition: CaePlugin.h:1057
bool isDoublePrecision() const
Check if double numerical precision is requested.
Definition: CaePlugin.h:334
bool isLittleEndian() const
Check if little endian byte ordering is requested.
Definition: CaePlugin.h:440
PWP_PROTOTYPE_DECL PWP_VERSIONVAL PwpGetPluginInfo(PWP_PLUGININFO *pInfo)
Get information about this plugin.
PWP_ENDIANNESS PwuGetOsEndianness(void)
Query the OS&#39;s native endianness.
bool isDimension3D() const
Check if 3D is requested.
Definition: CaePlugin.h:399
const PWP_APIINFO & apiInfo() const
Get the plugin&#39;s API settings.
Definition: CaePlugin.h:132
virtual ~CaePlugin()
Destructor.
Definition: CaePluginImpl.h:28
PWP_APIINFO apiInfo
The PWP-API instance information.
Definition: apiPWPUtils.h:48
double PWP_REAL
64-bit real
Definition: apiPWP.h:264
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:1185
void sendErrorMsg(const char *msg, PWP_UINT32 id=0) const
Send an error message.
Definition: CaePlugin.h:284
Provides general information about a plugin.
Definition: apiPWP.h:664
static PWP_ENDIANNESS getOsEndianness()
Query the OS&#39;s native endianness.
Definition: CaePlugin.h:472
static bool useCustomIndexing(CAEP_RTITEM &rti)
Sets the &quot;IndexScheme&quot; CAE plugin info value to &quot;Custom&quot;.
Definition: CaePlugin.h:1019
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