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
|
|
|
|
|
|
|
|
#include "RimDefines.h"
|
2015-07-31 11:58:23 -05:00
|
|
|
|
|
|
|
#include "cafAppEnum.h"
|
2014-08-07 08:53:05 -05:00
|
|
|
#include "cafFixedArray.h"
|
2015-07-31 11:58:23 -05:00
|
|
|
#include "cafPdmChildField.h"
|
|
|
|
#include "cafPdmField.h"
|
|
|
|
#include "cafPdmObject.h"
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-03-22 09:43:42 -05:00
|
|
|
class RigCaseCellResultsData;
|
2016-08-03 09:01:44 -05:00
|
|
|
class RimEclipseCase;
|
|
|
|
class RimEclipseCellColors;
|
2015-05-21 03:05:33 -05:00
|
|
|
class RimEclipseView;
|
2015-07-31 11:58:23 -05:00
|
|
|
class RimLegendConfig;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2016-08-06 01:44:49 -05:00
|
|
|
class RimCellEdgeMetaData
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
size_t m_resultIndex;
|
|
|
|
QString m_resultVariable;
|
|
|
|
bool m_isStatic;
|
|
|
|
};
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
//==================================================================================================
|
|
|
|
///
|
|
|
|
///
|
|
|
|
//==================================================================================================
|
2015-06-25 06:41:55 -05:00
|
|
|
class RimCellEdgeColors : public caf::PdmObject
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
CAF_PDM_HEADER_INIT;
|
|
|
|
public:
|
2015-06-25 06:41:55 -05:00
|
|
|
RimCellEdgeColors();
|
|
|
|
virtual ~RimCellEdgeColors();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
enum EdgeFaceType
|
|
|
|
{
|
|
|
|
X, NEG_X,
|
|
|
|
Y, NEG_Y,
|
|
|
|
Z, NEG_Z
|
|
|
|
};
|
|
|
|
|
2016-09-12 04:24:15 -05:00
|
|
|
enum PropertyType
|
2016-09-09 04:46:49 -05:00
|
|
|
{
|
2016-09-12 04:24:15 -05:00
|
|
|
MULTI_AXIS_STATIC_PROPERTY,
|
|
|
|
ANY_SINGLE_PROPERTY
|
2016-09-09 04:46:49 -05:00
|
|
|
};
|
|
|
|
|
2015-06-25 06:41:55 -05:00
|
|
|
typedef caf::AppEnum<RimCellEdgeColors::EdgeFaceType> EdgeFaceEnum;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2015-05-21 03:05:33 -05:00
|
|
|
void setReservoirView(RimEclipseView* ownerReservoirView);
|
2016-08-03 09:01:44 -05:00
|
|
|
void setEclipseCase(RimEclipseCase* eclipseCase);
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2016-08-06 01:44:49 -05:00
|
|
|
void setResultVariable(const QString& variableName);
|
|
|
|
QString resultVariable() const;
|
2017-01-11 14:07:03 -06:00
|
|
|
QString resultVariableUiName() const;
|
2017-01-12 08:00:18 -06:00
|
|
|
QString resultVariableUiShortName() const;
|
2016-08-06 01:44:49 -05:00
|
|
|
|
2015-07-01 07:46:05 -05:00
|
|
|
caf::PdmField<bool> enableCellEdgeColors;
|
2013-04-30 08:55:12 -05:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
double ignoredScalarValue() { return m_ignoredResultScalar; }
|
|
|
|
void gridScalarIndices(size_t resultIndices[6]);
|
2016-08-06 01:44:49 -05:00
|
|
|
void cellEdgeMetaData(std::vector<RimCellEdgeMetaData>* metaData);
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
void loadResult();
|
|
|
|
bool hasResult() const;
|
2016-09-06 05:17:02 -05:00
|
|
|
bool hasCategoryResult() const;
|
2017-01-11 08:03:39 -06:00
|
|
|
bool isUsingSingleVariable() const;
|
|
|
|
|
2016-09-06 05:17:02 -05:00
|
|
|
RimEclipseCellColors* singleVarEdgeResultColors();
|
2016-09-07 03:46:47 -05:00
|
|
|
RimLegendConfig* legendConfig();
|
2017-01-11 08:03:39 -06:00
|
|
|
PropertyType propertyType() const;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2012-09-11 02:22:36 -05:00
|
|
|
void minMaxCellEdgeValues(double& min, double& max);
|
2013-06-03 06:08:11 -05:00
|
|
|
void posNegClosestToZero(double& pos, double& neg);
|
2012-05-18 02:45:23 -05:00
|
|
|
protected:
|
|
|
|
|
2016-08-03 09:01:44 -05:00
|
|
|
virtual void initAfterRead();
|
2012-05-18 02:45:23 -05:00
|
|
|
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
|
|
|
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly );
|
2016-08-03 09:01:44 -05:00
|
|
|
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
|
2016-08-06 01:44:49 -05:00
|
|
|
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "");
|
2016-08-03 09:01:44 -05:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
QStringList findResultVariableNames();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void resetResultIndices();
|
|
|
|
void updateIgnoredScalarValue();
|
2015-07-01 07:16:33 -05:00
|
|
|
|
2016-08-06 01:44:49 -05:00
|
|
|
void gridScalarResultNames(std::vector<QString>* resultNames);
|
2016-08-03 09:01:44 -05:00
|
|
|
|
2015-07-01 07:16:33 -05:00
|
|
|
virtual caf::PdmFieldHandle* objectToggleField();
|
|
|
|
|
2016-08-06 01:44:49 -05:00
|
|
|
caf::PdmField<QString> m_resultVariable;
|
2015-07-01 07:16:33 -05:00
|
|
|
caf::PdmField<bool> useXVariable;
|
|
|
|
caf::PdmField<bool> useYVariable;
|
|
|
|
caf::PdmField<bool> useZVariable;
|
|
|
|
|
2016-09-06 05:17:02 -05:00
|
|
|
caf::FixedArray<std::pair<QString, size_t>, 6 > m_resultNameToIndexPairs;
|
|
|
|
caf::PdmPointer<RimEclipseView> m_reservoirView;
|
|
|
|
double m_ignoredResultScalar;
|
|
|
|
|
2016-09-07 03:46:47 -05:00
|
|
|
|
2016-09-12 04:24:15 -05:00
|
|
|
caf::PdmField<caf::AppEnum< PropertyType > > m_propertyType;
|
2016-09-07 03:46:47 -05:00
|
|
|
caf::PdmChildField<RimLegendConfig*> m_legendConfig;
|
2016-09-06 05:17:02 -05:00
|
|
|
caf::PdmChildField<RimEclipseCellColors*> m_singleVarEdgeResultColors;
|
2016-08-03 09:01:44 -05:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
};
|
|
|
|
|