2 * NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
4 * Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
6 * Tecplot hereby grants OpenCFD limited authority to distribute without
7 * alteration the source code to the Tecplot Input/Output library, known
8 * as TecIO, as part of its distribution of OpenFOAM and the
9 * OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
10 * granted access to the TecIO source code, and may redistribute it for the
11 * purpose of maintaining the converter. However, no authority is granted
12 * to alter the TecIO source code in any form or manner.
14 * This limited grant of distribution does not supersede Tecplot, Inc.'s
15 * copyright in TecIO. Contact Tecplot, Inc. for further information.
18 * 3535 Factoria Blvd, Ste. 550
19 * Bellevue, WA 98006, USA
20 * Phone: +1 425 653 1200
21 * http://www.tecplot.com/
24 /*****************************************************************
25 *****************************************************************
27 ****** Copyright (C) 1988-2008 Tecplot, Inc. *******
29 *****************************************************************
30 *****************************************************************/
31 /* BEGINREMOVEFROMADDON */
32 /* NOTE: All code contained between comments that look like
33 * BEGINREMOVEFROMADDON
35 * are pulled out to create the MASTER.h file used in addons.
37 /* ENDREMOVEFROMADDON */
43 * Annotations that specify the life cycle of objects returned from functions
44 * and input and output parameters sent as function parameters. The following
45 * table specifies the meaning in their context. The annotations provide code
46 * generation tools with information for building language bindings to various
47 * Tecplot 360 and Tecplot SDK related libraries.
49 * For purposes of this table the client is one making the call and the service
52 * +==================+=========================+=================================================================+
53 * | Function Context | Annotation | Meaning |
56 * |==================+=========================+=================================================================|
57 * | Result | TP_OUT | Default for a function return value that does not transfer |
58 * | | | ownership. Because this is the most common scenario this |
59 * | | | annotation is implied and never explicitly used in this |
61 * |------------------+-------------------------+-----------------------------------------------------------------|
62 * | Scalar Result | TP_GIVES | Annotates a function scalar return value as one who's ownership |
63 * | | | is transfered to the client. The client is responsible for |
64 * | | | properly disposing the value. |
65 * |------------------+-------------------------+-----------------------------------------------------------------|
66 * | Array Result | TP_ARRAY_GIVES | Annotates a function array return value as one who's ownership |
67 * | | | is transfered to the client. The client is responsible for |
68 * | | | properly disposing the value. |
69 * |==================+=========================+=================================================================|
70 * | Parameter | TP_IN | Default for a function input parameter value sent to the |
71 * | | | service. Because this is the most common scenario this |
72 * | | | annotation is implied and never explicitly used. |
73 * |------------------+-------------------------+-----------------------------------------------------------------|
74 * | Parameter | TP_ACQUIRES | Annotates a function parameter as one that sends a value to |
75 * | | | the service through the parameter and acquires shared |
76 * | | | ownership of the input value with the client. The service is |
77 * | | | not responsible for disposing the value however it is |
78 * | | | expected that a symmetric API exists that "releases" the |
79 * | | | library of this shared ownership. For example: |
80 * | | | void addListener(TP_ACQUIRES Listener& listener); |
81 * | | | void removeListener(TP_RELEASES Listener& listener); |
82 * |------------------+-------------------------+-----------------------------------------------------------------|
83 * | Parameter | TP_RELEASES | Annotates a function parameter as one that sends a value to |
84 * | | | the service through the parameter and releases previously |
85 * | | | shared ownership of the |
86 * | | | input value with the client. The service is not responsible |
87 * | | | for disposing the value however it is expected that a |
88 * | | | symmetric API exists that "releases" the library of this |
89 * | | | shared ownership. For example: |
90 * | | | void addListener(TP_ACQUIRES Listener& listener); |
91 * | | | void removeListener(TP_RELEASES Listener& listener); |
92 * |------------------+-------------------------+-----------------------------------------------------------------|
93 * | Scalar Parameter | TP_OUT | Annotates a function scalar parameter as one that returns a |
94 * | | | value to the client through the parameter but does not |
95 * | | | transfer ownership of the output value to the client. |
96 * | | | The client is not responsible for disposing the value. |
97 * |------------------+-------------------------+-----------------------------------------------------------------|
98 * | Scalar Parameter | TP_IN_OUT | Annotates a function scalar parameter as one that both sends |
99 * | | | a value to the service and returns a value to the client |
100 * | | | through the parameter. Ownership of the input value is not |
101 * | | | transfered to the service nor is ownership of the output value |
102 * | | | transfered to the client. The service is not responsible for |
103 * | | | disposing the input value and the client is not responsible |
104 * | | | for disposing the output value. |
105 * |------------------+-------------------------+-----------------------------------------------------------------|
106 * | Array Parameter | TP_ARRAY_OUT | Annotates a function array parameter as one that returns a |
107 * | | | value to the client through the parameter but does not |
108 * | | | transfer ownership of the output value to the client. |
109 * | | | The client is not responsible for disposing the value. |
110 * |------------------+-------------------------+-----------------------------------------------------------------|
111 * | Array Parameter | TP_ARRAY_IN_OUT | Annotates a function array parameter as one that both sends |
112 * | | | a value to the service and returns a value to the client |
113 * | | | through the parameter. Ownership of the input value is not |
114 * | | | transfered to the service nor is ownership of the output value |
115 * | | | transfered to the client. The service is not responsible for |
116 * | | | disposing the input value and the client is not responsible |
117 * | | | for disposing the output value. |
118 * |------------------+-------------------------+-----------------------------------------------------------------|
119 * | Scalar Parameter | TP_GIVES | Annotates a function scalar parameter as one that returns a |
120 * | | | value to the client through the parameter and transfers |
121 * | | | ownership of the output value to the client. The client is |
122 * | | | responsible for properly disposing the value. |
123 * |------------------+-------------------------+-----------------------------------------------------------------|
124 * | Scalar Parameter | TP_RECEIVES | Annotates a function scalar parameter as one that sends a value |
125 * | | | to the service through the parameter and transfers ownership |
126 * | | | of the input value to the service. The service is responsible |
127 * | | | for properly disposing the value. |
128 * |------------------+-------------------------+-----------------------------------------------------------------|
129 * | Scalar Parameter | TP_RECEIVES_GIVES | Annotates a function scalar parameter as one that both sends |
130 * | | | a value to the service and returns a value to the client |
131 * | | | through the parameter. Ownership of the input value is |
132 * | | | transfered to the service and ownership of the output value is |
133 * | | | transfered to the client. The service is responsible for |
134 * | | | properly disposing the input value and the client is |
135 * | | | responsible for properly disposing the output value. |
136 * |------------------+-------------------------+-----------------------------------------------------------------|
137 * | Array Parameter | TP_ARRAY_GIVES | Annotates a function array parameter as one that returns a |
138 * | | | value to the client through the parameter and transfers |
139 * | | | ownership of the output value to the client. The client is |
140 * | | | responsible for properly disposing the value. |
141 * |------------------+-------------------------+-----------------------------------------------------------------|
142 * | Array Parameter | TP_ARRAY_RECEIVES | Annotates a function array parameter as one that sends a value |
143 * | | | to the service through the parameter and transfers ownership |
144 * | | | of the input value to the service. The service is responsible |
145 * | | | for properly disposing the value. |
146 * |------------------+-------------------------+-----------------------------------------------------------------|
147 * | Array Parameter | TP_ARRAY_RECEIVES_GIVES | Annotates a function array parameter as one that both sends |
148 * | | | a value to the service and returns a value to the client |
149 * | | | through the parameter. Ownership of the input value is |
150 * | | | transfered to the service and ownership of the output value is |
151 * | | | transfered to the client. The service is responsible for |
152 * | | | properly disposing the input value and the client is |
153 * | | | responsible for properly disposing the output value. |
154 * |==================+===================+=======================================================================|
158 * First check to make sure that our life-cycle keywords are not in conflict with any system defines.
160 #if defined TP_ACQUIRES || \
161 defined TP_RELEASES || \
163 defined TP_IN_OUT || \
164 defined TP_ARRAY_OUT || \
165 defined TP_ARRAY_IN_OUT || \
166 defined TP_GIVES || \
167 defined TP_RECEIVES || \
168 defined TP_RECEIVES_GIVES || \
169 defined TP_ARRAY_GIVES || \
170 defined TP_ARRAY_RECEIVES || \
171 defined TP_ARRAY_RECEIVES_GIVES
172 #error "Tecplot's parameter life-cycle keywords are in direct conflict with other meanings."
175 #if defined INCLUDE_OBJECT_LIFECYCLE_ANNOTATIONS
176 #define TP_ACQUIRES __attribute((gccxml("acquires","in")))
177 #define TP_RELEASES __attribute((gccxml("releases","in")))
178 #define TP_OUT __attribute((gccxml("out")))
179 #define TP_IN_OUT __attribute((gccxml("in","out")))
180 #define TP_ARRAY_OUT __attribute((gccxml("array","out")))
181 #define TP_ARRAY_IN_OUT __attribute((gccxml("array","in","out")))
182 #define TP_GIVES __attribute((gccxml("gives","out")))
183 #define TP_RECEIVES __attribute((gccxml("receives","in")))
184 #define TP_RECEIVES_GIVES __attribute((gccxml("receives","in","gives","out")))
185 #define TP_ARRAY_GIVES __attribute((gccxml("array","gives","out")))
186 #define TP_ARRAY_RECEIVES __attribute((gccxml("array","receives","in")))
187 #define TP_ARRAY_RECEIVES_GIVES __attribute((gccxml("array","receives","in","gives","out")))
194 #define TP_ARRAY_IN_OUT
197 #define TP_RECEIVES_GIVES
198 #define TP_ARRAY_GIVES
199 #define TP_ARRAY_RECEIVES
200 #define TP_ARRAY_RECEIVES_GIVES
203 /* BEGINREMOVEFROMADDON */
204 #ifdef NO_ASSERTS /* obfuscate names */
205 #define ShutDownLicensing FreeAllExtraMapData
206 #define ProcessYMapInXDirection
207 #endif /* NO_ASSERTS */
210 /**************************************
212 **************************************/
213 #if defined TECPLOTKERNEL && !defined ENGINE
214 /* CORE SOURCE CODE REMOVED */
215 #if defined FLEXLM && defined RLM
217 #if !defined FLEXLM && !defined RLM
232 #include "TranslatedString.h"
235 * The following is a temporary fix for figuring out which product is
236 * running. In the future when Focus and 360 use the same code base,
237 * we will have to do this dynamically (either with flags on the compiler
238 * or variables within Tecplot).
240 /* ENDREMOVEFROMADDON */
244 #if !defined TECPLOTKERNEL
250 /* For the sake of some older add-ons,
251 defined _WINDOWS, WINDOWS, and WIN32
252 New code should always use MSWIN */
258 #if !defined _WINDOWS
260 #endif /* !_WINDOWS */
270 #elif defined CHECKED_BUILD
271 #if defined NO_ASSERTS
281 #if !defined NO_ASSERTS
285 #endif /* TECPLOTKERNEL */
288 #define VS_2005 /* Using VS2005 Compiler */
291 #if !defined TECPLOTKERNEL && defined VS_2005
292 /* Suppress the warnings about the
293 deprecated c runtime functions. */
295 #if !defined _CRT_SECURE_NO_DEPRECATE
296 #define _CRT_SECURE_NO_DEPRECATE
298 #endif /* !TECPLOTKERNEL && VS_2005 */
304 # error "Both NDEBUG and _DEBUG defined"
306 #elif defined TECPLOTKERNEL
312 /* Now a requirement */
313 #define USE_3D_HARDWARE
323 #if defined QUICKDEMO
327 #if defined MicrosoftC
344 #if defined IBMRS6000X
348 #if defined COMPAQALPHAX
354 #if defined DECALPHAX
363 #if defined SUNSOLARISX || defined SUNSOLARIS86X
371 #if defined IRISX || defined CRAYX || defined HPX || defined SUNX || defined CONVEXX
376 #if defined DECX || defined LINUX || defined IBMRS6000X || defined COMPAQX || defined DARWIN || defined darwin
380 /* BEGINREMOVEFROMADDON */
384 /* A bit of OEM stuff */
385 #define OEM_INVALID_CHECKSUM (LgIndex_t) -1
387 /* Hide the name of the checksum function */
389 # define DECRYPTTIMEDCODE FixupPlot
390 # define CHECKHASHEDCODE ExpandPlot
391 # define UPDATECLASSICOEMEHCKSUM ToggleQuadrants
392 # define UPDATEOEMCHECKSUM ComputeAngleFromQuatrant
393 # define InitOemSettings InitAngleQuatrantSettings
397 #define USE_TRUETYPEFONTS
399 /* ENDREMOVEFROMADDON */
401 /* BEGINREMOVEFROMADDON */
403 #ifdef __cplusplus // STL
407 #pragma warning(push, 1) /* warning disabling bellow doesn't actually have any effect on compiler warning.
408 * It appears that Microsft STL enables all the warning right back on.
409 * Therefore, the only way to hide them is to push existing warning level,
410 * lower the level for the time while STL headers are included and then restore
411 * previous warning level with a "pragma warning(pop)"
414 #pragma warning(disable: 4018) // signed/unsigned mismatch
415 #pragma warning(disable: 4100) // unreferenced formal parameter
416 #pragma warning(disable: 4146) // unary minus operator applied to unsigned type,
417 // result still unsigned
418 #pragma warning(disable: 4244) // 'conversion' conversion from 'type1' to 'type2',
419 // possible loss of data
420 #pragma warning(disable: 4245) // conversion from 'type1' to 'type2', signed/unsigned
422 #pragma warning(disable: 4511) // 'class' : copy constructor could not be generated
423 #pragma warning(disable: 4512) // 'class' : assignment operator could not be generated
424 #pragma warning(disable: 4663) // C++ language change: to explicitly specialize class
426 #pragma warning(disable: 4710) // 'function' : function not inlined
427 #pragma warning(disable: 4786) // identifier was truncated to 'number' characters
428 // in the debug information
432 #pragma warning(pop) //Restore old warning state.
437 /* ENDREMOVEFROMADDON */
440 /* BEGINREMOVEFROMADDON */
442 /* CORE SOURCE CODE REMOVED */
445 #endif /* TECPLOTKERNEL */
446 /* ENDREMOVEFROMADDON */
448 #ifndef TECPLOTKERNEL
450 #define Widget LONG_PTR /* correct for 32 & 64 bit builds */
461 #if defined UNIXX && defined ENGINE
462 typedef void *Widget
;
468 #if !defined SYSV && !defined MSWIN
472 #if defined (MicrosoftC)
481 #include <sys/types.h>
494 /* BEGINREMOVEFROMADDON */
495 #if defined TECPLOTKERNEL
496 /* CORE SOURCE CODE REMOVED */
497 #if !defined THREADS_BY_PTHREADS && !defined THREADS_BY_WINAPI
499 #if defined THREADS_BY_PTHREADS
502 /* ENDREMOVEFROMADDON */
504 /* BEGINREMOVEFROMADDON */
505 /* OPENGL currently a must have */
506 #if defined TECPLOTKERNEL
507 /* CORE SOURCE CODE REMOVED */
513 /* ENDREMOVEFROMADDON */
515 * If not building the tecplot kernel then at least
516 * include the X Instrinsics. This will make most
517 * development for addons etc work.
520 /* NOTE: MOTIF not defined if ENGINE is defined */
522 # if defined TECPLOTKERNEL
523 /* CORE SOURCE CODE REMOVED */
524 # if XmVERSION == 1 && XmREVISION == 0
528 # include <X11/Intrinsic.h>
530 typedef void *Widget
;
536 #define CREATE_DIALOG_PARAMS Widget W
537 typedef Widget ComboBoxWidget_t
;
538 typedef Widget DropDownListWidget_t
;
539 typedef Widget FileDialogWidget_t
;
540 typedef Widget LabelWidget_t
;
541 typedef Widget ListWidget_t
;
542 typedef Widget OptionMenuWidget_t
;
543 typedef Widget PullDownMenuWidget_t
;
544 typedef Widget ScaleWidget_t
;
545 typedef Widget TextFieldWidget_t
;
546 typedef Widget ToggleWidget_t
;
547 typedef Widget ButtonWidget_t
;
548 typedef Widget GridWidget_t
;
552 #define CREATE_DIALOG_PARAMS CWnd *, LaunchDialogMode_e
553 typedef Widget ComboBoxWidget_t
;
554 typedef Widget DropDownListWidget_t
;
555 typedef Widget FileDialogWidget_t
;
556 typedef Widget LabelWidget_t
;
557 typedef Widget ListWidget_t
;
558 typedef Widget OptionMenuWidget_t
;
559 typedef Widget PullDownMenuWidget_t
;
560 typedef Widget ScaleWidget_t
;
561 typedef Widget TextFieldWidget_t
;
562 typedef Widget ToggleWidget_t
;
563 typedef Widget ButtonWidget_t
;
564 typedef Widget GridWidget_t
;
567 /* BEGINREMOVEFROMADDON */
568 #if defined MSWIN && defined TECPLOTKERNEL
569 /* CORE SOURCE CODE REMOVED */
585 #if defined TECPLOTKERNEL
586 /* CORE SOURCE CODE REMOVED */
587 #endif /* TECPLOTKERNEL */
588 /* ENDREMOVEFROMADDON */
590 /* Assume that if TRACE is not defined, then none of the TRACE macros are */
592 /* TRACE is not used by non-debug builds */
596 #define TRACE0(s) __noop
597 #define TRACE1(S,a1) __noop
598 #define TRACE2(s,a1,a2) __noop
599 #define TRACE3(s,a1,a2,a3) __noop
601 #define TRACE(str) ((void)0)
602 #define TRACE0(str) ((void)0)
603 #define TRACE1(str,a1) ((void)0)
604 #define TRACE2(str,a1,a2) ((void)0)
605 #define TRACE3(str,a1,a2,a3) ((void)0)
609 /* If the add-on is running in debug mode but does not
610 * use MFC, then no TRACE macro is available. Thus, to make tracing available,
611 * map TRACE to the win32 OutpuDebugString() function.
613 # define TRACE(str) do { OutputDebugStringA(str); } while (0)
614 # define TRACE1(str,a1) do { char s[5000]; sprintf(s,str,a1); OutputDebugStringA(s); } while (0)
615 # define TRACE2(str,a1,a2) do { char s[5000]; sprintf(s,str,a1,a2); OutputDebugStringA(s); } while (0)
616 # define TRACE3(str,a1,a2,a3) do { char s[5000]; sprintf(s,str,a1,a2,a3); OutputDebugStringA(s); } while (0)
617 # define TRACE0(str) TRACE(str)
620 #define TRACE0 printf
621 #define TRACE1 printf
622 #define TRACE2 printf
623 #define TRACE3 printf
626 #endif /* !defined (TRACE) */
630 Platform independent way for add-ons to know how much space
631 to allocate for a filename.
633 #if !defined MAX_SIZEOFUTF8CHAR
634 #define MAX_SIZEOFUTF8CHAR 1
637 #if !defined (MaxCharsFilePath)
639 # define MaxCharsFilePath (_MAX_PATH*MAX_SIZEOFUTF8CHAR+1) /* Includes traling '\0' */
641 # define MaxCharsFilePath 2047 /* ...not really a hard limit for Linux/Unix */
643 #endif /* !MaxCharsFilePath */
645 /* BEGINREMOVEFROMADDON */
648 * Under Windows, if we are doing a release build (NDEBUG) that is not a CHECKED_BUILD
649 * then NO_ASSERTS should be defined
651 #if defined MSWIN && defined NDEBUG && !defined NO_ASSERTS && !defined CHECKED_BUILD
652 /* intentionally break the compile */
653 # error "define NO_ASSERTS for release builds"
657 * Under Windows, if we are doing a CHECKED_BUILD then it should
658 * also be a release build (NDEBUG)
660 #if defined MSWIN && defined CHECKED_BUILD && !defined NDEBUG
661 # error "CHECKED_BUILDS must also be release builds"
665 #if defined NO_ASSERTS
666 # define USE_MACROS_FOR_FUNCTIONS
668 /* ENDREMOVEFROMADDON */
670 /* BEGINREMOVEFROMADDON */
672 * Under Linux the definition of NULL has a cast that conflicts with our own
673 * casting causing warnings that make it tough to find real problems.
675 #if defined LINUX && defined NULL
682 #if !defined MSWIN && !defined ENGINE && !defined ISMESA
683 #define DISALLOW_OFFSCREEN_EXPORT_IN_BATCH
686 /* ENDREMOVEFROMADDON */
688 #endif /* _MASTER_H_ */