mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-10 07:26:03 -06:00
#4156 Simplify curve naming code
This commit is contained in:
parent
102d1c75a7
commit
d2393cb8a5
@ -40,7 +40,6 @@ ${CMAKE_CURRENT_LIST_DIR}/RiaQIconTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaCellDividingTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaFieldHandleTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaBoundingBoxTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaGridCrossPlotCurveNameHelper.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
@ -81,7 +80,6 @@ ${CMAKE_CURRENT_LIST_DIR}/RiaQIconTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaCellDividingTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaFieldHandleTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaBoundingBoxTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaGridCrossPlotCurveNameHelper.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
@ -1,59 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2019- Equinor 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#include "RiaGridCrossPlotCurveNameHelper.h"
|
||||
|
||||
#include "RimGridCrossPlotCurveSet.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaGridCrossPlotCurveNameHelper::addCurveSet(RimGridCrossPlotCurveSet* curveSet)
|
||||
{
|
||||
m_caseNameSet.insert(curveSet->caseNameString());
|
||||
m_axisVariablesSet.insert(curveSet->axisVariableString());
|
||||
m_timeStepSet.insert(curveSet->timeStepString());
|
||||
for (auto category : curveSet->groupStrings())
|
||||
{
|
||||
m_categoriesSet.insert(category);
|
||||
}
|
||||
|
||||
m_curveSets.push_back(curveSet);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaGridCrossPlotCurveNameHelper::applyCurveNames()
|
||||
{
|
||||
for (auto curveSet : m_curveSets)
|
||||
{
|
||||
curveSet->updateCurveNames(m_caseNameSet.size() > 1u, m_axisVariablesSet.size() > 1u, m_timeStepSet.size() > 1u, m_categoriesSet.size() > 1u);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaGridCrossPlotCurveNameHelper::reset()
|
||||
{
|
||||
m_caseNameSet.clear();
|
||||
m_axisVariablesSet.clear();
|
||||
m_timeStepSet.clear();
|
||||
m_categoriesSet.clear();
|
||||
m_curveSets.clear();
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2019- Equinor 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 <QString>
|
||||
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
class RimGridCrossPlotCurveSet;
|
||||
|
||||
class RiaGridCrossPlotCurveNameHelper
|
||||
{
|
||||
public:
|
||||
void addCurveSet(RimGridCrossPlotCurveSet* curveSet);
|
||||
void applyCurveNames();
|
||||
void reset();
|
||||
|
||||
private:
|
||||
std::set<QString> m_caseNameSet;
|
||||
std::set<QString> m_axisVariablesSet;
|
||||
std::set<QString> m_timeStepSet;
|
||||
std::set<QString> m_categoriesSet;
|
||||
|
||||
std::vector<RimGridCrossPlotCurveSet*> m_curveSets;
|
||||
|
||||
};
|
||||
|
@ -17,8 +17,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#include "RimGridCrossPlot.h"
|
||||
|
||||
#include "RiaGridCrossPlotCurveNameHelper.h"
|
||||
|
||||
#include "RiuGridCrossQwtPlot.h"
|
||||
#include "RiuPlotMainWindowTools.h"
|
||||
#include "RiuQwtPlotTools.h"
|
||||
@ -157,8 +155,10 @@ void RimGridCrossPlot::zoomAll()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridCrossPlot::calculateZoomRangeAndUpdateQwt()
|
||||
{
|
||||
// this->calculateXZoomRange();
|
||||
m_qwtPlot->replot();
|
||||
if (m_qwtPlot)
|
||||
{
|
||||
m_qwtPlot->replot();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -193,17 +193,42 @@ QString RimGridCrossPlot::createAutoName() const
|
||||
|
||||
if (m_nameConfig->addDataSetNames())
|
||||
{
|
||||
QStringList dataSets;
|
||||
QStringList dataSetStrings;
|
||||
std::map<RimGridCrossPlotCurveSet::NameComponents, std::set<QString>> allNameComponents;
|
||||
for (auto curveSet : m_crossPlotCurveSets)
|
||||
{
|
||||
if (curveSet->isChecked())
|
||||
{
|
||||
dataSets += curveSet->createAutoName();
|
||||
QStringList componentList;
|
||||
auto curveSetNameComponents =
|
||||
curveSet->nameComponents();
|
||||
|
||||
for (auto curveSetNameComponent : curveSetNameComponents)
|
||||
{
|
||||
if (!curveSetNameComponent.second.isEmpty())
|
||||
{
|
||||
if (allNameComponents[curveSetNameComponent.first].count(curveSetNameComponent.second) == 0u)
|
||||
{
|
||||
componentList += curveSetNameComponent.second;
|
||||
allNameComponents[curveSetNameComponent.first].insert(curveSetNameComponent.second);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!componentList.isEmpty())
|
||||
{
|
||||
dataSetStrings += componentList.join(", ");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!dataSets.isEmpty())
|
||||
|
||||
dataSetStrings.removeDuplicates();
|
||||
if (dataSetStrings.size() > 3)
|
||||
{
|
||||
autoName += QString("(%1)").arg(dataSets.join("; "));
|
||||
autoName += QString("(%1 Data Sets)").arg(dataSetStrings.size());
|
||||
}
|
||||
if (!dataSetStrings.isEmpty())
|
||||
{
|
||||
autoName += QString("(%1)").arg(dataSetStrings.join("; "));
|
||||
}
|
||||
}
|
||||
|
||||
@ -471,7 +496,10 @@ void RimGridCrossPlot::updatePlot()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridCrossPlot::updateCurveNamesAndPlotTitle()
|
||||
{
|
||||
updateCurveNames();
|
||||
for (size_t i = 0; i < m_crossPlotCurveSets.size(); ++i)
|
||||
{
|
||||
m_crossPlotCurveSets[i]->updateCurveNames(i, m_crossPlotCurveSets.size());
|
||||
}
|
||||
|
||||
if (m_qwtPlot)
|
||||
{
|
||||
@ -636,21 +664,6 @@ void RimGridCrossPlot::updateAxisFromQwt(RiaDefines::PlotAxis axisType)
|
||||
axisProperties->updateConnectedEditors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridCrossPlot::updateCurveNames()
|
||||
{
|
||||
m_curveNameHelper.reset();
|
||||
|
||||
for (auto curveSet : m_crossPlotCurveSets())
|
||||
{
|
||||
m_curveNameHelper.addCurveSet(curveSet);
|
||||
}
|
||||
|
||||
m_curveNameHelper.applyCurveNames();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Name Configuration
|
||||
///
|
||||
|
@ -22,7 +22,6 @@
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
#include "RiaDefines.h"
|
||||
#include "RiaGridCrossPlotCurveNameHelper.h"
|
||||
#include "RimRiuQwtPlotOwnerInterface.h"
|
||||
#include "RimNameConfig.h"
|
||||
#include "RimViewWindow.h"
|
||||
@ -112,7 +111,6 @@ private:
|
||||
caf::PdmChildArrayField<RimGridCrossPlotCurveSet*> m_crossPlotCurveSets;
|
||||
|
||||
QPointer<RiuGridCrossQwtPlot> m_qwtPlot;
|
||||
RiaGridCrossPlotCurveNameHelper m_curveNameHelper;
|
||||
};
|
||||
|
||||
|
||||
|
@ -192,7 +192,7 @@ QString RimGridCrossPlotCurveSet::createAutoName() const
|
||||
nameTags += timeStepString();
|
||||
}
|
||||
|
||||
if (m_nameConfig->addGrouping)
|
||||
if (m_nameConfig->addGrouping() && groupParameter() != "None")
|
||||
{
|
||||
QString catTitle = groupTitle();
|
||||
if (!catTitle.isEmpty()) nameTags += catTitle;
|
||||
@ -205,6 +205,14 @@ QString RimGridCrossPlotCurveSet::createAutoName() const
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimGridCrossPlotCurveSet::groupTitle() const
|
||||
{
|
||||
return QString("Grouping by %1").arg(groupParameter());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimGridCrossPlotCurveSet::groupParameter() const
|
||||
{
|
||||
if (m_grouping() == GROUP_BY_TIME)
|
||||
{
|
||||
@ -218,7 +226,7 @@ QString RimGridCrossPlotCurveSet::groupTitle() const
|
||||
{
|
||||
return QString("%1").arg(m_groupingProperty->resultVariableUiShortName());
|
||||
}
|
||||
return "";
|
||||
return "None";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -276,7 +284,7 @@ QString RimGridCrossPlotCurveSet::caseNameString() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimGridCrossPlotCurveSet::axisVariableString() const
|
||||
{
|
||||
return QString("%1 x %2").arg(xAxisName(), yAxisName());
|
||||
return QString("%1 x %2").arg(xAxisName(), yAxisName());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -312,6 +320,25 @@ std::vector<QString> RimGridCrossPlotCurveSet::groupStrings() const
|
||||
return groupStrings;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::map<RimGridCrossPlotCurveSet::NameComponents, QString>
|
||||
RimGridCrossPlotCurveSet::nameComponents() const
|
||||
{
|
||||
std::map<RimGridCrossPlotCurveSet::NameComponents, QString> componentNames;
|
||||
if (m_nameConfig->addCaseName())
|
||||
componentNames[CASE_NAME] = caseNameString();
|
||||
if (m_nameConfig->addAxisVariables())
|
||||
componentNames[AXIS_VARIABLES] = axisVariableString();
|
||||
if (m_nameConfig->addTimestep())
|
||||
componentNames[TIME_STEP] = timeStepString();
|
||||
if (m_nameConfig->addGrouping())
|
||||
componentNames[GROUP_NAME] = groupTitle();
|
||||
|
||||
return componentNames;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -541,6 +568,11 @@ void RimGridCrossPlotCurveSet::fieldChangedByUi(const caf::PdmFieldHandle* chang
|
||||
}
|
||||
else if (changedField == &m_timeStep)
|
||||
{
|
||||
if (m_timeStep != -1 && m_grouping == GROUP_BY_TIME)
|
||||
{
|
||||
m_grouping = NO_GROUPING;
|
||||
}
|
||||
|
||||
loadDataAndUpdate(true);
|
||||
}
|
||||
else if (changedField == &m_grouping)
|
||||
@ -624,6 +656,13 @@ QList<caf::PdmOptionItemInfo> RimGridCrossPlotCurveSet::calculateValueOptions(co
|
||||
{
|
||||
validOptions.erase(GROUP_BY_TIME);
|
||||
}
|
||||
{
|
||||
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>(m_case());
|
||||
if (!eclipseCase || !eclipseCase->eclipseCaseData()->activeFormationNames())
|
||||
{
|
||||
validOptions.erase(GROUP_BY_FORMATION);
|
||||
}
|
||||
}
|
||||
for (auto optionItem : validOptions)
|
||||
{
|
||||
options.push_back(caf::PdmOptionItemInfo(CurveGroupingEnum::uiText(optionItem), optionItem));
|
||||
@ -638,7 +677,7 @@ QList<caf::PdmOptionItemInfo> RimGridCrossPlotCurveSet::calculateValueOptions(co
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridCrossPlotCurveSet::updateLegend()
|
||||
{
|
||||
legendConfig()->setTitle(groupTitle());
|
||||
legendConfig()->setTitle(groupParameter());
|
||||
|
||||
RimGridCrossPlot* parent;
|
||||
this->firstAncestorOrThisOfTypeAsserted(parent);
|
||||
@ -649,11 +688,19 @@ void RimGridCrossPlotCurveSet::updateLegend()
|
||||
if (m_grouping() == GROUP_BY_FORMATION)
|
||||
{
|
||||
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>(m_case());
|
||||
RigFormationNames* formationNames = eclipseCase->eclipseCaseData()->activeFormationNames();
|
||||
|
||||
const std::vector<QString>& categoryNames = formationNames->formationNames();
|
||||
legendConfig()->setNamedCategories(categoryNames);
|
||||
legendConfig()->setAutomaticRanges(0, categoryNames.size() - 1, 0, categoryNames.size() - 1);
|
||||
if (eclipseCase)
|
||||
{
|
||||
RigFormationNames* formationNames = eclipseCase->eclipseCaseData()->activeFormationNames();
|
||||
if (formationNames)
|
||||
{
|
||||
const std::vector<QString>& categoryNames = formationNames->formationNames();
|
||||
if (!categoryNames.empty())
|
||||
{
|
||||
legendConfig()->setNamedCategories(categoryNames);
|
||||
legendConfig()->setAutomaticRanges(0, categoryNames.size() - 1, 0, categoryNames.size() - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (m_grouping() == GROUP_BY_TIME)
|
||||
{
|
||||
@ -663,8 +710,11 @@ void RimGridCrossPlotCurveSet::updateLegend()
|
||||
{
|
||||
categoryNames.push_back(name);
|
||||
}
|
||||
legendConfig()->setNamedCategories(categoryNames);
|
||||
legendConfig()->setAutomaticRanges(0, categoryNames.size() - 1, 0, categoryNames.size() - 1);
|
||||
if (!categoryNames.empty())
|
||||
{
|
||||
legendConfig()->setNamedCategories(categoryNames);
|
||||
legendConfig()->setAutomaticRanges(0, categoryNames.size() - 1, 0, categoryNames.size() - 1);
|
||||
}
|
||||
}
|
||||
else if (m_groupingProperty->eclipseResultAddress().isValid())
|
||||
{
|
||||
@ -730,35 +780,25 @@ void RimGridCrossPlotCurveSet::triggerPlotNameUpdateAndReplot()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridCrossPlotCurveSet::updateCurveNames(bool applyCaseName,
|
||||
bool applyAxisVariables,
|
||||
bool applyTimeStep,
|
||||
bool applyGrouping)
|
||||
void RimGridCrossPlotCurveSet::updateCurveNames(size_t curveSetIndex, size_t curveSetCount)
|
||||
{
|
||||
for (auto curve : m_crossPlotCurves())
|
||||
for (size_t i = 0; i < m_crossPlotCurves.size(); ++i)
|
||||
{
|
||||
QStringList nameTags;
|
||||
|
||||
if (applyCaseName)
|
||||
QString curveSetName = createAutoName();
|
||||
if (curveSetName.isEmpty())
|
||||
{
|
||||
nameTags += caseNameString();
|
||||
if (curveSetCount > 1u)
|
||||
curveSetName = QString("Curve #%1").arg(curveSetIndex + 1);
|
||||
else
|
||||
curveSetName = "Curve";
|
||||
}
|
||||
|
||||
if (applyAxisVariables)
|
||||
{
|
||||
nameTags += axisVariableString();
|
||||
}
|
||||
|
||||
if (applyTimeStep && !timeStepString().isEmpty())
|
||||
{
|
||||
nameTags += timeStepString();
|
||||
}
|
||||
|
||||
if (applyGrouping && groupingEnabled())
|
||||
auto curve = m_crossPlotCurves[i];
|
||||
if (groupingEnabled())
|
||||
{
|
||||
if (groupingByCategoryResult())
|
||||
{
|
||||
nameTags += legendConfig()->categoryNameFromCategoryValue(curve->groupIndex());
|
||||
curve->setCustomName(legendConfig()->categoryNameFromCategoryValue(curve->groupIndex()));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -768,16 +808,14 @@ void RimGridCrossPlotCurveSet::updateCurveNames(bool applyCaseName,
|
||||
double lowerLimit = tickValues[catIndex];
|
||||
double upperLimit = catIndex + 1u < tickValues.size()
|
||||
? tickValues[catIndex + 1u] : std::numeric_limits<double>::infinity();
|
||||
nameTags += QString("%1 [%2, %3]").arg(groupTitle()).arg(lowerLimit).arg(upperLimit);
|
||||
curve->setCustomName(QString("%1 [%2, %3]").arg(groupParameter()).arg(lowerLimit).arg(upperLimit));
|
||||
}
|
||||
curve->setLegendEntryTitle(curveSetName);
|
||||
}
|
||||
|
||||
curve->setCustomName(nameTags.join(", "));
|
||||
if (groupingEnabled())
|
||||
else
|
||||
{
|
||||
curve->setLegendEntryTitle(createAutoName());
|
||||
curve->setCustomName(curveSetName);
|
||||
}
|
||||
|
||||
curve->updateCurveNameAndUpdatePlotLegendAndTitle();
|
||||
}
|
||||
}
|
||||
@ -861,9 +899,9 @@ RimGridCrossPlotCurveSetNameConfig::RimGridCrossPlotCurveSetNameConfig(RimNameCo
|
||||
{
|
||||
CAF_PDM_InitObject("Cross Plot Curve Set NameGenerator", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&addCaseName, "AddCaseName", false, "Add Case Name", "", "", "");
|
||||
CAF_PDM_InitField(&addCaseName, "AddCaseName", true, "Add Case Name", "", "", "");
|
||||
CAF_PDM_InitField(&addAxisVariables, "AddAxisVariables", true, "Add Axis Variables", "", "", "");
|
||||
CAF_PDM_InitField(&addTimestep, "AddTimeStep", false, "Add Time Step", "", "", "");
|
||||
CAF_PDM_InitField(&addTimestep, "AddTimeStep", true, "Add Time Step", "", "", "");
|
||||
CAF_PDM_InitField(&addGrouping, "AddGrouping", true, "Add Data Group", "", "", "");
|
||||
|
||||
setCustomName("");
|
||||
|
@ -71,9 +71,16 @@ class RimGridCrossPlotCurveSet : public RimCheckableNamedObject, public RimNameC
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
|
||||
typedef caf::AppEnum<RigGridCrossPlotCurveGrouping> CurveGroupingEnum;
|
||||
|
||||
enum NameComponents
|
||||
{
|
||||
CASE_NAME,
|
||||
AXIS_VARIABLES,
|
||||
TIME_STEP,
|
||||
GROUP_NAME
|
||||
};
|
||||
|
||||
public:
|
||||
RimGridCrossPlotCurveSet();
|
||||
~RimGridCrossPlotCurveSet() = default;
|
||||
@ -87,6 +94,7 @@ public:
|
||||
int indexInPlot() const;
|
||||
QString createAutoName() const override;
|
||||
QString groupTitle() const;
|
||||
QString groupParameter() const;
|
||||
void detachAllCurves();
|
||||
void cellFilterViewUpdated();
|
||||
|
||||
@ -99,7 +107,9 @@ public:
|
||||
QString timeStepString() const;
|
||||
std::vector<QString> groupStrings() const;
|
||||
|
||||
void updateCurveNames(bool applyCaseName, bool applyAxisVariables, bool applyTimeStep, bool applyCategory);
|
||||
std::map<NameComponents, QString> nameComponents() const;
|
||||
|
||||
void updateCurveNames(size_t curveSetIndex, size_t curveSetCount);
|
||||
void updateLegend();
|
||||
bool groupingByCategoryResult() const;
|
||||
bool groupingEnabled() const;
|
||||
@ -128,7 +138,7 @@ private:
|
||||
caf::PdmPtrField<RimCase*> m_case;
|
||||
caf::PdmField<int> m_timeStep;
|
||||
caf::PdmPtrField<RimGridView*> m_cellFilterView;
|
||||
caf::PdmField<CurveGroupingEnum> m_grouping;
|
||||
caf::PdmField<CurveGroupingEnum> m_grouping;
|
||||
caf::PdmChildField<RimEclipseResultDefinition*> m_xAxisProperty;
|
||||
caf::PdmChildField<RimEclipseResultDefinition*> m_yAxisProperty;
|
||||
caf::PdmChildField<RimEclipseCellColors*> m_groupingProperty;
|
||||
|
@ -119,7 +119,7 @@ void RiuGridCrossQwtPlot::updateLegendLayout()
|
||||
{
|
||||
RiuCvfOverlayItemWidget* overlayWidget = pairIt->second;
|
||||
// Show only one copy of each legend type
|
||||
if (!legendTypes.count(curveSet->groupTitle()))
|
||||
if (!legendTypes.count(curveSet->groupParameter()))
|
||||
{
|
||||
if (ypos + overlayWidget->height() + spacing > this->canvas()->height())
|
||||
{
|
||||
@ -133,7 +133,7 @@ void RiuGridCrossQwtPlot::updateLegendLayout()
|
||||
|
||||
ypos += pairIt->second->height() + spacing;
|
||||
maxColumnWidth = std::max(maxColumnWidth, pairIt->second->width());
|
||||
legendTypes.insert(curveSet->groupTitle());
|
||||
legendTypes.insert(curveSet->groupParameter());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user