#1230 Created StimPlan colors and show lenged in 3D view

This commit is contained in:
Magne Sjaastad
2017-02-20 09:31:24 +01:00
parent 820e574a61
commit b7aebbb392
12 changed files with 565 additions and 64 deletions

View File

@@ -0,0 +1,70 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017 - Statoil ASA
//
// 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 "cafAppEnum.h"
#include "cafPdmChildField.h"
#include "cafPdmField.h"
#include "cafPdmObject.h"
#include "cafPdmChildArrayField.h"
namespace caf {
class PdmOptionItemInfo;
}
class RimLegendConfig;
class RimFractureTemplateCollection;
//==================================================================================================
///
///
//==================================================================================================
class RimStimPlanColors : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RimStimPlanColors();
virtual ~RimStimPlanColors();
RimLegendConfig* activeLegend() const;
QString resultName() const;
QString unit() const;
void loadDataAndUpdate();
void updateLegendData();
protected:
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
private:
RimFractureTemplateCollection* fractureTemplateCollection() const;
static QString toString(const std::pair<QString, QString>& resultNameAndUnit);
static QString toResultName(const QString& resultNameAndUnit);
static QString toUnit(const QString& resultNameAndUnit);
private:
caf::PdmField<QString> m_resultNameAndUnit;
caf::PdmChildArrayField<RimLegendConfig*> m_legendConfigurations;
};