2012-05-18 02:45:23 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2014-09-23 08:04:57 -05:00
|
|
|
// Copyright (C) 2011- Statoil ASA
|
|
|
|
// Copyright (C) 2013- Ceetron Solutions AS
|
|
|
|
// Copyright (C) 2011-2012 Ceetron AS
|
2012-05-18 02:45:23 -05:00
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
2016-07-16 09:31:55 -05:00
|
|
|
|
|
|
|
#include "RivCellSetEnum.h"
|
|
|
|
#include "RivReservoirPartMgr.h" // Must include here because of caf::FixedArray<RivReservoirPartMgr, PROPERTY_FILTERED>
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
#include "cvfArray.h"
|
2016-07-16 09:31:55 -05:00
|
|
|
#include "cvfBase.h"
|
|
|
|
#include "cvfTransform.h"
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
#include "cafPdmObject.h"
|
|
|
|
|
2018-08-07 03:37:52 -05:00
|
|
|
#include <array>
|
|
|
|
|
2015-05-21 03:05:33 -05:00
|
|
|
class RimEclipseView;
|
2012-05-18 02:45:23 -05:00
|
|
|
class RigGridBase;
|
|
|
|
class RimCellRangeFilterCollection;
|
2015-06-25 04:48:24 -05:00
|
|
|
class RimEclipsePropertyFilterCollection;
|
2013-02-12 07:46:45 -06:00
|
|
|
class RigActiveCellInfo;
|
2016-07-16 09:31:55 -05:00
|
|
|
class RimEclipseCellColors;
|
|
|
|
class RimCellEdgeColors;
|
|
|
|
|
|
|
|
namespace cvf
|
|
|
|
{
|
|
|
|
class ModelBasicList;
|
|
|
|
}
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
class RivReservoirViewPartMgr: public cvf::Object
|
|
|
|
{
|
|
|
|
public:
|
2017-03-06 04:18:34 -06:00
|
|
|
explicit RivReservoirViewPartMgr(RimEclipseView * resv);
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-04-22 02:13:37 -05:00
|
|
|
cvf::Transform* scaleTransform() { return m_scaleTransform.p();}
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-04-22 02:13:37 -05:00
|
|
|
void clearGeometryCache();
|
2015-06-18 05:39:10 -05:00
|
|
|
void scheduleGeometryRegen(RivCellSetEnum geometryType);
|
2017-08-24 02:27:08 -05:00
|
|
|
const cvf::UByteArray* cellVisibility(RivCellSetEnum geometryType, size_t gridIndex, size_t frameIndex);
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2018-04-04 15:34:41 -05:00
|
|
|
void appendStaticGeometryPartsToModel (cvf::ModelBasicList* model,
|
|
|
|
RivCellSetEnum geometryType,
|
|
|
|
const std::vector<size_t>& gridIndices);
|
|
|
|
void ensureStaticGeometryPartsCreated ( RivCellSetEnum geometryType );
|
|
|
|
|
|
|
|
void appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model,
|
|
|
|
RivCellSetEnum geometryType,
|
|
|
|
size_t frameIndex,
|
|
|
|
const std::vector<size_t>& gridIndices);
|
|
|
|
void ensureDynamicGeometryPartsCreated(RivCellSetEnum geometryType,
|
|
|
|
size_t frameIndex);
|
|
|
|
|
|
|
|
void updateCellColor (RivCellSetEnum geometryType,
|
|
|
|
size_t timeStepIndex,
|
2013-04-22 02:13:37 -05:00
|
|
|
cvf::Color4f color);
|
2018-04-04 15:34:41 -05:00
|
|
|
void updateCellResultColor (RivCellSetEnum geometryType,
|
|
|
|
size_t timeStepIndex,
|
2015-06-25 07:34:20 -05:00
|
|
|
RimEclipseCellColors* cellResultColors);
|
2018-04-04 15:34:41 -05:00
|
|
|
void updateCellEdgeResultColor(RivCellSetEnum geometryType,
|
|
|
|
size_t timeStepIndex,
|
2015-10-23 08:46:25 -05:00
|
|
|
RimEclipseCellColors* cellResultColors,
|
|
|
|
RimCellEdgeColors* cellEdgeResultColors);
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-12-09 07:17:36 -06:00
|
|
|
// Faults
|
2018-04-04 15:34:41 -05:00
|
|
|
void appendFaultsStaticGeometryPartsToModel(cvf::ModelBasicList* model,
|
|
|
|
RivCellSetEnum geometryType);
|
|
|
|
void appendFaultsDynamicGeometryPartsToModel(cvf::ModelBasicList* model,
|
|
|
|
RivCellSetEnum geometryType,
|
|
|
|
size_t frameIndex);
|
|
|
|
void updateFaultColors(RivCellSetEnum geometryType,
|
|
|
|
size_t timeStepIndex,
|
|
|
|
RimEclipseCellColors* cellResultColors);
|
|
|
|
void updateFaultCellEdgeResultColor(RivCellSetEnum geometryType,
|
|
|
|
size_t timeStepIndex,
|
|
|
|
RimEclipseCellColors* cellResultColors,
|
|
|
|
RimCellEdgeColors* cellEdgeResultColors);
|
2013-12-09 07:17:36 -06:00
|
|
|
|
2013-12-18 05:18:15 -06:00
|
|
|
// Fault labels
|
2018-04-04 15:34:41 -05:00
|
|
|
RivCellSetEnum geometryTypeForFaultLabels(const std::set<RivCellSetEnum>& geometryTypes,
|
|
|
|
bool showFaultsOutsideFilters) const;
|
|
|
|
void appendFaultLabelsStaticGeometryPartsToModel(cvf::ModelBasicList* model,
|
|
|
|
RivCellSetEnum geometryType);
|
|
|
|
void appendFaultLabelsDynamicGeometryPartsToModel(cvf::ModelBasicList* model,
|
|
|
|
RivCellSetEnum geometryType, size_t frameIndex);
|
2013-12-18 05:18:15 -06:00
|
|
|
|
2016-11-18 07:05:50 -06:00
|
|
|
void forceWatertightGeometryOnForType(RivCellSetEnum geometryType);
|
2016-11-18 08:57:57 -06:00
|
|
|
void clearWatertightGeometryFlags();
|
2014-01-07 07:27:43 -06:00
|
|
|
|
2018-10-29 06:52:57 -05:00
|
|
|
static void computePropertyVisibility(cvf::UByteArray* cellVisibilities,
|
|
|
|
const RigGridBase* grid,
|
|
|
|
size_t timeStepIndex,
|
|
|
|
const cvf::UByteArray* rangeFilterVisibility,
|
|
|
|
RimEclipsePropertyFilterCollection* propFilterColl);
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
private:
|
2015-06-18 05:39:10 -05:00
|
|
|
void createGeometry(RivCellSetEnum geometryType);
|
2018-04-04 15:34:41 -05:00
|
|
|
void computeVisibility(cvf::UByteArray* cellVisibility,
|
|
|
|
RivCellSetEnum geometryType,
|
|
|
|
RigGridBase* grid,
|
|
|
|
size_t gridIdx);
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-09-06 08:05:41 -05:00
|
|
|
void createPropertyFilteredNoneWellCellGeometry(size_t frameIndex);
|
2013-04-22 02:13:37 -05:00
|
|
|
void createPropertyFilteredWellGeometry(size_t frameIndex);
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2015-06-18 05:39:10 -05:00
|
|
|
void clearGeometryCache(RivCellSetEnum geomType);
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
|
2018-04-04 15:34:41 -05:00
|
|
|
static void computeNativeVisibility (cvf::UByteArray* cellVisibilities,
|
|
|
|
const RigGridBase* grid,
|
|
|
|
const RigActiveCellInfo* activeCellInfo,
|
|
|
|
const cvf::UByteArray* cellIsInWellStatuses,
|
|
|
|
bool invalidCellsIsVisible,
|
|
|
|
bool inactiveCellsIsVisible,
|
2018-10-26 09:23:18 -05:00
|
|
|
bool activeCellsIsVisible);
|
|
|
|
|
2018-04-04 15:34:41 -05:00
|
|
|
void computeRangeVisibility (RivCellSetEnum geometryType,
|
|
|
|
cvf::UByteArray* cellVisibilities,
|
|
|
|
const RigGridBase* grid,
|
|
|
|
const cvf::UByteArray* nativeVisibility,
|
|
|
|
const RimCellRangeFilterCollection* rangeFilterColl);
|
|
|
|
void computeOverriddenCellVisibility(cvf::UByteArray* cellVisibility,
|
|
|
|
const RigGridBase* grid);
|
2015-09-14 09:14:44 -05:00
|
|
|
|
|
|
|
|
|
|
|
static void copyByteArray(cvf::UByteArray* dest, const cvf::UByteArray* source );
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2015-06-18 05:39:10 -05:00
|
|
|
RivReservoirPartMgr * reservoirPartManager(RivCellSetEnum geometryType, size_t timeStepIndex );
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2014-01-06 05:06:36 -06:00
|
|
|
|
2013-04-22 02:13:37 -05:00
|
|
|
private:
|
2018-08-07 03:37:52 -05:00
|
|
|
std::array<RivReservoirPartMgr, PROPERTY_FILTERED> m_geometries;
|
|
|
|
std::array<bool, PROPERTY_FILTERED> m_geometriesNeedsRegen;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
cvf::Collection<RivReservoirPartMgr> m_propFilteredGeometryFrames;
|
2013-04-22 02:13:37 -05:00
|
|
|
std::vector<uchar> m_propFilteredGeometryFramesNeedsRegen;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
cvf::Collection<RivReservoirPartMgr> m_propFilteredWellGeometryFrames;
|
2013-04-22 02:13:37 -05:00
|
|
|
std::vector<uchar> m_propFilteredWellGeometryFramesNeedsRegen;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-04-22 02:13:37 -05:00
|
|
|
cvf::ref<cvf::Transform> m_scaleTransform;
|
2015-09-14 09:14:44 -05:00
|
|
|
caf::PdmPointer<RimEclipseView> m_reservoirView;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
};
|