ResInsight/ApplicationCode/ModelVisualization/RivGeoMechPartMgrCache.cpp
Jacob Støren b280196b7c Prep for Geomech range: Introduced VizLogic
Refactored to use the new RivVizLogic class, together with the
partMgrCache
Works.
2015-05-22 17:01:59 +02:00

60 lines
1.9 KiB
C++

#include "RivGeoMechPartMgrCache.h"
#include "RivGeoMechPartMgr.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RivGeoMechPartMgrCache::RivGeoMechPartMgrCache()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RivGeoMechPartMgrCache::~RivGeoMechPartMgrCache()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RivGeoMechPartMgrCache::needsRegeneration(const Key& key)
{
return m_partMgrs[key].needsRegen;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivGeoMechPartMgrCache::scheduleRegeneration(const Key& key)
{
m_partMgrs[key].needsRegen = true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivGeoMechPartMgrCache::generationFinished(const Key& key)
{
m_partMgrs[key].needsRegen = false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RivGeoMechPartMgr* RivGeoMechPartMgrCache::partMgr(const Key& key)
{
CacheEntry& ce = m_partMgrs[key];
if (ce.partMgr.isNull())
{
ce.partMgr = new RivGeoMechPartMgr;
}
return ce.partMgr.p();
}