Files
ResInsight/ApplicationCode/ProjectDataModel/RimCellEdgeColors.h
T

130 lines
4.9 KiB
C++
Raw Normal View History

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