1 #ifndef DATAIO4_H
2 #define DATAIO4_H
3 /*
4 ******************************************************************
5 ******************************************************************
6 *******                                                   ********
7 ******  (C) 1988-2010 Tecplot, Inc.                        *******
8 *******                                                   ********
9 ******************************************************************
10 ******************************************************************
11 */
12 
13 #include <set>
14 
15 #if defined EXTERN
16 #undef EXTERN
17 #endif
18 #if defined DATAIO4MODULE
19 #define EXTERN
20 #else
21 #define EXTERN extern
22 #endif
23 
24 EXTERN double GetNextValue(FileStream_s    *FileStream,
25                            FieldDataType_e  FieldDataType,
26                            double           Min,
27                            double           Max,
28                            Boolean_t       *IsOk);
29 EXTERN LgIndex_t GetNextI(FileStream_s *FileStream,
30                           Boolean_t    *IsOk);
31 EXTERN LgIndex_t GetIoFileInt(FileStream_s *FileStream,
32                               short         Version,
33                               LgIndex_t     Min,
34                               LgIndex_t     Max,
35                               Boolean_t    *IsOk);
36 EXTERN Boolean_t ReadInString(FileStream_s  *FileStream,
37                               short          IVersion,
38                               int            MaxCharacters,
39                               char         **S,
40                               Boolean_t      ProcessData);
41 EXTERN void ReadByteBlock(FileStream_s *FileStream,
42                           Boolean_t     DoRead,
43                           Byte_t       *Buffer,
44                           HgIndex_t     StartIndex,
45                           HgIndex_t     NumValues,
46                           Boolean_t    *IsOk);
47 EXTERN void ReadInt16Block(FileStream_s *FileStream,
48                            Boolean_t     DoRead,
49                            Int16_t      *Buffer,
50                            HgIndex_t     StartIndex,
51                            HgIndex_t     NumValues,
52                            Boolean_t    *IsOk);
53 EXTERN void ReadInt16BlockToInt32(FileStream_s *FileStream,
54                                   Boolean_t     DoRead,
55                                   Int32_t      *Buffer,
56                                   HgIndex_t     StartIndex,
57                                   HgIndex_t     NumValues,
58                                   Boolean_t    *IsOk);
59 EXTERN void ReadInt32Block(FileStream_s *FileStream,
60                            Boolean_t     DoRead,
61                            Int32_t      *Buffer,
62                            HgIndex_t     StartIndex,
63                            HgIndex_t     NumValues,
64                            Boolean_t    *IsOk);
65 EXTERN void ReadPureBlock(FileStream_s   *FileStream,
66                           Boolean_t       DoRead,
67                           void           *Buffer,
68                           FieldDataType_e FieldDataType,
69                           HgIndex_t       StartIndex,
70                           HgIndex_t       NumValues,
71                           Boolean_t      *IsOk);
72 EXTERN void ReadBlock(FileStream_s   *FileStream,
73                       FieldData_pa    FieldData,
74                       Boolean_t       DoRead,
75                       FieldDataType_e FieldDataTypeInFile,
76                       HgIndex_t       StartIndex,
77                       HgIndex_t       EndIndex,
78                       Boolean_t      *IsOk);
79 EXTERN void ReadClassicOrderedCCBlock(FileStream_s    *DataFileStream,
80                                       FieldData_pa     FieldData,
81                                       FieldDataType_e  FieldDataTypeInFile,
82                                       LgIndex_t        NumIPtsInFile,
83                                       LgIndex_t        NumJPtsInFile,
84                                       LgIndex_t        NumKPtsInFile,
85                                       Boolean_t       *IsOk);
86 EXTERN Boolean_t ReadInDataFileTypeTitleAndVarNames(FileStream_s   *FileStream,
87                                                     short           IVersion,
88                                                     char          **DataSetTitle,
89                                                     DataFileType_e *FileType,
90                                                     int            *NumVars,
91                                                     StringList_pa  *VarNames);
92 EXTERN Boolean_t ReadInZoneHeader(FileStream_s *FileStream,
93                                   short         IVersion,
94                                   ZoneSpec_s   *ZoneSpec,
95                                   Set_pa        IsVarCellCentered,
96                                   EntIndex_t    NumVars,
97                                   Boolean_t    *IsRawFNAvailable,
98                                   LgIndex_t    *FNNumBndryConns);
99 EXTERN Boolean_t ReadInCustomLabels(FileStream_s  *FileStream,
100                                     short          IVersion,
101                                     Boolean_t      OkToLoad,
102                                     StringList_pa *CustomLabelBase);
103 EXTERN Boolean_t ReadInUserRec(FileStream_s  *FileStream,
104                                short          IVersion,
105                                int            MaxCharactersAllowed,
106                                char         **UserRec);
107 EXTERN Boolean_t ReadInAuxData(FileStream_s *FileStream,
108                                short         IVersion,
109                                AuxData_pa    AuxData);
110 EXTERN Boolean_t ReadInGeometry(FileStream_s *FileStream,
111                                 short         IVersion,
112                                 Boolean_t     OkToLoad,
113                                 Geom_s       *G,
114                                 LgIndex_t     MaxDataPts);
115 EXTERN Boolean_t ReadInText(FileStream_s *FileStream,
116                             short         IVersion,
117                             Boolean_t     OkToLoad,
118                             Text_s       *T,
119                             LgIndex_t     MaxTextLen);
120 /*
121  * STDCALL since PreplotAsciiDatafile is sent to RegisterDataSetReader
122  * which can also be used by addons.
123  */
124 EXTERN Boolean_t STDCALL PreplotAsciiDatafile(char  *CurFName,
125                                               char  *BinaryFName,
126                                               char **MessageString);
127 EXTERN short GetInputVersion(FileStream_s *FileStream);
128 
129 EXTERN Boolean_t WriteBinaryInt16BlockUnaligned(FileStream_s *FileStream,
130                                                 Byte_t       *Int16Values,
131                                                 HgIndex_t     NumValues,
132                                                 Boolean_t     ValuesInNativeOrdering);
133 EXTERN Boolean_t WriteBinaryInt32BlockUnaligned(FileStream_s *FileStream,
134                                                 Byte_t       *Int32Values,
135                                                 HgIndex_t     NumValues,
136                                                 Boolean_t     ValuesInNativeOrdering);
137 EXTERN Boolean_t WriteBinaryByteBlock(FileStream_s    *FileStream,
138                                       const Byte_t    *ByteValues,
139                                       const HgIndex_t  NumValues);
140 EXTERN Boolean_t WriteBinaryInt16(FileStream_s *FileStream,
141                                   Int16_t       Value);
142 EXTERN Boolean_t WriteBinaryInt32(FileStream_s *FileStream,
143                                   Int32_t       Value);
144 EXTERN Boolean_t WriteBinaryReal(FileStream_s    *FileStream,
145                                  double           RR,
146                                  FieldDataType_e  FieldDataType);
147 EXTERN Boolean_t WriteFieldDataType(FileStream_s    *FileStream,
148                                     FieldDataType_e  FDT,
149                                     Boolean_t        WriteBinary);
150 EXTERN Boolean_t WriteBinaryFieldDataBlock(FileStream_s *FileStream,
151                                            FieldData_pa  D,
152                                            LgIndex_t     StartI,
153                                            LgIndex_t     NumValues);
154 EXTERN Boolean_t WriteCCFieldDataBlock(FileStream_s *FileStream,
155                                        FieldData_pa  FieldData,
156                                        Boolean_t     IsOrderedData,
157                                        LgIndex_t     NumIPts,
158                                        LgIndex_t     NumJPts,
159                                        LgIndex_t     NumKPts,
160                                        Boolean_t     WriteBinary,
161                                        SmInteger_t   AsciiPrecision);
162 EXTERN Boolean_t DumpDatafileString(FileStream_s *FileStream,
163                                     const char   *S,
164                                     Boolean_t     WriteBinary);
165 bool DumpGeometry(FileStream_s* FileStream,
166                   Geom_s const* Geom,
167                   Boolean_t     WriteBinary,
168                   Boolean_t     WriteGridDataAsPolar);
169 bool DumpText(FileStream_s* FileStream,
170               Text_s const* Text,
171               Boolean_t     WriteBinary,
172               Boolean_t     WriteGridDataAsPolar);
173 EXTERN Boolean_t DumpCustomAxisLabels(FileStream_s  *FileStream,
174                                       Boolean_t      WriteBinary,
175                                       StringList_pa  LabelBase);
176 
177 #if defined TECPLOTKERNEL
178 /* CORE SOURCE CODE REMOVED */
179 #endif
180 
181 #if defined TECPLOTKERNEL
182 /* CORE SOURCE CODE REMOVED */
183 #endif
184 
185 EXTERN Boolean_t WriteBinaryMagic(FileStream_s *FileStream);
186 
187 bool writeBinaryVersionNumber(FileStream_s& fileStream,
188                               int           versionNumber);
189 
190 #endif //DATAIO4_H
191