ResInsight/ApplicationCode/GeoMech/GeoMechVisualization/RivGeoMechPartMgrCache.h
Pål Hagen fa75a46ecb Moved geo mech related source files to different folder
Moved RivGeoMechVizLogic.h/cpp RivGeoMechPartMgrCache.h/cpp to
GeoMech/GeoMechVisualization.
2015-06-26 10:00:45 +02:00

53 lines
1.3 KiB
C++

#pragma once
#include <cstddef>
#include "cvfObject.h"
#include <map>
#include "RivCellSetEnum.h"
class RivGeoMechPartMgr;
class RivGeoMechPartMgrGeneratorInterface;
class RivGeoMechPartMgrCache : public cvf::Object
{
public:
RivGeoMechPartMgrCache();
~RivGeoMechPartMgrCache();
class Key
{
public:
Key() : m_geometryType(-1), m_frameIndex(-1) {}
Key(RivCellSetEnum aGeometryType, int aFrameIndex);
void set(RivCellSetEnum aGeometryType, int aFrameIndex);
int frameIndex() const { return m_frameIndex;}
unsigned short geometryType() const { return m_geometryType; }
bool operator< (const Key& other) const;
private:
int m_frameIndex;
unsigned short m_geometryType;
};
bool isNeedingRegeneration(const Key& key) const;
void scheduleRegeneration (const Key& key);
void setGenerationFinished(const Key& key);
RivGeoMechPartMgr* partMgr (const Key& key);
private:
class CacheEntry
{
public:
CacheEntry() : needsRegen(true) {}
bool needsRegen;
cvf::ref<RivGeoMechPartMgr> partMgr;
};
std::map<Key, CacheEntry > m_partMgrs;
};