SzlFileLoader.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398
  1. #pragma once
  2. #include "ThirdPartyHeadersBegin.h"
  3. #include <algorithm>
  4. #include <cfloat>
  5. #define _USE_MATH_DEFINES
  6. #include <cmath>
  7. #if defined MSWIN
  8. #define _CRTDBG_MAP_ALLOC
  9. #include <crtdbg.h>
  10. #pragma warning(disable : 4996)
  11. #endif
  12. #include <cstdarg>
  13. #include <cstdlib>
  14. #include <cstring>
  15. #include <set>
  16. #include <string>
  17. #include <utility>
  18. #include <vector>
  19. #include "ThirdPartyHeadersEnd.h"
  20. #include "MASTER.h"
  21. #include "GLOBAL.h"
  22. #include "ClassMacros.h"
  23. #include "MinMax.h"
  24. #include "basicTypes.h"
  25. #include "IJK.h"
  26. #include "ItemAddress.h"
  27. #include "LightweightVector.h"
  28. #include "AnyTypeLightweightVector.h"
  29. #include "RawArray.h"
  30. #include "showMessage.h"
  31. #include "xyz.h"
  32. namespace tecplot
  33. {
  34. namespace ___3933
  35. {
  36. class CszConnectivity;
  37. #define MAX_ERROR_MESSAGE_SIZE 500
  38. #define countOf(staticArray) (sizeof((staticArray)) / sizeof((staticArray)[0]))
  39. #define numItemsOf(someArray) (sizeof((someArray)) / sizeof(*(someArray)))
  40. static ___2090::ItemOffset_t const DEFAULT_SUBZONE_MAX_I_DIM = 6;
  41. static ___2090::ItemOffset_t const DEFAULT_SUBZONE_MAX_J_DIM = 6;
  42. static ___2090::ItemOffset_t const DEFAULT_SUBZONE_MAX_K_DIM = 6;
  43. #define DEFAULT_SUBZONE_MAX_IJK_DIM ___1844(DEFAULT_SUBZONE_MAX_I_DIM, DEFAULT_SUBZONE_MAX_J_DIM, DEFAULT_SUBZONE_MAX_K_DIM)
  44. static ___2090::ItemOffset_t const DEFAULT_SUBZONE_MAX_FE_SIZE = 256;
  45. static bool const DEFAULT_MINIMIZE_IJK_NUM_SUBZONES = false;
  46. static bool const DEFAULT_MINIMIZE_SYNTHETIC_FE_NUM_SUBZONES = false;
  47. static ___4636 const NOT_SHARED = static_cast<___4636>(-1);
  48. typedef ___2240<___2090> ItemAddressArray;
  49. typedef ___2240<___2090::SubzoneAddress> SubzoneAddressArray;
  50. template <typename T>
  51. inline bool reserveVectorSpace(std::vector<T> &vectorToReserve, size_t newSize)
  52. {
  53. REQUIRE(newSize > 0);
  54. bool ___2039 = false;
  55. try
  56. {
  57. vectorToReserve.reserve(newSize);
  58. ___2039 = true;
  59. }
  60. catch (...)
  61. {
  62. ___2039 = ___1305;
  63. }
  64. ENSURE(IMPLICATION(___2039, vectorToReserve.capacity() >= newSize));
  65. return ___2039;
  66. }
  67. template <typename T>
  68. inline bool resizeVector(std::vector<T> &vectorToResize, size_t newSize)
  69. {
  70. REQUIRE(newSize > 0);
  71. bool ___2039 = false;
  72. try
  73. {
  74. vectorToResize.resize(newSize);
  75. ___2039 = true;
  76. }
  77. catch (...)
  78. {
  79. ___2039 = ___1305;
  80. }
  81. ENSURE(IMPLICATION(___2039, vectorToResize.size() == newSize));
  82. return ___2039;
  83. }
  84. template <typename T>
  85. inline bool resizeVector(std::vector<T> &vectorToSize, size_t newSize, T padValue)
  86. {
  87. REQUIRE(newSize > 0);
  88. bool ___2039 = false;
  89. try
  90. {
  91. vectorToSize.resize(newSize, padValue);
  92. ___2039 = true;
  93. }
  94. catch (...)
  95. {
  96. ___2039 = ___1305;
  97. }
  98. ENSURE(IMPLICATION(___2039, vectorToSize.size() == newSize));
  99. return ___2039;
  100. }
  101. template <typename T>
  102. inline bool resize2DVector(std::vector<std::vector<T>> &vector2D, size_t newDim1, size_t newDim2)
  103. {
  104. REQUIRE(newDim1 > 0);
  105. REQUIRE(newDim2 > 0);
  106. bool ___2039 = false;
  107. try
  108. {
  109. vector2D.resize(newDim1);
  110. for (size_t ___1841 = 0; ___1841 < newDim1; ___1841++)
  111. vector2D[___1841].resize(newDim2);
  112. ___2039 = true;
  113. }
  114. catch (...)
  115. {
  116. ___2039 = ___1305;
  117. }
  118. ENSURE(IMPLICATION(___2039, vector2D.size() == newDim1));
  119. ENSURE(IMPLICATION(___2039, vector2D[0].size() == newDim2));
  120. ENSURE(IMPLICATION(___2039, vector2D[newDim1 / 2].size() == newDim2));
  121. ENSURE(IMPLICATION(___2039, vector2D[newDim1 - 1].size() == newDim2));
  122. return ___2039;
  123. }
  124. template <typename T>
  125. inline bool resize2DVector(std::vector<std::vector<T>> &vector2D, size_t newDim1, size_t newDim2, T padValue)
  126. {
  127. REQUIRE(newDim1 > 0);
  128. REQUIRE(newDim2 > 0);
  129. bool ___2039 = false;
  130. try
  131. {
  132. vector2D.resize(newDim1);
  133. for (size_t ___1841 = 0; ___1841 < newDim1; ___1841++)
  134. vector2D[___1841].resize(newDim2, padValue);
  135. ___2039 = true;
  136. }
  137. catch (...)
  138. {
  139. ___2039 = ___1305;
  140. }
  141. ENSURE(IMPLICATION(___2039, vector2D.size() == newDim1));
  142. ENSURE(IMPLICATION(___2039, vector2D[0].size() == newDim2));
  143. ENSURE(IMPLICATION(___2039, vector2D[newDim1 / 2].size() == newDim2));
  144. ENSURE(IMPLICATION(___2039, vector2D[newDim1 - 1].size() == newDim2));
  145. return ___2039;
  146. }
  147. template <typename T>
  148. inline void clearAndDeallocStdSet(std::set<T> &setToClear) { std::set<T>().swap(setToClear); }
  149. template <class ForwardIterator>
  150. bool isSorted(ForwardIterator first, ForwardIterator last)
  151. {
  152. if (first != last)
  153. {
  154. ForwardIterator next = first;
  155. while (++next != last)
  156. {
  157. if (*next < *first)
  158. return false;
  159. ++first;
  160. }
  161. }
  162. return true;
  163. }
  164. typedef ___2240<char> ___473;
  165. typedef ___2240<uint8_t> UInt8Array;
  166. typedef ___2240<uint16_t> UInt16Array;
  167. typedef ___2240<uint32_t> UInt32Array;
  168. typedef ___2240<uint64_t> UInt64Array;
  169. typedef ___2240<int32_t> ___1965;
  170. typedef ___2240<double> ___1105;
  171. typedef ___2240<float> ___1435;
  172. typedef ___2240<___465> ___464;
  173. typedef ___2240<___2718> ___2717;
  174. typedef ___2240<___4636> ___4635;
  175. typedef ___2240<___2090::SubzoneOffset_t> SubzoneOffsetArray;
  176. typedef ___2240<___2090::ItemOffset_t> ItemOffsetArray;
  177. typedef ___2240<___682> CornerIndexArray;
  178. typedef ___2240<___372> BooleanArray;
  179. typedef ___2240<std::string> ___3816;
  180. typedef ___2240<___2090::___2980> PartitionArray;
  181. typedef std::pair<___2090::___2980, ___2090::SubzoneOffset_t> PartitionSubzone;
  182. typedef ___2240<PartitionSubzone> PartitionSubzoneArray;
  183. typedef std::set<PartitionSubzone> PartitionSubzoneSet;
  184. typedef ___2240<PartitionSubzoneSet> PartitionSubzoneSetArray;
  185. typedef std::set<___2090::SubzoneOffset_t> SubzoneOffsetSet;
  186. typedef ___2240<SubzoneOffsetSet> SubzoneOffsetSetArray;
  187. typedef ___2240<UInt8Array> VarZoneUInt8Array;
  188. typedef ___2240<___1393> ___1392;
  189. typedef ___2240<___1392> FileLoc2DArray;
  190. typedef ___2240<FileLoc2DArray> FileLoc3DArray;
  191. typedef ___2240<FileLoc3DArray> FileLoc4DArray;
  192. #if 0
  193. typedef ___1392 SzFileLocArray; typedef ___2240<SzFileLocArray> PtnSzFileLocArray; typedef ___2240<PtnSzFileLocArray> ZonePtnSzFileLocArray; typedef ___2240<ZonePtnSzFileLocArray> VarZonePtnSzFileLocArray; typedef ___1392 PtnFileLocArray; typedef ___2240<PtnFileLocArray> ZnPtnFileLocArray; typedef ___1392 VarFileLocArray; typedef ___2240<VarFileLocArray> PtnVarFileLocArray; typedef ___2240<PtnVarFileLocArray> ZonePtnVarFileLocArray; typedef ___1392 ZoneFileLocArray; typedef ___2240<ZoneFileLocArray> VarZoneFileLocArray;
  194. #endif
  195. typedef AnyTypeLightweightVector FieldDataArray;
  196. typedef ___2240<FieldDataArray> SzFieldData;
  197. typedef ___2240<SzFieldData> PtnSzFieldData;
  198. typedef ___2240<PtnSzFieldData> ZonePtnSzFieldData;
  199. typedef ___2240<ZonePtnSzFieldData> VarZonePtnSzFieldData;
  200. typedef uint16_t InterpCount_t;
  201. static InterpCount_t const MAX_INTERP_COUNT = InterpCount_t(-1);
  202. typedef ___2240<InterpCount_t> InterpCountArray;
  203. typedef ___2240<InterpCountArray> SzInterpCountArray;
  204. typedef ___2240<SzInterpCountArray> PtnSzInterpCountArray;
  205. typedef ___2240<PtnSzInterpCountArray> ZonePtnSzInterpCountArray;
  206. typedef ___2240<ZonePtnSzInterpCountArray> VarZonePtnSzInterpCountArray;
  207. typedef ___2240<BooleanArray> PtnBooleanArray;
  208. typedef ___2240<PtnBooleanArray> ZonePtnBooleanArray;
  209. typedef ___2240<ZonePtnBooleanArray> VarZonePtnBooleanArray;
  210. typedef ___2240<uint8_t> ValueLocationArray;
  211. typedef ___2240<ValueLocationArray> ___4391;
  212. typedef ___2240<uint8_t> FieldDataTypeArray;
  213. typedef ___2240<FieldDataTypeArray> ___4382;
  214. typedef ___2240<uint8_t> IsPassiveArray;
  215. typedef ___2240<IsPassiveArray> ___4385;
  216. typedef ___2240<___4635> ___4388;
  217. typedef ___2240<___1105> VarZoneDoubleArray;
  218. typedef ___2240<___2090::___2980> PartitionArray;
  219. struct ___230
  220. {
  221. std::string ___2495;
  222. std::string ___2667;
  223. AuxDataLocation_e m_location;
  224. ___1172 m_entity;
  225. AuxDataType_e m_type;
  226. ___230() {}
  227. ___230(std::string const &___2685, std::string const &___4314, AuxDataLocation_e location, ___1172 entity, AuxDataType_e type) : ___2495(___2685), ___2667(___4314), m_location(location), m_entity(entity), m_type(type) {}
  228. };
  229. struct ___1556
  230. {
  231. double ___2617[3];
  232. CoordSys_e ___2616;
  233. ___372 ___2484;
  234. ___1172 ___2677;
  235. ___516 ___2395;
  236. ___516 ___2462;
  237. ___372 ___2486;
  238. GeomType_e ___2466;
  239. LinePattern_e ___2489;
  240. double ___2615;
  241. double ___2490;
  242. uint16_t ___2502;
  243. ArrowheadStyle_e ___2343;
  244. ArrowheadAttachment_e ___2341;
  245. double ___2342;
  246. double ___2340;
  247. Scope_e ___2619;
  248. Clipping_e ___2394;
  249. std::vector<std::vector<class ___4580>> ___2464;
  250. std::string ___2491;
  251. ___1556() {}
  252. ___1556(double ___4574, double ___4591, double ___4715, CoordSys_e ___3159, ___372 ___2004, ___1172 zone, ___516 color, ___516 ___1411, ___372 ___2022, GeomType_e ___1651, LinePattern_e ___2263, double ___2986, double ___2289, uint16_t ___2793, ArrowheadStyle_e arrowheadStyle, ArrowheadAttachment_e arrowheadAttachment, double arrowheadSize, double arrowheadAngle, Scope_e ___3442, Clipping_e ___495, std::vector<std::vector<___4580>> const &___1572, std::string const &___2330) : ___2616(___3159), ___2484(___2004), ___2677(zone), ___2395(color), ___2462(___1411), ___2486(___2022), ___2466(___1651), ___2489(___2263), ___2615(___2986), ___2490(___2289), ___2502(___2793), ___2343(arrowheadStyle), ___2341(arrowheadAttachment), ___2342(arrowheadSize), ___2340(arrowheadAngle), ___2619(___3442), ___2394(___495), ___2464(___1572), ___2491(___2330)
  253. {
  254. ___2617[0] = ___4574;
  255. ___2617[1] = ___4591;
  256. ___2617[2] = ___4715;
  257. }
  258. };
  259. struct Text
  260. {
  261. ___516 ___2628;
  262. ___516 ___2629;
  263. double ___2630;
  264. double ___2631;
  265. TextBox_e ___2632;
  266. TextAnchor_e ___2625;
  267. double ___2626[3];
  268. double ___2627;
  269. Clipping_e ___2633;
  270. ___516 ___2634;
  271. double ___2635;
  272. double ___2637;
  273. std::string ___2638;
  274. CoordSys_e ___2639;
  275. Scope_e ___2641;
  276. Units_e ___2642;
  277. std::string ___2643;
  278. std::string ___2644;
  279. ___372 ___2645;
  280. ___372 ___2646;
  281. ___1172 ___2647;
  282. ___372 ___2636;
  283. Text() {}
  284. Text(double ___4574, double ___4591, double ___4713, ___516 ___4059, ___516 ___4061, double ___4071, double ___4073, TextBox_e ___4078, TextAnchor_e ___4043, double ___4056, Clipping_e ___4079, ___516 ___4080, double ___4103, double ___4107, std::string ___4109, CoordSys_e ___4115, Scope_e ___4119, Units_e ___4124, std::string ___4126, std::string ___4129, ___372 ___4132, ___372 ___4134, ___1172 ___4138, ___372 ___4105) : ___2628(___4059), ___2629(___4061), ___2630(___4071), ___2631(___4073), ___2632(___4078), ___2625(___4043), ___2627(___4056), ___2633(___4079), ___2634(___4080), ___2635(___4103), ___2637(___4107), ___2638(___4109), ___2639(___4115), ___2641(___4119), ___2642(___4124), ___2643(___4126), ___2644(___4129), ___2645(___4132), ___2646(___4134), ___2647(___4138), ___2636(___4105)
  285. {
  286. ___2626[0] = ___4574;
  287. ___2626[1] = ___4591;
  288. ___2626[2] = ___4713;
  289. }
  290. };
  291. struct CustomLabelSet
  292. {
  293. uint32_t m_numLabels;
  294. ___3816 m_labels;
  295. };
  296. typedef ___2240<___230> AuxDataArray;
  297. typedef ___2240<___1556> GeomArray;
  298. typedef ___2240<Text> TextArray;
  299. typedef ___2240<CustomLabelSet> CustomLabelsArray;
  300. typedef ___2240<RefSubzoneOffset_t> RefSubzoneOffsetArray;
  301. class NszConnectivity
  302. {
  303. UNCOPYABLE_CLASS(NszConnectivity);
  304. public:
  305. SubzoneAddressArray m_refCszs;
  306. RefSubzoneOffset_t m_numRefCszs;
  307. NszConnectivity() : m_numRefCszs(0) {}
  308. ~NszConnectivity() { ___937(); }
  309. uint64_t numBytesAllocated(void) const { return m_refCszs.numBytesAllocated(m_numRefCszs); }
  310. void ___937()
  311. {
  312. m_numRefCszs = 0;
  313. m_refCszs.___937();
  314. ENSURE(empty());
  315. }
  316. bool setNumRszs(RefSubzoneOffset_t numRszs)
  317. {
  318. REQUIRE(___2067());
  319. REQUIRE(numRszs != BAD_REFSZ_INDEX);
  320. bool ___2039;
  321. if (numRszs == 0)
  322. {
  323. m_numRefCszs = numRszs;
  324. ___478(m_refCszs.empty());
  325. ___2039 = true;
  326. }
  327. else
  328. {
  329. ___2039 = m_refCszs.alloc(numRszs);
  330. if (___2039)
  331. m_numRefCszs = numRszs;
  332. else
  333. ___937();
  334. }
  335. ENSURE(___2067());
  336. return ___2039;
  337. }
  338. inline bool ___2067() const
  339. {
  340. ___478(EQUIVALENCE(m_refCszs.empty(), m_numRefCszs == 0));
  341. ___478(IMPLICATION(!m_refCszs.empty(), m_refCszs.size() == size_t(m_numRefCszs)));
  342. return true;
  343. }
  344. inline bool empty() const
  345. {
  346. REQUIRE(___2067());
  347. return m_numRefCszs == 0;
  348. }
  349. inline RefSubzoneOffset_t getNumRszs() const
  350. {
  351. REQUIRE(___2067());
  352. return m_numRefCszs;
  353. }
  354. inline ___2090::SubzoneAddress getRszAddress(RefSubzoneOffset_t refSubzoneOffset) const
  355. {
  356. REQUIRE(___2067());
  357. REQUIRE(refSubzoneOffset < getNumRszs());
  358. return m_refCszs[refSubzoneOffset];
  359. }
  360. inline bool getRszAddresses(___3269<___2090::SubzoneAddress> &rszAddresses) const
  361. {
  362. REQUIRE(___2067());
  363. REQUIRE(rszAddresses.empty());
  364. bool ___2039 = true;
  365. try
  366. {
  367. ___478(m_numRefCszs > 0);
  368. rszAddresses.reserve(m_numRefCszs);
  369. rszAddresses.___3503(m_numRefCszs);
  370. memcpy(&rszAddresses[0], &m_refCszs[0], m_numRefCszs * sizeof(___2090::SubzoneAddress));
  371. }
  372. catch (...)
  373. {
  374. ___2039 = ___1186("Out of memory in getRefCszAddresses");
  375. }
  376. return ___2039;
  377. }
  378. };
  379. typedef ___2240<CszConnectivity> CszConnectivityArray;
  380. typedef ___2240<CszConnectivityArray> PtnCszConnectivity;
  381. typedef ___2240<PtnCszConnectivity> ZonePtnCszConnectivity;
  382. typedef ___2240<RefSubzoneOffsetArray> PtnRefSubzoneOffsetArray;
  383. typedef ___2240<PtnRefSubzoneOffsetArray> ZonePtnRefSubzoneOffsetArray;
  384. typedef ___2240<NszConnectivity> NszConnectivityArray;
  385. typedef ___2240<NszConnectivityArray> PtnNszConnectivity;
  386. typedef ___2240<PtnNszConnectivity> ZonePtnNszConnectivity;
  387. typedef ___2240<ItemOffsetArray> ZoneSzSizeArray;
  388. typedef ___2240<___465> CellSubzoneFirstItemArray;
  389. typedef ___2240<CellSubzoneFirstItemArray> ZoneCszFirstItemArray;
  390. typedef ___2240<___2718> NodeSubzoneFirstItemArray;
  391. typedef ___2240<NodeSubzoneFirstItemArray> ZoneNszFirstItemArray;
  392. typedef ___2240<___81> AnySzFirstItemArray;
  393. typedef ___2240<AnySzFirstItemArray> ZoneAnySzFirstItemArray;
  394. typedef ___2240<___2479> ___2481;
  395. typedef ___2240<___2481> VarZoneMinMaxArray;
  396. }
  397. }