2012-05-18 09:45:23 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
2014-09-23 15:04:57 +02:00
|
|
|
// Copyright (C) 2011- Statoil ASA
|
|
|
|
|
// Copyright (C) 2013- Ceetron Solutions AS
|
|
|
|
|
// Copyright (C) 2011-2012 Ceetron AS
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2012-05-18 09:45:23 +02: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.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2012-05-18 09:45:23 +02:00
|
|
|
// 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.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2012-05-18 09:45:23 +02:00
|
|
|
// for more details.
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
#pragma once
|
2016-07-16 16:31:55 +02:00
|
|
|
|
|
|
|
|
#include "RivCellSetEnum.h"
|
2020-08-21 11:48:24 +02:00
|
|
|
#include "RivReservoirPartMgr.h"
|
2016-07-16 16:31:55 +02:00
|
|
|
|
2012-05-18 09:45:23 +02:00
|
|
|
#include "cvfArray.h"
|
2019-09-05 09:43:17 +02:00
|
|
|
|
2016-07-16 16:31:55 +02:00
|
|
|
#include "cvfTransform.h"
|
|
|
|
|
|
2012-05-18 09:45:23 +02:00
|
|
|
#include "cafPdmObject.h"
|
|
|
|
|
|
2018-08-07 10:37:52 +02:00
|
|
|
#include <array>
|
|
|
|
|
|
2015-05-21 10:05:33 +02:00
|
|
|
class RimEclipseView;
|
2012-05-18 09:45:23 +02:00
|
|
|
class RigGridBase;
|
2021-01-11 18:47:09 +01:00
|
|
|
class RimCellFilterCollection;
|
2015-06-25 11:48:24 +02:00
|
|
|
class RimEclipsePropertyFilterCollection;
|
2013-02-12 14:46:45 +01:00
|
|
|
class RigActiveCellInfo;
|
2016-07-16 16:31:55 +02:00
|
|
|
class RimEclipseCellColors;
|
|
|
|
|
class RimCellEdgeColors;
|
|
|
|
|
|
|
|
|
|
namespace cvf
|
|
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
class ModelBasicList;
|
2016-07-16 16:31:55 +02:00
|
|
|
}
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
class RivReservoirViewPartMgr : public cvf::Object
|
2012-05-18 09:45:23 +02:00
|
|
|
{
|
|
|
|
|
public:
|
2019-09-06 10:40:57 +02:00
|
|
|
explicit RivReservoirViewPartMgr( RimEclipseView* resv );
|
|
|
|
|
|
2020-02-12 11:13:38 +01:00
|
|
|
cvf::Transform* scaleTransform() { return m_scaleTransform.p(); }
|
2019-09-06 10:40:57 +02:00
|
|
|
|
|
|
|
|
void clearGeometryCache();
|
|
|
|
|
void scheduleGeometryRegen( RivCellSetEnum geometryType );
|
|
|
|
|
const cvf::UByteArray* cellVisibility( RivCellSetEnum geometryType, size_t gridIndex, size_t frameIndex );
|
|
|
|
|
|
|
|
|
|
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, cvf::Color4f color );
|
|
|
|
|
void updateCellResultColor( RivCellSetEnum geometryType, size_t timeStepIndex, RimEclipseCellColors* cellResultColors );
|
|
|
|
|
void updateCellEdgeResultColor( RivCellSetEnum geometryType,
|
|
|
|
|
size_t timeStepIndex,
|
|
|
|
|
RimEclipseCellColors* cellResultColors,
|
|
|
|
|
RimCellEdgeColors* cellEdgeResultColors );
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2013-12-09 14:17:36 +01:00
|
|
|
// Faults
|
2019-09-06 10:40:57 +02:00
|
|
|
void appendFaultsStaticGeometryPartsToModel( cvf::ModelBasicList* model, RivCellSetEnum geometryType );
|
2020-02-12 11:43:15 +01:00
|
|
|
void appendFaultsDynamicGeometryPartsToModel( cvf::ModelBasicList* model, RivCellSetEnum geometryType, size_t frameIndex );
|
2019-09-06 10:40:57 +02:00
|
|
|
void updateFaultColors( RivCellSetEnum geometryType, size_t timeStepIndex, RimEclipseCellColors* cellResultColors );
|
|
|
|
|
void updateFaultCellEdgeResultColor( RivCellSetEnum geometryType,
|
|
|
|
|
size_t timeStepIndex,
|
|
|
|
|
RimEclipseCellColors* cellResultColors,
|
|
|
|
|
RimCellEdgeColors* cellEdgeResultColors );
|
2013-12-09 14:17:36 +01:00
|
|
|
|
2013-12-18 12:18:15 +01:00
|
|
|
// Fault labels
|
2019-09-06 10:40:57 +02: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 );
|
|
|
|
|
|
2020-03-02 08:55:45 +01:00
|
|
|
// Element Vector Result
|
|
|
|
|
void appendElementVectorResultDynamicGeometryPartsToModel( cvf::ModelBasicList* model,
|
|
|
|
|
RivCellSetEnum geometryType,
|
|
|
|
|
size_t frameIndex );
|
|
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void forceWatertightGeometryOnForType( RivCellSetEnum geometryType );
|
|
|
|
|
void clearWatertightGeometryFlags();
|
|
|
|
|
|
|
|
|
|
static void computePropertyVisibility( cvf::UByteArray* cellVisibilities,
|
|
|
|
|
const RigGridBase* grid,
|
|
|
|
|
size_t timeStepIndex,
|
|
|
|
|
const cvf::UByteArray* rangeFilterVisibility,
|
|
|
|
|
RimEclipsePropertyFilterCollection* propFilterColl );
|
2018-10-29 12:52:57 +01:00
|
|
|
|
2012-05-18 09:45:23 +02:00
|
|
|
private:
|
2019-09-06 10:40:57 +02:00
|
|
|
void createGeometry( RivCellSetEnum geometryType );
|
2020-02-12 11:43:15 +01:00
|
|
|
void computeVisibility( cvf::UByteArray* cellVisibility, RivCellSetEnum geometryType, RigGridBase* grid, size_t gridIdx );
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void createPropertyFilteredNoneWellCellGeometry( size_t frameIndex );
|
|
|
|
|
void createPropertyFilteredWellGeometry( size_t frameIndex );
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void clearGeometryCache( RivCellSetEnum geomType );
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
static void computeNativeVisibility( cvf::UByteArray* cellVisibilities,
|
|
|
|
|
const RigGridBase* grid,
|
|
|
|
|
const RigActiveCellInfo* activeCellInfo,
|
|
|
|
|
const cvf::UByteArray* cellIsInWellStatuses,
|
|
|
|
|
bool invalidCellsIsVisible,
|
|
|
|
|
bool inactiveCellsIsVisible,
|
|
|
|
|
bool activeCellsIsVisible );
|
2018-10-26 16:23:18 +02:00
|
|
|
|
2021-01-11 18:47:09 +01:00
|
|
|
void computeFilterVisibility( RivCellSetEnum geometryType,
|
|
|
|
|
cvf::UByteArray* cellVisibilities,
|
|
|
|
|
const RigGridBase* grid,
|
|
|
|
|
const cvf::UByteArray* nativeVisibility,
|
|
|
|
|
const RimCellFilterCollection* rangeFilterColl );
|
2019-09-06 10:40:57 +02:00
|
|
|
void computeOverriddenCellVisibility( cvf::UByteArray* cellVisibility, const RigGridBase* grid );
|
2015-09-14 16:14:44 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
static void copyByteArray( cvf::UByteArray* dest, const cvf::UByteArray* source );
|
2015-09-14 16:14:44 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
RivReservoirPartMgr* reservoirPartManager( RivCellSetEnum geometryType, size_t timeStepIndex );
|
2014-01-06 12:06:36 +01:00
|
|
|
|
2013-04-22 09:13:37 +02:00
|
|
|
private:
|
2019-09-06 10:40:57 +02:00
|
|
|
std::array<RivReservoirPartMgr, PROPERTY_FILTERED> m_geometries;
|
|
|
|
|
std::array<bool, PROPERTY_FILTERED> m_geometriesNeedsRegen;
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
cvf::Collection<RivReservoirPartMgr> m_propFilteredGeometryFrames;
|
|
|
|
|
std::vector<uchar> m_propFilteredGeometryFramesNeedsRegen;
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
cvf::Collection<RivReservoirPartMgr> m_propFilteredWellGeometryFrames;
|
|
|
|
|
std::vector<uchar> m_propFilteredWellGeometryFramesNeedsRegen;
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
cvf::ref<cvf::Transform> m_scaleTransform;
|
|
|
|
|
caf::PdmPointer<RimEclipseView> m_reservoirView;
|
2012-05-18 09:45:23 +02:00
|
|
|
};
|