mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2895 Fix performance related to case name in plot tracking text
This commit is contained in:
parent
1b2f287579
commit
0d233e2568
@ -25,7 +25,7 @@
|
||||
#include "RimSummaryCurveFilter.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
|
||||
#include "RiuLineSegmentQwtPlotCurve.h"
|
||||
#include "RiuRimQwtPlotCurve.h"
|
||||
|
||||
#include "cafPdmUiComboBoxEditor.h"
|
||||
|
||||
@ -110,7 +110,7 @@ RimPlotCurve::RimPlotCurve()
|
||||
|
||||
CAF_PDM_InitField(&m_showLegend, "ShowLegend", true, "Contribute To Legend", "", "", "");
|
||||
|
||||
m_qwtPlotCurve = new RiuLineSegmentQwtPlotCurve;
|
||||
m_qwtPlotCurve = new RiuRimQwtPlotCurve(this);
|
||||
|
||||
m_parentQwtPlot = nullptr;
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RiuFemResultTextBuilder.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiuGeoQuestNavigation.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiuInterfaceToViewWindow.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiuLineSegmentQwtPlotCurve.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiuRimQwtPlotCurve.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiuPlotMainWindow.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiuMainWindow.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiuMainWindowBase.h
|
||||
@ -80,6 +81,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RiuFemResultTextBuilder.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiuGeoQuestNavigation.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiuInterfaceToViewWindow.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiuLineSegmentQwtPlotCurve.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiuRimQwtPlotCurve.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiuPlotMainWindow.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiuMainWindow.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiuMainWindowBase.cpp
|
||||
|
38
ApplicationCode/UserInterface/RiuRimQwtPlotCurve.cpp
Normal file
38
ApplicationCode/UserInterface/RiuRimQwtPlotCurve.cpp
Normal file
@ -0,0 +1,38 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018- 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RiuRimQwtPlotCurve.h"
|
||||
#include "RimPlotCurve.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuRimQwtPlotCurve::RiuRimQwtPlotCurve(RimPlotCurve* ownerRimCurve, const QString &title /*= QString::null*/)
|
||||
: RiuLineSegmentQwtPlotCurve(title)
|
||||
, m_ownerRimCurve(ownerRimCurve)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimPlotCurve * RiuRimQwtPlotCurve::ownerRimCurve()
|
||||
{
|
||||
return m_ownerRimCurve;
|
||||
}
|
36
ApplicationCode/UserInterface/RiuRimQwtPlotCurve.h
Normal file
36
ApplicationCode/UserInterface/RiuRimQwtPlotCurve.h
Normal file
@ -0,0 +1,36 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018- 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 "RiuLineSegmentQwtPlotCurve.h"
|
||||
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
class RimPlotCurve;
|
||||
|
||||
class RiuRimQwtPlotCurve: public RiuLineSegmentQwtPlotCurve
|
||||
{
|
||||
public:
|
||||
explicit RiuRimQwtPlotCurve(RimPlotCurve* ownerRimCurve, const QString &title = QString::null);
|
||||
|
||||
RimPlotCurve * ownerRimCurve();
|
||||
|
||||
private:
|
||||
caf::PdmPointer<RimPlotCurve> m_ownerRimCurve;
|
||||
};
|
||||
|
@ -60,6 +60,8 @@
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RiuRimQwtPlotCurve.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
|
||||
#include <float.h>
|
||||
|
||||
@ -75,23 +77,11 @@ public:
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
virtual QString curveInfoText(QwtPlotCurve* curve) override
|
||||
{
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
RiuRimQwtPlotCurve* riuCurve = dynamic_cast<RiuRimQwtPlotCurve*>(curve);
|
||||
RimSummaryCurve* sumCurve = nullptr;
|
||||
|
||||
// Lookup RimSummaryCurve from QwtPlotCurve
|
||||
for (auto const plot : project->mainPlotCollection->summaryPlotCollection()->summaryPlots())
|
||||
if (riuCurve)
|
||||
{
|
||||
for (auto const curveSet : plot->ensembleCurveSetCollection()->curveSets())
|
||||
{
|
||||
for (auto const currSumCurve : curveSet->curves())
|
||||
{
|
||||
if (currSumCurve->qwtPlotCurve() == curve)
|
||||
{
|
||||
sumCurve = currSumCurve;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
sumCurve = dynamic_cast<RimSummaryCurve*>(riuCurve->ownerRimCurve());
|
||||
}
|
||||
|
||||
return sumCurve && sumCurve->summaryCaseY() ? sumCurve->summaryCaseY()->caseName() : "";
|
||||
|
Loading…
Reference in New Issue
Block a user