2017-06-14 00:53:28 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2015- Statoil ASA
|
|
|
|
// Copyright (C) 2015- Ceetron Solutions AS
|
|
|
|
//
|
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2015-05-22 10:01:59 -05:00
|
|
|
#pragma once
|
2017-06-14 00:53:28 -05:00
|
|
|
|
|
|
|
#include "RivCellSetEnum.h"
|
|
|
|
|
2017-06-14 01:27:25 -05:00
|
|
|
#include "cvfBase.h"
|
2015-05-22 10:01:59 -05:00
|
|
|
#include "cvfObject.h"
|
2017-06-14 00:53:28 -05:00
|
|
|
|
|
|
|
#include <cstddef>
|
2015-05-22 10:01:59 -05:00
|
|
|
#include <map>
|
|
|
|
|
|
|
|
class RivGeoMechPartMgr;
|
2015-06-22 01:16:46 -05:00
|
|
|
class RivGeoMechPartMgrGeneratorInterface;
|
2015-05-22 10:01:59 -05:00
|
|
|
|
|
|
|
class RivGeoMechPartMgrCache : public cvf::Object
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
RivGeoMechPartMgrCache();
|
|
|
|
~RivGeoMechPartMgrCache();
|
|
|
|
|
|
|
|
class Key
|
|
|
|
{
|
|
|
|
public:
|
2015-06-18 02:13:45 -05:00
|
|
|
Key() : m_geometryType(-1), m_frameIndex(-1) {}
|
|
|
|
|
2015-06-18 12:22:24 -05:00
|
|
|
Key(RivCellSetEnum aGeometryType, int aFrameIndex);
|
2015-06-18 02:13:45 -05:00
|
|
|
|
2015-06-18 12:22:24 -05:00
|
|
|
void set(RivCellSetEnum aGeometryType, int aFrameIndex);
|
2015-06-18 02:13:45 -05:00
|
|
|
|
|
|
|
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;
|
2015-05-22 10:01:59 -05:00
|
|
|
};
|
|
|
|
|
2015-06-22 01:16:46 -05:00
|
|
|
bool isNeedingRegeneration(const Key& key) const;
|
2015-06-18 02:13:45 -05:00
|
|
|
void scheduleRegeneration (const Key& key);
|
2015-06-22 01:16:46 -05:00
|
|
|
void setGenerationFinished(const Key& key);
|
2015-06-18 02:13:45 -05:00
|
|
|
RivGeoMechPartMgr* partMgr (const Key& key);
|
2015-05-22 10:01:59 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
class CacheEntry
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CacheEntry() : needsRegen(true) {}
|
|
|
|
|
|
|
|
bool needsRegen;
|
|
|
|
cvf::ref<RivGeoMechPartMgr> partMgr;
|
|
|
|
};
|
|
|
|
|
|
|
|
std::map<Key, CacheEntry > m_partMgrs;
|
|
|
|
};
|
|
|
|
|