From 918f2c43052d6be39ef0a8331165e6a461bc46e8 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Tue, 6 May 2014 22:40:25 +0200 Subject: [PATCH] Removed ternary specific code and cleaned up includes --- .../ProjectDataModel/RimLegendConfig.cpp | 96 ++----------------- .../ProjectDataModel/RimLegendConfig.h | 5 - 2 files changed, 9 insertions(+), 92 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/RimLegendConfig.cpp b/ApplicationCode/ProjectDataModel/RimLegendConfig.cpp index 124f3b8e52..3cfd96ca48 100644 --- a/ApplicationCode/ProjectDataModel/RimLegendConfig.cpp +++ b/ApplicationCode/ProjectDataModel/RimLegendConfig.cpp @@ -18,27 +18,23 @@ #include "RimLegendConfig.h" -#include "RimReservoirView.h" #include "cafFactory.h" -#include "cafPdmUiLineEditor.h" +#include "cafPdmFieldCvfColor.h" +#include "cafPdmFieldCvfMat4d.h" #include "cafPdmUiComboBoxEditor.h" +#include "cafPdmUiLineEditor.h" -#include "cvfScalarMapperDiscreteLog.h" -#include "cvfScalarMapperContinuousLog.h" -#include "cvfScalarMapperContinuousLinear.h" #include "cvfOverlayScalarMapperLegend.h" +#include "cvfScalarMapperContinuousLinear.h" +#include "cvfScalarMapperContinuousLog.h" #include "cvfScalarMapperDiscreteLinear.h" +#include "cvfScalarMapperDiscreteLog.h" + #include #include "RiaApplication.h" -#include "cafPdmFieldCvfMat4d.h" -#include "cafPdmFieldCvfColor.h" -#include "RimResultSlot.h" -#include "RimCellEdgeResultSlot.h" -#include "RimCellRangeFilterCollection.h" -#include "RimCellPropertyFilterCollection.h" -#include "RimWellCollection.h" -#include "Rim3dOverlayInfoConfig.h" +#include "RimReservoirView.h" + CAF_PDM_SOURCE_INIT(RimLegendConfig, "Legend"); @@ -480,18 +476,6 @@ void RimLegendConfig::updateFieldVisibility() m_userDefinedMaxValue.setUiHidden(true); m_userDefinedMinValue.setUiHidden(true); } - - if (m_reservoirView && m_reservoirView->cellResult() && m_reservoirView->cellResult()->isTernarySaturationSelected()) - { - if (m_mappingMode == LINEAR_DISCRETE) - { - m_numLevels.setUiHidden(false); - } - else - { - m_numLevels.setUiHidden(true); - } - } } //-------------------------------------------------------------------------------------------------- @@ -647,18 +631,6 @@ void RimLegendConfig::setClosestToZeroValues(double globalPosClosestToZero, doub //-------------------------------------------------------------------------------------------------- void RimLegendConfig::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) { - if (m_reservoirView && m_reservoirView->cellResult() && m_reservoirView->cellResult()->isTernarySaturationSelected()) - { - //TODO: Add support for discrete legend -// caf::PdmUiOrdering * formatGr = uiOrdering.addNewGroup("Ternary format"); -// formatGr->add(&m_mappingMode); -// formatGr->add(&m_numLevels); - caf::PdmUiOrdering * mappingGr = uiOrdering.addNewGroup("Mapping"); - mappingGr->add(&m_rangeMode); - - uiOrdering.setForgetRemainingFields(true); - } - else { caf::PdmUiOrdering * formatGr = uiOrdering.addNewGroup("Format"); formatGr->add(&m_numLevels); @@ -674,53 +646,3 @@ void RimLegendConfig::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& } } -//-------------------------------------------------------------------------------------------------- -/// Return the number of levels if mapping mode is LINEAR_DISCRETE, else -1 -//-------------------------------------------------------------------------------------------------- -int RimLegendConfig::linearDiscreteLevelCount() const -{ - if (m_mappingMode == LINEAR_DISCRETE) - { - return m_numLevels; - } - - return -1; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -QList RimLegendConfig::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) -{ - if (m_reservoirView && m_reservoirView->cellResult() && m_reservoirView->cellResult()->isTernarySaturationSelected()) - { - if (fieldNeedingOptions == &m_mappingMode) - { - QList optionList; - optionList.push_back(caf::PdmOptionItemInfo(MappingEnum(LINEAR_DISCRETE).uiText(), LINEAR_DISCRETE)); - optionList.push_back(caf::PdmOptionItemInfo(MappingEnum(LINEAR_CONTINUOUS).uiText(), LINEAR_CONTINUOUS)); - - return optionList; - } - - if (fieldNeedingOptions == &m_rangeMode) - { - QList optionList; - optionList.push_back(caf::PdmOptionItemInfo(RangeModeEnum(AUTOMATIC_ALLTIMESTEPS).uiText(), AUTOMATIC_ALLTIMESTEPS)); - optionList.push_back(caf::PdmOptionItemInfo(RangeModeEnum(AUTOMATIC_CURRENT_TIMESTEP).uiText(), AUTOMATIC_CURRENT_TIMESTEP)); - - return optionList; - } - } - - return QList(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RimLegendConfig::RangeModeType RimLegendConfig::rangeMode() const -{ - return m_rangeMode(); -} - diff --git a/ApplicationCode/ProjectDataModel/RimLegendConfig.h b/ApplicationCode/ProjectDataModel/RimLegendConfig.h index 183acca583..a8a697601d 100644 --- a/ApplicationCode/ProjectDataModel/RimLegendConfig.h +++ b/ApplicationCode/ProjectDataModel/RimLegendConfig.h @@ -96,9 +96,6 @@ public: cvf::ScalarMapper* scalarMapper() { return m_currentScalarMapper.p(); } cvf::OverlayScalarMapperLegend* legend() { return m_legend.p(); } - int linearDiscreteLevelCount() const; - RangeModeType rangeMode() const; - protected: virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue); @@ -110,8 +107,6 @@ private: cvf::ref interpolateColorArray(const cvf::Color3ubArray& colorArray, cvf::uint targetColorCount); double roundToNumSignificantDigits(double value, double precision); - virtual QList calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly); - private: caf::PdmPointer m_reservoirView;