Pointwise Plugin SDK
CaePlugin.h
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * CAEP Plugin example - PwCaeGridWrite implementation
4  *
5  * Proprietary software product of Pointwise, Inc.
6  * Copyright (c) 1995-2018 Pointwise, Inc.
7  * All rights reserved.
8  *
9  ***************************************************************************/
10 
11 
12 #ifndef _CAEPLUGIN_H_
13 #define _CAEPLUGIN_H_
14 
15 #include "apiCAEP.h"
16 #include "apiCAEPUtils.h"
17 #include "apiGridModel.h"
18 #include "apiPWP.h"
19 #include "PwpFile.h"
20 
21 
29 template< typename MT >
30 class CaePlugin {
31 public:
32 
34 
44  *pWriteInfo);
45 
47  virtual ~CaePlugin();
48 
50 
60  PWP_BOOL run();
61 
63 
66  MT & model() {
67  return model_;
68  }
69 
71 
74  const MT & model() const {
75  return model_;
76  }
77 
79 
85  PwpFile & runtimeFile() const {
86  return rtFile_;
87  }
88 
90 
94  FILE * fp() const {
95  return rtFile_.fp();
96  }
97 
99 
108  const char * exportDestination() const {
109  return writeInfo_.fileDest;
110  }
111 
113 
118  const CAEP_FORMATINFO& formatInfo() const {
119  return rti_.FormatInfo;
120  }
121 
123 
127  const PWP_APIINFO& apiInfo() const {
128  return rti_.pApiData->apiInfo;
129  }
130 
147 
150 
186  // dont allow zero
187  progMajorSteps_ = (steps ? steps : 1);
188  }
189 
191 
199  bool progressBeginStep(PWP_UINT32 steps) const {
200  return 0 != caeuProgressBeginStep(&rti_, steps);
201  }
202 
205 
212  bool progressIncrement() const {
213  return 0 != caeuProgressIncr(&rti_);
214  }
215 
217 
224  bool progressEndStep() const {
225  return 0 != caeuProgressEndStep(&rti_);
226  }
228 
239 
242 
248  void sendInfoMsg(const char *msg, PWP_UINT32 id = 0) const {
249  caeuSendInfoMsg(&rti_, msg, id);
250  }
251 
253 
259  void sendDebugMsg(const char *msg, PWP_UINT32 id = 0) const {
260  caeuSendDebugMsg(&rti_, msg, id);
261  }
262 
264 
269  void sendWarningMsg(const char *msg, PWP_UINT32 id = 0) const {
270  caeuSendWarningMsg(&rti_, msg, id);
271  }
272 
274 
279  void sendErrorMsg(const char *msg, PWP_UINT32 id = 0) const {
280  caeuSendErrorMsg(&rti_, msg, id);
281  }
283 
285 
290  bool aborted() const {
291  return 0 != rti_.opAborted;
292  }
293 
299 
302 
305  bool conditionsOnly() const {
306  return 0 != writeInfo_.conditionsOnly;
307  }
308 
310 
314  return writeInfo_.precision;
315  }
316 
318 
321  bool isSinglePrecision() const {
322  return PWP_PRECISION_SINGLE == precision();
323  }
324 
326 
329  bool isDoublePrecision() const {
330  return PWP_PRECISION_DOUBLE == precision();
331  }
332 
334 
337  const char * precisionStr() const {
338  return CAEPU_RT_PREC_TEXT(&rti_);
339  }
340 
342 
347  return writeInfo_.encoding;
348  }
349 
351 
354  bool isAsciiEncoding() const {
355  return PWP_ENCODING_ASCII == encoding();
356  }
357 
359 
362  bool isBinaryEncoding() const {
363  return PWP_ENCODING_BINARY == encoding();
364  }
365 
367 
370  bool isUnformattedEncoding() const {
372  }
373 
375 
378  const char * encodingStr() const {
379  return CAEPU_RT_ENCODING_TEXT(&rti_);
380  }
381 
383 
387  return writeInfo_.dimension;
388  }
389 
391 
394  bool isDimension3D() const {
395  return PWP_DIMENSION_3D == dimension();
396  }
397 
399 
402  bool isDimension2D() const {
403  return PWP_DIMENSION_2D == dimension();
404  }
405 
407 
410  const char * dimensionStr() const {
411  return CAEPU_RT_DIM_TEXT(&rti_);
412  }
413 
415 
419  return writeInfo_.byteOrder;
420  }
421 
423 
426  bool isBigEndian() const {
427  return PWP_ENDIAN_BIG == byteOrder();
428  }
429 
431 
434  bool isLittleEndian() const {
435  return PWP_ENDIAN_LITTLE == byteOrder();
436  }
438 
440 
445  bool isLicensed(const PWP_LICENSEDATA &license) const {
446  return 0 != PwpIsLicensed(rti_.pApiData->apiInfo.name, &license);
447  }
448 
450 
458  void setLanguage(const char language[]) {
459  return PwpSetLanguage(language);
460  }
461 
463 
467  return PwuGetOsEndianness();
468  }
469 
471 
475  static PWP_VERSIONVAL getInfo(PWP_PLUGININFO &pluginInfo) {
476  return PwpGetPluginInfo(&pluginInfo);
477  }
478 
480 
484  PWP_PLUGININFO info;
485  PwpGetPluginInfo(&info);
486  return info.pwpVer;
487  }
488 
490 
494  PWP_PLUGININFO info;
495  PwpGetPluginInfo(&info);
496  return info.libVer;
497  }
498 
500 
503  static const char * getAuthorInfo() {
504  PWP_PLUGININFO info;
505  PwpGetPluginInfo(&info);
506  return info.author;
507  }
508 
510 
513  static const char * getSupportInfo() {
514  PWP_PLUGININFO info;
515  PwpGetPluginInfo(&info);
516  return info.support;
517  }
518 
520 
523  static const char * getCopyrightInfo() {
524  PWP_PLUGININFO info;
525  PwpGetPluginInfo(&info);
526  return info.copyright;
527  }
528 
530 
534  template< typename H >
535  static bool isValid(H h) {
536  return PWP_HEGRP_ISVALID(h);
537  }
538 
540 
544  static bool isValid(PWGM_HELEMENT h) {
545  return PWGM_HELEMENT_ISVALID(h);
546  }
547 
555 
558 
579  static bool publishValueDef(CAEP_RTITEM &rti, const char key[],
580  PWP_ENUM_VALTYPE type, const char value[], const char desc[],
581  const char range[] = "", const char access[] = "RW") {
582  (void)rti.BCCnt; // silence unused arg warning
583  return 0 != caeuPublishValueDefinition(key, type, value, access,
584  desc, range);
585  }
586 
588 
596  static bool publishUIntValueDef(CAEP_RTITEM &rti, const char key[],
597  PWP_UINT value, const char desc[], const char access[] = "RW")
598  {
599  (void)rti.BCCnt; // silence unused arg warning
600  char valBuf[64];
601  sprintf(valBuf, "%lu", (unsigned long)value);
602  return 0 != caeuPublishValueDefinition(key, PWP_VALTYPE_UINT, valBuf,
603  access, desc, "");
604  }
605 
607 
617  static bool publishUIntValueDef(CAEP_RTITEM &rti, const char key[],
618  PWP_UINT value, const char desc[], PWP_UINT minVal, PWP_UINT maxVal,
619  const char access[] = "RW")
620  {
621  (void)rti.BCCnt; // silence unused arg warning
622  char valBuf[64];
623  sprintf(valBuf, "%lu", (unsigned long)value);
624  char rangeBuf[128];
625  sprintf(rangeBuf, "%lu %lu", (unsigned long)minVal,
626  (unsigned long)maxVal);
627  return 0 != caeuPublishValueDefinition(key, PWP_VALTYPE_UINT, valBuf,
628  access, desc, rangeBuf);
629  }
630 
633 
645  static bool publishUIntValueDef(CAEP_RTITEM &rti, const char key[],
646  PWP_UINT value, const char desc[], PWP_UINT minVal, PWP_UINT maxVal,
647  PWP_UINT minTypicalVal, PWP_UINT maxTypicalVal,
648  const char access[] = "RW")
649  {
650  (void)rti.BCCnt; // silence unused arg warning
651  char valBuf[64];
652  sprintf(valBuf, "%lu", (unsigned long)value);
653  char rangeBuf[128];
654  sprintf(rangeBuf, "%lu %lu %lu %lu", (unsigned long)minVal,
655  (unsigned long)maxVal, (unsigned long)minTypicalVal,
656  (unsigned long)maxTypicalVal);
657  return 0 != caeuPublishValueDefinition(key, PWP_VALTYPE_UINT, valBuf,
658  access, desc, rangeBuf);
659  }
660 
662 
670  static bool publishIntValueDef(CAEP_RTITEM &rti, const char key[],
671  PWP_INT value, const char desc[], const char access[] = "RW")
672  {
673  (void)rti.BCCnt; // silence unused arg warning
674  char valBuf[64];
675  sprintf(valBuf, "%ld", (long)value);
676  return 0 != caeuPublishValueDefinition(key, PWP_VALTYPE_INT, valBuf,
677  access, desc, "");
678  }
679 
681 
691  static bool publishIntValueDef(CAEP_RTITEM &rti, const char key[],
692  PWP_INT value, const char desc[], PWP_INT minVal, PWP_INT maxVal,
693  const char access[] = "RW")
694  {
695  (void)rti.BCCnt; // silence unused arg warning
696  char valBuf[64];
697  sprintf(valBuf, "%ld", (long)value);
698  char rangeBuf[128];
699  sprintf(rangeBuf, "%ld %ld", (long)minVal, (long)maxVal);
700  return 0 != caeuPublishValueDefinition(key, PWP_VALTYPE_INT, valBuf,
701  access, desc, rangeBuf);
702  }
703 
706 
718  static bool publishIntValueDef(CAEP_RTITEM &rti, const char key[],
719  PWP_INT value, const char desc[], PWP_INT minVal, PWP_INT maxVal,
720  PWP_INT minTypicalVal, PWP_INT maxTypicalVal,
721  const char access[] = "RW")
722  {
723  (void)rti.BCCnt; // silence unused arg warning
724  char valBuf[64];
725  sprintf(valBuf, "%ld", (long)value);
726  char rangeBuf[128];
727  sprintf(rangeBuf, "%ld %ld %ld %ld", (long)minVal, (long)maxVal,
728  (long)minTypicalVal, (long)maxTypicalVal);
729  return 0 != caeuPublishValueDefinition(key, PWP_VALTYPE_INT, valBuf,
730  access, desc, rangeBuf);
731  }
732 
734 
742  static bool publishRealValueDef(CAEP_RTITEM &rti, const char key[],
743  PWP_REAL value, const char desc[], const char access[] = "RW")
744  {
745  (void)rti.BCCnt; // silence unused arg warning
746  char valBuf[64];
747  sprintf(valBuf, "%g", (double)value);
748  return 0 != caeuPublishValueDefinition(key, PWP_VALTYPE_REAL, valBuf,
749  access, desc, "");
750  }
751 
753 
763  static bool publishRealValueDef(CAEP_RTITEM &rti, const char key[],
764  PWP_REAL value, const char desc[], PWP_REAL minVal, PWP_REAL maxVal,
765  const char access[] = "RW")
766  {
767  (void)rti.BCCnt; // silence unused arg warning
768  char valBuf[64];
769  sprintf(valBuf, "%g", (double)value);
770  char rangeBuf[128];
771  sprintf(rangeBuf, "%g %g", minVal, maxVal);
772  return 0 != caeuPublishValueDefinition(key, PWP_VALTYPE_REAL, valBuf,
773  access, desc, rangeBuf);
774  }
775 
778 
790  static bool publishRealValueDef(CAEP_RTITEM &rti, const char key[],
791  PWP_REAL value, const char desc[], PWP_REAL minVal, PWP_REAL maxVal,
792  PWP_REAL minTypicalVal, PWP_REAL maxTypicalVal,
793  const char access[] = "RW")
794  {
795  (void)rti.BCCnt; // silence unused arg warning
796  char valBuf[64];
797  sprintf(valBuf, "%g", (double)value);
798  char rangeBuf[128];
799  sprintf(rangeBuf, "%g %g %g %g", minVal, maxVal, minTypicalVal,
800  maxTypicalVal);
801  return 0 != caeuPublishValueDefinition(key, PWP_VALTYPE_REAL, valBuf,
802  access, desc, rangeBuf);
803  }
804 
806 
815  static bool publishBoolValueDef(CAEP_RTITEM &rti, const char key[],
816  bool value, const char desc[], const char range[] = "",
817  const char access[] = "RW")
818  {
819  (void)rti.BCCnt; // silence unused arg warning
821  (value ? "1" : "0"), access, desc, range);
822  }
823 
825 
834  static bool publishStringValueDef(CAEP_RTITEM &rti, const char key[],
835  const char value[], const char desc[], const char range[] = "",
836  const char access[] = "RW") {
837  (void)rti.BCCnt; // silence unused arg warning
838  return 0 != caeuPublishValueDefinition(key, PWP_VALTYPE_STRING, value,
839  access, desc, range);
840  }
841 
843 
852  static bool publishEnumValueDef(CAEP_RTITEM &rti, const char key[],
853  const char value[], const char desc[], const char range[] = "",
854  const char access[] = "RW") {
855  (void)rti.BCCnt; // silence unused arg warning
856  return 0 != caeuPublishValueDefinition(key, PWP_VALTYPE_ENUM, value,
857  access, desc, range);
858  }
859 
861 
875  static bool assignInfoValue(CAEP_RTITEM &rti, const char key[],
876  const char value[], bool createIfNotExists = true) {
877  (void)rti.BCCnt; // silence unused arg warning
878  return 0 != caeuAssignInfoValue(key, value, createIfNotExists);
879  }
880 
882 
891  static bool allowByteOrders(CAEP_RTITEM &rti, bool big, bool little) {
892  const char * const vals[] = {
893  /* 0 */ 0, // erase "AllowedFileByteOrders" info value
894  /* 1 */ "LittleEndian",
895  /* 2 */ "BigEndian",
896  /* 3 */ "BigEndian|LittleEndian"
897  };
898  const int n = (big ? 2 : 0) + (little ? 1 : 0);
899  return assignInfoValue(rti, "AllowedFileByteOrders", vals[n], true);
900  }
901 
903 
923  static bool allowElementTopologies(CAEP_RTITEM &rti, bool structured,
924  bool unstructured, bool prismatic) {
925  const char * const vals[] = {
926  /* 0 */ 0, // erase "AllowedElementTopologies" info value
927  /* 1 */ "Structured",
928  /* 2 */ "Unstructured",
929  /* 3 */ "Structured|Unstructured",
930  /* 4 */ "Prismatic",
931  /* 5 */ "Structured|Prismatic",
932  /* 6 */ "Unstructured|Prismatic",
933  /* 7 */ "Structured|Unstructured|Prismatic",
934  };
935  const int n = (prismatic ? 4 : 0) + (unstructured ? 2 : 0) +
936  (structured ? 1 : 0);
937  return assignInfoValue(rti, "AllowedElementTopologies", vals[n], true);
938  }
940 
941 private:
942 
944 
953  virtual bool beginExport()
954  {
955  return true;
956  }
957 
959 
965  virtual PWP_BOOL write() = 0;
966 
968 
976  virtual bool endExport()
977  {
978  return true;
979  }
980 
982  CaePlugin(const CaePlugin &src);
983 
985  CaePlugin & operator=(const CaePlugin &rhs);
986 
988 
1005  if (0 != rti_.fp) {
1006  int mode = 0;
1007  switch (encoding()) {
1008  case PWP_ENCODING_ASCII:
1009  mode = pwpWrite | pwpAscii;
1010  break;
1011  case PWP_ENCODING_BINARY:
1012  mode = pwpWrite | pwpBinary;
1013  break;
1015  mode = pwpWrite | pwpUnformatted;
1016  break;
1017  default:
1018  break;
1019  }
1020  rtFile_.wrap(rti_.fp, exportDestination(), mode);
1021  rti_.fp = 0; // rtFile_ now owns rti_.fp
1022  }
1023  else {
1024  rtFile_.wrap(0);
1025  }
1028  }
1029 
1030 protected:
1032  MT model_;
1036 };
1037 
1038 #include "CaePluginImpl.h"
1039 
1040 
1041 //***************************************************************************
1042 //***************************************************************************
1043 //***************************************************************************
1044 
1045 #if !defined(PWGM_HIDE_UNSTRUCTURED_API)
1046 #include "CaeUnsGridModel.h"
1047 
1071 #endif
1072 
1073 
1074 //***************************************************************************
1075 //***************************************************************************
1076 //***************************************************************************
1077 
1078 #if !defined(PWGM_HIDE_STRUCTURED_API)
1079 #include "CaeStrGridModel.h"
1080 
1104 #endif
1105 
1106 #endif // _CAEPLUGIN_H_
PWP_BOOL conditionsOnly
Set to PWP_TRUE if only Conditions exported.
Definition: apiCAEP.h:193
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:579
static bool allowElementTopologies(CAEP_RTITEM &rti, bool structured, bool unstructured, bool prismatic)
Set the "AllowedElementTopologies" CAE plugin info value.
Definition: CaePlugin.h:923
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:790
static bool assignInfoValue(CAEP_RTITEM &rti, const char key[], const char value[], bool createIfNotExists=true)
Set a CAE plugin info value.
Definition: CaePlugin.h:875
PWP_ENUM_VALTYPE
Supported PWP-API getValue() transfer types.
Definition: apiPWP.h:612
const char * precisionStr() const
Get a string representation of the requested data precision.
Definition: CaePlugin.h:337
Grid element handle declaration.
Definition: apiGridModel.h:428
bool wrap(FILE *fp, std::string filename=std::string(), int mode=0)
Take ownership of fp opened using pwpFileOpen(filename, mode).
Definition: PwpFile.cxx:597
const MT & model() const
Get the grid model object.
Definition: CaePlugin.h:74
transfer value is a PWP_REAL
Definition: apiPWP.h:616
static PWP_VERSIONVAL getInfo(PWP_PLUGININFO &pluginInfo)
Get information about this plugin.
Definition: CaePlugin.h:475
const char * encodingStr() const
Get a string representation of the requested data encoding.
Definition: CaePlugin.h:378
CaePlugin< CaeStrGridModel > CaeStrPlugin
Definition: CaePlugin.h:1103
PWP_ENUM_ENCODING encoding
export file encoding.
Definition: apiCAEP.h:197
unsigned int PWP_UINT32
32-bit unsigned integer
Definition: apiPWP.h:194
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:834
PWU_RTITEM * pApiData
Pointer to the associated PWU_RTITEM structure.
Definition: apiCAEPUtils.h:135
const CAEP_FORMATINFO & formatInfo() const
Get the plugin&#39;s export format settings.
Definition: CaePlugin.h:118
transfer value is a PWP_INT
Definition: apiPWP.h:614
virtual PWP_BOOL write()=0
Called once by run() to perform the export logic.
Pointwise Plugin API (PWP-API)
bool isUnformattedEncoding() const
Check if FORTRAN unformatted encoding is requested.
Definition: CaePlugin.h:370
virtual bool endExport()
Called once by run() at the end of an export sequence.
Definition: CaePlugin.h:976
PWP_ENDIANNESS setByteOrder(PWP_ENDIANNESS order)
Set the byte order used for writes.
Definition: PwpFile.cxx:650
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:691
unsigned long PWP_UINT
unsigned integer same size as void*
Definition: apiPWP.h:158
CaePlugin< CaeUnsGridModel > CaeUnsPlugin
Definition: CaePlugin.h:1070
The information returned for each supported CAEP exporter.
Definition: apiCAEP.h:100
CaePlugin(CAEP_RTITEM *pRti, PWGM_HGRIDMODEL model, const CAEP_WRITEINFO *pWriteInfo)
Template constructor.
Definition: CaePluginImpl.h:19
bool isBinaryEncoding() const
Check if binary encoding is requested.
Definition: CaePlugin.h:362
void setProgressMajorSteps(PWP_UINT32 steps)
Set the number of major export steps.
Definition: CaePlugin.h:185
void setLanguage(const char language[])
Set the active language.
Definition: CaePlugin.h:458
PWP_UINT32 BCCnt
The number of BC definitions.
Definition: apiCAEPUtils.h:148
Version data.
Definition: apiPWP.h:392
MT model_
The grid model being exported.
Definition: CaePlugin.h:1032
void wrapRuntimeFile()
Pass ownership of the runtime FILE poiter to a PwpFile object.
Definition: CaePlugin.h:1004
bool isAsciiEncoding() const
Check if ascii encoding is requested.
Definition: CaePlugin.h:354
Pointwise Grid Model API Specification (PWGM-API)
PWP_VERSION libVer
software library release version
Definition: apiPWP.h:586
PWP_ENUM_PRECISION
File precision values.
Definition: apiPWP.h:718
static bool isValid(H h)
Check if a handle is valid.
Definition: CaePlugin.h:535
CAEP_FORMATINFO FormatInfo
The CAE Plugin format data.
Definition: apiCAEPUtils.h:131
transfer value is a const char*
Definition: apiPWP.h:613
const PWP_APIINFO & apiInfo() const
Get the plugin&#39;s API settings.
Definition: CaePlugin.h:127
static bool isValid(PWGM_HELEMENT h)
Check if an element handle is valid.
Definition: CaePlugin.h:544
#define PWP_HEGRP_ISVALID(h)
Test the validity of a PWP_DECLARE_HELEMGROUP() handle.
Definition: apiPWP.h:299
const char * support
support description (phone, web-link).
Definition: apiPWP.h:592
PWP_ENUM_DIMENSION dimension() const
Get the export&#39;s requested dimensionality.
Definition: CaePlugin.h:386
void caeuSendErrorMsg(CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
Send an error text message (PWP_MSGID_ERROR) to the framework.
bool isSinglePrecision() const
Check if single numerical precision is requested.
Definition: CaePlugin.h:321
const char * fileDest
requested file destination.
Definition: apiCAEP.h:189
PWP_ENDIANNESS byteOrder() const
Get the export&#39;s requested byte order.
Definition: CaePlugin.h:418
PWP_VOID PwpSetLanguage(const char language[])
Sets the active language.
Definition: apiPWP.cxx:127
PWP_ENUM_PRECISION precision() const
Get the export&#39;s requested numerical precision.
Definition: CaePlugin.h:313
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:852
void sendErrorMsg(const char *msg, PWP_UINT32 id=0) const
Send an error message.
Definition: CaePlugin.h:279
Installation&#39;s license data. NOT IMPLEMENTED YET.
Definition: apiPWP.h:407
PWP_BOOL caeuProgressEndStep(CAEP_RTITEM *pRti)
Completes a progress tracking major step.
#define CAEPU_RT_ENCODING_TEXT(rti)
Get the export precision text from CAEP_RTITEM data pointed to by rti.
Definition: apiCAEPUtils.h:812
const char * exportDestination() const
Get the requested file destination string.
Definition: CaePlugin.h:108
MT & model()
Get the grid model object.
Definition: CaePlugin.h:66
void caeuSendWarningMsg(CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
Send a warning text message (PWP_MSGID_WARNING) to the framework.
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:523
#define CAEPU_RT_DIM_TEXT(rti)
Get the export dimension text from CAEP_RTITEM data pointed to by rti.
Definition: apiCAEPUtils.h:756
bool progressBeginStep(PWP_UINT32 steps) const
Indicates the start of a major progress step.
Definition: CaePlugin.h:199
PWP_BOOL PwpIsLicensed(const char api[], const PWP_LICENSEDATA *pLicenseData)
Determines if plugin api is licensed for use on this machine.
Definition: apiPWP.cxx:107
FILE * fp
Runtime FILE pointer.
Definition: apiCAEPUtils.h:201
CaePlugin & operator=(const CaePlugin &rhs)
Private assignment operator.
Definition: CaePluginImpl.h:78
The API information returned by plugins for each supported API.
Definition: apiPWP.h:568
bool isLittleEndian() const
Check if little endian byte ordering is requested.
Definition: CaePlugin.h:434
bool isDoublePrecision() const
Check if double numerical precision is requested.
Definition: CaePlugin.h:329
bool isLicensed(const PWP_LICENSEDATA &license) const
Check if license data is valid.
Definition: CaePlugin.h:445
Writes solver files.
Definition: PwpFile.h:111
PWP_UINT32 progMajorSteps_
# of major export steps.
Definition: CaePlugin.h:1034
transfer value is a PWP_BOOL
Definition: apiPWP.h:618
CAEP utilities.
PWP_ENUM_DIMENSION
Supported dimensionality values.
Definition: apiPWP.h:679
PWP_VERSION pwpVer
plugin conforms to this PWP-API version
Definition: apiPWP.h:583
PWP_BOOL caeuAssignInfoValue(const char key[], const char value[], bool createIfNotExists)
Creates a key/value pair that defines a CAE info attribute.
int PWP_BOOL
logical value
Definition: apiPWP.h:221
void sendInfoMsg(const char *msg, PWP_UINT32 id=0) const
Send an information message.
Definition: CaePlugin.h:248
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:645
PWP_ENUM_ENCODING
File encoding values.
Definition: apiPWP.h:698
PWP_ENUM_PRECISION setPrecision(PWP_ENUM_PRECISION precision)
Set the floating point precision used for writes.
Definition: PwpFile.cxx:666
PWP_BOOL run()
Starts the export sequence.
Definition: CaePluginImpl.h:36
bool isDimension3D() const
Check if 3D is requested.
Definition: CaePlugin.h:394
CAE export write control information.
Definition: apiCAEP.h:186
bool isDimension2D() const
Check if 2D is requested.
Definition: CaePlugin.h:402
void caeuSendDebugMsg(CAEP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
Send a debug text message (PWP_MSGID_DEBUG) to the framework.
transfer value is a PWP_UINT
Definition: apiPWP.h:615
static PWP_VERSION getVersion()
Get the plugin&#39;s release version.
Definition: CaePlugin.h:493
Pointwise CAE Plugin API (CAEP-API)
#define PWGM_HELEMENT_ISVALID(h)
returns non-zero value if handle is valid
Definition: apiGridModel.h:430
const char * author
company/author description
Definition: apiPWP.h:589
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:742
transfer value is a const char*
Definition: apiPWP.h:617
bool progressEndStep() const
Indicates the end of a major progress step.
Definition: CaePlugin.h:224
static const char * getAuthorInfo()
Get the plugin&#39;s author description string.
Definition: CaePlugin.h:503
long PWP_INT
integer same size as void*
Definition: apiPWP.h:155
bool conditionsOnly() const
Check if only BCs are to be exported.
Definition: CaePlugin.h:305
FILE * fp() const
Get the FILE pointer.
Definition: PwpFile.h:628
void sendDebugMsg(const char *msg, PWP_UINT32 id=0) const
Send a debug message.
Definition: CaePlugin.h:259
PWP_ENUM_DIMENSION dimension
export dimensionality.
Definition: apiCAEP.h:205
void sendWarningMsg(const char *msg, PWP_UINT32 id=0) const
Send a warning message.
Definition: CaePlugin.h:269
bool progressIncrement() const
Indicates the completion of a progress sub step within the current major step.
Definition: CaePlugin.h:212
FILE * fp() const
Get the FILE pointer wrapped by the runtime file object.
Definition: CaePlugin.h:94
PWP_UINT32 PWP_VERSIONVAL
Version data component value.
Definition: apiPWP.h:385
static const char * getSupportInfo()
Get the plugin&#39;s support description string.
Definition: CaePlugin.h:513
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:670
const char * copyright
copyright description
Definition: apiPWP.h:595
PWP_ENDIANNESS byteOrder
export byte order.
Definition: apiCAEP.h:209
bool isBigEndian() const
Check if big endian byte ordering is requested.
Definition: CaePlugin.h:426
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:617
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:1031
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:718
const char * name
full API spec name
Definition: apiPWP.h:571
static PWP_VERSION getApiVersion()
Get the plugin&#39;s API version.
Definition: CaePlugin.h:483
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:596
PwpFile rtFile_
runtime file object
Definition: CaePlugin.h:1035
bool aborted() const
Check if an export has been aborted.
Definition: CaePlugin.h:290
PWP_ENDIANNESS
Flags used to indicate endianness or control endian behaviors in functions.
Definition: apiPWP.h:738
#define CAEPU_RT_PREC_TEXT(rti)
Get the export precision text from CAEP_RTITEM data pointed to by rti.
Definition: apiCAEPUtils.h:784
The data representing a CAE exporter instance.
Definition: apiCAEPUtils.h:126
const CAEP_WRITEINFO & writeInfo_
The export options.
Definition: CaePlugin.h:1033
PWP_ENUM_PRECISION precision
export precision.
Definition: apiCAEP.h:201
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:815
PwpFile & runtimeFile() const
Get the runtime file object.
Definition: CaePlugin.h:85
An opaque handle to a grid model.
Definition: apiGridModel.h:327
virtual bool beginExport()
Called once by run() at the start of an export sequence.
Definition: CaePlugin.h:953
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.
virtual ~CaePlugin()
Destructor.
Definition: CaePluginImpl.h:30
const char * dimensionStr() const
Get a string representation of the requested data dimensionality.
Definition: CaePlugin.h:410
PWP_APIINFO apiInfo
The PWP-API instance information.
Definition: apiPWPUtils.h:50
double PWP_REAL
64-bit real
Definition: apiPWP.h:218
Provides general information about a plugin.
Definition: apiPWP.h:580
PWP_ENUM_ENCODING encoding() const
Get the export&#39;s requested data encoding.
Definition: CaePlugin.h:346
static PWP_ENDIANNESS getOsEndianness()
Query the OS&#39;s native endianness.
Definition: CaePlugin.h:466
static bool allowByteOrders(CAEP_RTITEM &rti, bool big, bool little)
Set the "AllowedFileByteOrders" CAE plugin info value.
Definition: CaePlugin.h:891
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:763