2018-10-16 09:53:30 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
2019-01-11 13:03:46 +01:00
|
|
|
// Copyright (C) 2018- Equinor ASA
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2018-10-16 09:53:30 +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
|
|
|
//
|
2018-10-16 09:53:30 +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>
|
2018-10-16 09:53:30 +02:00
|
|
|
// for more details.
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "RimCheckableNamedObject.h"
|
2019-01-11 15:11:38 +01:00
|
|
|
#include "RimContourMapProjection.h"
|
2018-10-16 09:53:30 +02:00
|
|
|
#include "RimRegularLegendConfig.h"
|
|
|
|
|
|
|
|
|
|
#include "cafDisplayCoordTransform.h"
|
|
|
|
|
#include "cafPdmChildField.h"
|
|
|
|
|
#include "cafPdmField.h"
|
|
|
|
|
#include "cafPdmObject.h"
|
|
|
|
|
|
2018-10-31 16:09:14 +01:00
|
|
|
#include "cvfBoundingBox.h"
|
2018-10-16 09:53:30 +02:00
|
|
|
#include "cvfGeometryBuilderFaceList.h"
|
2018-12-21 08:44:30 +01:00
|
|
|
#include "cvfString.h"
|
2018-10-16 09:53:30 +02:00
|
|
|
#include "cvfVector2.h"
|
|
|
|
|
|
|
|
|
|
class RigMainGrid;
|
2018-10-23 16:32:40 +02:00
|
|
|
class RigResultAccessor;
|
2019-01-11 13:56:35 +01:00
|
|
|
class RimEclipseContourMapView;
|
2019-04-25 07:42:38 +02:00
|
|
|
class RimEclipseCase;
|
2018-11-09 15:25:35 +01:00
|
|
|
class RimEclipseResultDefinition;
|
2018-10-16 09:53:30 +02:00
|
|
|
|
|
|
|
|
//==================================================================================================
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
|
|
|
|
///
|
2018-10-16 09:53:30 +02:00
|
|
|
//==================================================================================================
|
2019-01-11 15:11:38 +01:00
|
|
|
class RimEclipseContourMapProjection : public RimContourMapProjection
|
2018-10-16 09:53:30 +02:00
|
|
|
{
|
|
|
|
|
CAF_PDM_HEADER_INIT;
|
|
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
public:
|
2019-01-11 13:03:46 +01:00
|
|
|
RimEclipseContourMapProjection();
|
|
|
|
|
~RimEclipseContourMapProjection() override;
|
2018-10-16 09:53:30 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
QString weightingParameter() const;
|
|
|
|
|
void updatedWeightingResult();
|
2018-12-20 10:38:20 +01:00
|
|
|
|
2019-01-11 16:06:08 +01:00
|
|
|
// Eclipse case overrides for contour map methods
|
|
|
|
|
QString resultDescriptionText() const override;
|
2019-01-11 15:11:38 +01:00
|
|
|
RimRegularLegendConfig* legendConfig() const override;
|
|
|
|
|
void updateLegend() override;
|
2018-11-14 12:38:20 +01:00
|
|
|
|
2018-10-16 09:53:30 +02:00
|
|
|
protected:
|
2019-01-11 15:11:38 +01:00
|
|
|
typedef RimContourMapProjection::CellIndexAndResult CellIndexAndResult;
|
2018-11-21 09:32:04 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void updateGridInformation() override;
|
|
|
|
|
std::vector<double> retrieveParameterWeights() override;
|
|
|
|
|
std::vector<double> generateResults( int timeStep ) override;
|
|
|
|
|
bool resultVariableChanged() const override;
|
|
|
|
|
void clearResultVariable() override;
|
|
|
|
|
RimGridView* baseView() const override;
|
|
|
|
|
std::vector<size_t> findIntersectingCells( const cvf::BoundingBox& bbox ) const override;
|
|
|
|
|
size_t kLayer( size_t globalCellIdx ) const override;
|
|
|
|
|
double calculateOverlapVolume( size_t globalCellIdx, const cvf::BoundingBox& bbox ) const override;
|
|
|
|
|
double calculateRayLengthInCell( size_t globalCellIdx,
|
|
|
|
|
const cvf::Vec3d& highestPoint,
|
|
|
|
|
const cvf::Vec3d& lowestPoint ) const override;
|
|
|
|
|
double getParameterWeightForCell( size_t cellResultIdx, const std::vector<double>& parameterWeights ) const override;
|
|
|
|
|
size_t gridResultIndex( size_t globalCellIdx ) const override;
|
2019-01-11 10:48:28 +01:00
|
|
|
|
2019-01-11 16:06:08 +01:00
|
|
|
// Eclipse implementation specific data generation methods
|
2019-09-06 10:40:57 +02:00
|
|
|
std::vector<double> calculateColumnResult( ResultAggregation resultAggregation ) const;
|
2019-01-02 15:53:13 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
RimEclipseCase* eclipseCase() const;
|
|
|
|
|
RimEclipseContourMapView* view() const;
|
2019-01-11 16:14:54 +01:00
|
|
|
|
2019-01-11 16:06:08 +01:00
|
|
|
protected:
|
|
|
|
|
// Framework overrides
|
2020-02-12 11:43:15 +01:00
|
|
|
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
2019-09-06 10:40:57 +02:00
|
|
|
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
2019-01-11 16:06:08 +01:00
|
|
|
void initAfterRead() override;
|
|
|
|
|
|
2018-10-16 09:53:30 +02:00
|
|
|
protected:
|
2019-09-06 10:40:57 +02:00
|
|
|
caf::PdmField<bool> m_weightByParameter;
|
|
|
|
|
caf::PdmChildField<RimEclipseResultDefinition*> m_weightingResult;
|
2018-12-20 10:38:20 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
cvf::ref<RigMainGrid> m_mainGrid;
|
|
|
|
|
QString m_currentResultName;
|
2018-10-16 09:53:30 +02:00
|
|
|
};
|