FECellSubzoneCompressor.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. #pragma once
  2. #include "ThirdPartyHeadersBegin.h"
  3. #include <exception>
  4. #include <string>
  5. #include <boost/unordered_set.hpp>
  6. #include "ThirdPartyHeadersEnd.h"
  7. #include "ThirdPartyHeadersBegin.h"
  8. #include <boost/array.hpp>
  9. #include "ThirdPartyHeadersEnd.h"
  10. #include "SzlFileLoader.h"
  11. #include "NodeMap.h"
  12. #include "FEZoneInfo.h"
  13. #include "ClassMacros.h"
  14. namespace tecplot
  15. {
  16. namespace ___3933
  17. {
  18. static uint16_t const MAX_ENTRIES_FOR_2_BIT_COMPRESSION = 4;
  19. static uint16_t const MAX_ENTRIES_FOR_4_BIT_COMPRESSION = 16;
  20. static uint16_t const MAX_ENTRIES_FOR_8_BIT_COMPRESSION = 256;
  21. template <typename T>
  22. inline T const numBytesFor2BitCompression(T ___2795) { return (___2795 + 3) >> 2; }
  23. template <typename T>
  24. inline T const numBytesFor4BitCompression(T ___2795) { return (___2795 + 1) >> 1; }
  25. inline uint8_t getValueFrom2BitCompressedArray(uint16_t indx, uint8_t const *uInt8Array)
  26. {
  27. uint16_t const byte = indx >> 2;
  28. uint8_t const bits = uInt8Array[byte];
  29. if (indx & 0x02)
  30. {
  31. if (indx & 0x01)
  32. return (bits & 0x03);
  33. else
  34. return (bits >> 2) & 0x03;
  35. }
  36. else
  37. {
  38. if (indx & 0x01)
  39. return (bits >> 4) & 0x03;
  40. else
  41. return (bits >> 6);
  42. }
  43. }
  44. inline uint8_t getValueFrom4BitCompressedArray(uint16_t indx, uint8_t const *uInt8Array)
  45. {
  46. uint16_t const byte = indx >> 1;
  47. uint8_t const bits = uInt8Array[byte];
  48. if (indx & 0x01)
  49. return (bits & 0x0F);
  50. else
  51. return (bits >> 4);
  52. }
  53. class ___1339
  54. {
  55. UNCOPYABLE_CLASS(___1339);
  56. public:
  57. static uint16_t const MAX_CORNERS_PER_CELL = 8;
  58. static uint16_t const MAX_NUM_ENTRIES_IN_SUBZONE = (___2090::MAX_ITEM_OFFSET + 1) * MAX_CORNERS_PER_CELL;
  59. static uint16_t const MAX_REFERENCED_NODE_SUBZONES = MAX_NUM_ENTRIES_IN_SUBZONE;
  60. class Error : public std::exception
  61. {
  62. public:
  63. explicit Error(std::string const &what) : m_what(what) {}
  64. ~Error() throw(){};
  65. char const *what() const throw() { return m_what.c_str(); }
  66. private:
  67. std::string m_what;
  68. };
  69. ___1339();
  70. ~___1339();
  71. void ___536(___2729 ___2723, ___1350 const &___1349, ___2090::SubzoneOffset_t ___469);
  72. ___2090::ItemOffset_t ___2782() const;
  73. uint16_t numRefNszs() const;
  74. uint16_t numRefPartitions() const;
  75. PartitionSubzone const *refPtnNszs() const;
  76. uint8_t const *refPtn2BitOffsets() const;
  77. uint8_t const *refPtn4BitOffsets() const;
  78. uint8_t const *refPtn8BitOffsets() const;
  79. uint16_t const *refPtn16BitOffsets() const;
  80. uint32_t const *___3319() const;
  81. uint8_t const *refNsz2BitOffsets() const;
  82. uint8_t const *___3321() const;
  83. uint8_t const *___3322() const;
  84. uint16_t const *___3320() const;
  85. uint8_t const *___2764() const;
  86. private:
  87. ___2090::ItemOffset_t m_numCellsInSubzone;
  88. boost::array<uint32_t, MAX_NUM_ENTRIES_IN_SUBZONE> m_refPtnArray;
  89. boost::array<uint8_t, (MAX_NUM_ENTRIES_IN_SUBZONE + 1) / 4> m_refPtn2BitOffsets;
  90. boost::array<uint8_t, (MAX_NUM_ENTRIES_IN_SUBZONE + 1) / 2> m_refPtn4BitOffsets;
  91. boost::array<uint8_t, MAX_NUM_ENTRIES_IN_SUBZONE> m_refPtn8BitOffsets;
  92. boost::array<uint16_t, MAX_NUM_ENTRIES_IN_SUBZONE> m_refPtn16BitOffsets;
  93. uint16_t m_numRefNszs;
  94. boost::array<___2090, MAX_NUM_ENTRIES_IN_SUBZONE> m_szCoordinateArray;
  95. boost::array<___2090::SubzoneOffset_t, MAX_REFERENCED_NODE_SUBZONES> m_refNszArray;
  96. boost::array<uint8_t, (MAX_NUM_ENTRIES_IN_SUBZONE + 1) / 4> m_refNsz2BitOffsets;
  97. boost::array<uint8_t, (MAX_NUM_ENTRIES_IN_SUBZONE + 1) / 2> m_refNsz4BitOffsets;
  98. boost::array<uint8_t, MAX_NUM_ENTRIES_IN_SUBZONE> m_refNsz8BitOffsets;
  99. boost::array<uint16_t, MAX_NUM_ENTRIES_IN_SUBZONE> m_refNsz16BitOffsets;
  100. boost::array<uint8_t, MAX_NUM_ENTRIES_IN_SUBZONE> m_nszOffsets;
  101. uint16_t m_numRefPartitions;
  102. boost::array<PartitionSubzone, MAX_NUM_ENTRIES_IN_SUBZONE> m_ptnNszReferences;
  103. PartitionSubzoneSet m_refPtnNszSet;
  104. boost::array<PartitionSubzone, MAX_NUM_ENTRIES_IN_SUBZONE> m_refPtnNszArray;
  105. };
  106. }
  107. }