#include "FECellSubzoneCompressor.h"
#include "ThirdPartyHeadersBegin.h"
#include <boost/foreach.hpp>
#include "ThirdPartyHeadersEnd.h"
#include "gatherOffsets.h"
namespace tecplot { namespace ___3933 { ___1339::___1339() {} ___1339::~___1339() {} void ___1339::___536( ___2729 ___2723, ___1350 const& ___1349, ___2090::SubzoneOffset_t ___469) { m_numCellsInSubzone = ___1349.___2782(___469); ___682 const ___2789 = ___1349.___1767(); m_numRefPartitions = static_cast<uint16_t>(___1349.getNumReferencedPartitions()); PartitionArray const& referencedPartitions = ___1349.getReferencedPartitions(); m_numRefNszs = 0; m_refPtnNszSet.clear(); uint32_t count = 0; ___2090::___2980 const* first = (m_numRefPartitions > 0 ? &referencedPartitions[0] : NULL); ASSERT_ONLY(___2090::___2980 const* last = (m_numRefPartitions > 0 ? &referencedPartitions[m_numRefPartitions - 1] + 1 : NULL)); for (___2090::ItemOffset_t cszOffset = 0; cszOffset < m_numCellsInSubzone; cszOffset++) { ___2090 const ___688(___2090::UNKNOWN_PARTITION, ___469, cszOffset); ___465 const ___449 = ___1349.___4608(___688); for (___682 ___681 = 0; ___681 < ___2789; ___681++) { ___2718 const datasetNode = ___2723->___1763(___449 + 1, ___681 + 1) - 1; ___2090 const szCoordOfNode = ___1349.___3924(datasetNode); m_szCoordinateArray[count] = szCoordOfNode; ___2090::___2980 ___2977 = ___2090::INVALID_PARTITION; if (first) { ___2977 = szCoordOfNode.___2977(); ASSERT_ONLY(___2090::___2980 const* current = std::lower_bound(first, last, ___2977)); ___478(*current == ___2977); } ___2090::SubzoneOffset_t const ___2757 = szCoordOfNode.subzoneOffset(); PartitionSubzone ptnNsz(___2977, ___2757); m_ptnNszReferences[cszOffset * ___2789 + ___681] = ptnNsz; m_refPtnNszSet.insert(ptnNsz); count++; } } m_numRefNszs = uint16_t(m_refPtnNszSet.size()); ___2090::SubzoneOffset_t refPtnNszIndex = 0; for (PartitionSubzoneSet::const_iterator iter = m_refPtnNszSet.begin(); iter != m_refPtnNszSet.end(); ++iter) { m_refPtnNszArray[refPtnNszIndex] = *iter; m_refPtnArray[refPtnNszIndex] = iter->first; m_refNszArray[refPtnNszIndex] = iter->second; ++refPtnNszIndex; } ___478(refPtnNszIndex == m_numRefNszs); std::sort(&m_refPtnNszArray[0], &m_refPtnNszArray[m_numRefNszs]); if (m_numRefPartitions > 0) { if (m_numRefPartitions <= MAX_REFS_FOR_2_BIT_COMPRESSION) gather2BitOffsets(&m_refPtn2BitOffsets[0], &m_refPtnArray[0], (uint16_t)(m_numRefNszs), &referencedPartitions[0], m_numRefPartitions); else if (m_numRefPartitions <= MAX_REFS_FOR_4_BIT_COMPRESSION) gather4BitOffsets(&m_refPtn4BitOffsets[0], &m_refPtnArray[0], (uint16_t)(m_numRefNszs), &referencedPartitions[0], m_numRefPartitions); else if ( m_numRefPartitions <= MAX_REFS_FOR_8_BIT_COMPRESSION ) gatherOffsets(&m_refPtn8BitOffsets[0], &m_refPtnArray[0], (uint16_t)(m_numRefNszs), &referencedPartitions[0], m_numRefPartitions); else gatherOffsets(&m_refPtn16BitOffsets[0], &m_refPtnArray[0], (uint16_t)(m_numRefNszs), &referencedPartitions[0], m_numRefPartitions); } size_t ___2795 = m_numCellsInSubzone * ___2789; if (m_numRefNszs <= MAX_REFS_FOR_2_BIT_COMPRESSION) gather2BitOffsets(&m_refNsz2BitOffsets[0], &m_ptnNszReferences[0], (uint16_t)(___2795), &m_refPtnNszArray[0], m_numRefNszs); else if (m_numRefNszs <= MAX_REFS_FOR_4_BIT_COMPRESSION) gather4BitOffsets(&m_refNsz4BitOffsets[0], &m_ptnNszReferences[0], (uint16_t)(___2795), &m_refPtnNszArray[0], m_numRefNszs); else if ( m_numRefNszs <= MAX_REFS_FOR_8_BIT_COMPRESSION ) gatherOffsets(&m_refNsz8BitOffsets[0], &m_ptnNszReferences[0], (uint16_t)(___2795), &m_refPtnNszArray[0], m_numRefNszs); else gatherOffsets(&m_refNsz16BitOffsets[0], &m_ptnNszReferences[0], (uint16_t)(___2795), &m_refPtnNszArray[0], m_numRefNszs); for (size_t ___1841 = 0; ___1841 < ___2795; ++___1841) { ___2090::ItemOffset_t const ___2865 = m_szCoordinateArray[___1841].itemOffset(); ___478(___2865 <= uint8_t(-1)); m_nszOffsets[___1841] = uint8_t(___2865); } } ___2090::ItemOffset_t ___1339::___2782() const { return m_numCellsInSubzone; } uint16_t ___1339::numRefNszs() const { return m_numRefNszs; } uint16_t ___1339::numRefPartitions() const { return m_numRefPartitions; } PartitionSubzone const* ___1339::refPtnNszs() const { return &m_refPtnNszArray[0]; } uint32_t const* ___1339::___3319() const { return &m_refNszArray[0]; } uint8_t const* ___1339::refPtn2BitOffsets() const { if (m_numRefPartitions > MAX_REFS_FOR_2_BIT_COMPRESSION) throw ("2-bit array requested for node map compression requiring > 2 bits."); return &m_refPtn2BitOffsets[0]; } uint8_t const* ___1339::refPtn4BitOffsets() const { if (m_numRefPartitions <= MAX_REFS_FOR_2_BIT_COMPRESSION) throw ("4-bit array requested for node map compression requiring only 2 bits."); else if (m_numRefPartitions > MAX_REFS_FOR_4_BIT_COMPRESSION) throw ("4-bit array requested for node map compression requiring > 4 bits.");
return &m_refPtn4BitOffsets[0]; } uint8_t const* ___1339::refPtn8BitOffsets() const { if (m_numRefPartitions <= MAX_REFS_FOR_4_BIT_COMPRESSION) throw ("8-bit array requested for node map compression requiring only 4 bits."); else if (m_numRefPartitions > MAX_REFS_FOR_8_BIT_COMPRESSION) throw ("8-bit array requested for node map compression requiring > 8 bits."); return &m_refPtn8BitOffsets[0]; } uint16_t const* ___1339::refPtn16BitOffsets() const { if ( m_numRefPartitions <= MAX_REFS_FOR_8_BIT_COMPRESSION ) throw ("16-bit array requested for node map compression requiring < 16 bits."); return &m_refPtn16BitOffsets[0]; } uint8_t const* ___1339::refNsz2BitOffsets() const { if (m_numRefNszs > MAX_REFS_FOR_2_BIT_COMPRESSION) throw ("2-bit array requested for node map compression requiring > 2 bits."); return &m_refNsz2BitOffsets[0]; } uint8_t const* ___1339::___3321() const { if (m_numRefNszs <= MAX_REFS_FOR_2_BIT_COMPRESSION) throw ("4-bit array requested for node map compression requiring only 2 bits."); else if (m_numRefNszs > MAX_REFS_FOR_4_BIT_COMPRESSION) throw ("4-bit array requested for node map compression requiring > 4 bits."); return &m_refNsz4BitOffsets[0]; } uint8_t const* ___1339::___3322() const { if (m_numRefNszs <= MAX_REFS_FOR_4_BIT_COMPRESSION) throw ("8-bit array requested for node map compression requiring only 4 bits."); else if (m_numRefNszs > MAX_REFS_FOR_8_BIT_COMPRESSION) throw ("8-bit array requested for node map compression requiring > 8 bits."); return &m_refNsz8BitOffsets[0]; } uint16_t const* ___1339::___3320() const { if ( m_numRefNszs <= MAX_REFS_FOR_8_BIT_COMPRESSION ) throw ("16-bit array requested for node map compression requiring < 16 bits."); return &m_refNsz16BitOffsets[0]; } uint8_t const* ___1339::___2764() const { return &m_nszOffsets[0]; } }}
