Active CellInfo: Added concept of Cell Result Count

p4#: 21721
This commit is contained in:
Jacob Støren 2013-05-26 11:59:59 +02:00
parent 33bfb287d6
commit f509e1803f
2 changed files with 21 additions and 6 deletions

View File

@ -24,6 +24,7 @@
//--------------------------------------------------------------------------------------------------
RigActiveCellInfo::RigActiveCellInfo()
: m_globalActiveCellCount(0),
m_globalCellResultCount(0),
m_activeCellPositionMin(cvf::Vec3d::ZERO),
m_activeCellPositionMax(cvf::Vec3d::ZERO)
{
@ -46,6 +47,14 @@ size_t RigActiveCellInfo::globalCellCount() const
return m_cellIndexToResultIndex.size();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RigActiveCellInfo::globalCellResultCount() const
{
return m_globalCellResultCount;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -79,11 +88,16 @@ size_t RigActiveCellInfo::cellResultIndex(size_t globalCellIndex) const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigActiveCellInfo::setCellResultIndex(size_t globalCellIndex, size_t globalActiveCellIndex)
void RigActiveCellInfo::setCellResultIndex(size_t globalCellIndex, size_t globalCellResultIndex)
{
CVF_TIGHT_ASSERT(globalActiveCellIndex < m_cellIndexToResultIndex.size());
CVF_TIGHT_ASSERT(globalCellResultIndex < m_cellIndexToResultIndex.size());
m_cellIndexToResultIndex[globalCellIndex] = globalActiveCellIndex;
m_cellIndexToResultIndex[globalCellIndex] = globalCellResultIndex;
if (globalCellResultIndex >= m_globalCellResultCount)
{
m_globalCellResultCount = globalCellResultIndex + 1;
}
}
//--------------------------------------------------------------------------------------------------

View File

@ -34,18 +34,18 @@ public:
void setGlobalCellCount(size_t globalCellCount);
size_t globalCellCount() const;
size_t globalActiveCellCount() const;
size_t globalCellResultCount() const;
bool isActive(size_t globalCellIndex) const;
size_t cellResultIndex(size_t globalCellIndex) const;
void setCellResultIndex(size_t globalCellIndex, size_t globalActiveCellIndex);
void setCellResultIndex(size_t globalCellIndex, size_t globalResultCellIndex);
void setGridCount(size_t gridCount);
void setGridActiveCellCounts(size_t gridIndex, size_t activeCellCount);
void gridActiveCellCounts(size_t gridIndex, size_t& activeCellCount);
void computeDerivedData();
size_t globalActiveCellCount() const;
void setIJKBoundingBox(const cvf::Vec3st& min, const cvf::Vec3st& max);
void IJKBoundingBox(cvf::Vec3st& min, cvf::Vec3st& max) const;
@ -72,6 +72,7 @@ private:
std::vector<size_t> m_cellIndexToResultIndex;
size_t m_globalActiveCellCount;
size_t m_globalCellResultCount;
cvf::Vec3st m_activeCellPositionMin;
cvf::Vec3st m_activeCellPositionMax;