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 "cafFixedArray.h"
|
|
|
|
#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"
|
|
|
|
|
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:
|
2015-05-21 03:05:33 -05:00
|
|
|
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);
|
|
|
|
cvf::cref<cvf::UByteArray> cellVisibility(RivCellSetEnum geometryType, size_t gridIndex, size_t frameIndex) const;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2015-06-18 05:39:10 -05:00
|
|
|
void appendStaticGeometryPartsToModel (cvf::ModelBasicList* model, RivCellSetEnum geometryType, const std::vector<size_t>& gridIndices);
|
|
|
|
void appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model, RivCellSetEnum geometryType, size_t frameIndex, const std::vector<size_t>& gridIndices);
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2015-06-18 05:39:10 -05:00
|
|
|
void updateCellColor (RivCellSetEnum geometryType, cvf::Color4f color);
|
|
|
|
void updateCellColor (RivCellSetEnum geometryType, size_t timeStepIndex,
|
2013-04-22 02:13:37 -05:00
|
|
|
cvf::Color4f color);
|
2015-06-18 05:39:10 -05:00
|
|
|
void updateCellResultColor (RivCellSetEnum geometryType, size_t timeStepIndex,
|
2015-06-25 07:34:20 -05:00
|
|
|
RimEclipseCellColors* cellResultColors);
|
2015-06-18 05:39:10 -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
|
2015-06-18 05:39:10 -05:00
|
|
|
void appendFaultsStaticGeometryPartsToModel(cvf::ModelBasicList* model, RivCellSetEnum geometryType);
|
|
|
|
void appendFaultsDynamicGeometryPartsToModel(cvf::ModelBasicList* model, RivCellSetEnum geometryType, size_t frameIndex);
|
2015-06-25 07:34:20 -05:00
|
|
|
void updateFaultColors(RivCellSetEnum geometryType, size_t timeStepIndex, RimEclipseCellColors* cellResultColors);
|
2015-10-23 08:46:25 -05:00
|
|
|
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
|
2016-07-16 09:09:03 -05:00
|
|
|
RivCellSetEnum geometryTypeForFaultLabels(const std::vector<RivCellSetEnum>& geometryTypes, bool showFaultsOutsideFilters) const;
|
2015-06-18 05:39:10 -05:00
|
|
|
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
|
|
|
|
2015-06-18 05:39:10 -05:00
|
|
|
void setFaultForceVisibilityForGeometryType(RivCellSetEnum geometryType, bool forceVisibility);
|
2014-01-07 07:27:43 -06:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
private:
|
2015-06-18 05:39:10 -05:00
|
|
|
void createGeometry(RivCellSetEnum geometryType);
|
|
|
|
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
|
|
|
|
|
|
|
|
2013-04-22 02:13:37 -05:00
|
|
|
static void computeNativeVisibility (cvf::UByteArray* cellVisibilities, const RigGridBase* grid, const RigActiveCellInfo* activeCellInfo, const cvf::UByteArray* cellIsInWellStatuses, bool invalidCellsIsVisible, bool inactiveCellsIsVisible, bool activeCellsIsVisible, bool mainGridIsVisible);
|
2015-06-18 05:39:10 -05:00
|
|
|
void computeRangeVisibility (RivCellSetEnum geometryType, cvf::UByteArray* cellVisibilities, const RigGridBase* grid, const cvf::UByteArray* nativeVisibility, const RimCellRangeFilterCollection* rangeFilterColl);
|
2015-06-25 04:48:24 -05:00
|
|
|
static void computePropertyVisibility(cvf::UByteArray* cellVisibilities, const RigGridBase* grid, size_t timeStepIndex, const cvf::UByteArray* rangeFilterVisibility, RimEclipsePropertyFilterCollection* propFilterColl);
|
2015-09-14 09:14:44 -05:00
|
|
|
void computeOverriddenCellVisibility(cvf::UByteArray* cellVisibility, const RigGridBase* grid);
|
|
|
|
|
|
|
|
|
|
|
|
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:
|
2012-05-18 02:45:23 -05:00
|
|
|
caf::FixedArray<RivReservoirPartMgr, PROPERTY_FILTERED> m_geometries;
|
2013-04-22 02:13:37 -05:00
|
|
|
caf::FixedArray<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
|
|
|
|
|
|
|
};
|