From 1376727386c3bac2afed1296a144fd330d2941b9 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Tue, 14 Nov 2017 12:50:21 +0100 Subject: [PATCH] #2092 Cross Plot : Add RimSummaryCrossPlot --- .../Summary/CMakeLists_files.cmake | 2 ++ .../Summary/RimSummaryCrossPlot.cpp | 33 +++++++++++++++++ .../Summary/RimSummaryCrossPlot.h | 35 +++++++++++++++++++ .../Summary/RimSummaryCrossPlotCollection.cpp | 4 +-- .../Summary/RimSummaryPlot.cpp | 7 ++-- .../ProjectDataModel/Summary/RimSummaryPlot.h | 6 ++-- 6 files changed, 78 insertions(+), 9 deletions(-) create mode 100644 ApplicationCode/ProjectDataModel/Summary/RimSummaryCrossPlot.cpp create mode 100644 ApplicationCode/ProjectDataModel/Summary/RimSummaryCrossPlot.h diff --git a/ApplicationCode/ProjectDataModel/Summary/CMakeLists_files.cmake b/ApplicationCode/ProjectDataModel/Summary/CMakeLists_files.cmake index 0ac2b102b4..9bfcbe738c 100644 --- a/ApplicationCode/ProjectDataModel/Summary/CMakeLists_files.cmake +++ b/ApplicationCode/ProjectDataModel/Summary/CMakeLists_files.cmake @@ -30,6 +30,7 @@ ${CEE_CURRENT_LIST_DIR}RimObservedEclipseUserData.h ${CEE_CURRENT_LIST_DIR}RimCalculatedSummaryCase.h ${CEE_CURRENT_LIST_DIR}RimCalculatedSummaryCurveReader.h ${CEE_CURRENT_LIST_DIR}RimSummaryAddress.h +${CEE_CURRENT_LIST_DIR}RimSummaryCrossPlot.h ) set (SOURCE_GROUP_SOURCE_FILES @@ -58,6 +59,7 @@ ${CEE_CURRENT_LIST_DIR}RimObservedEclipseUserData.cpp ${CEE_CURRENT_LIST_DIR}RimCalculatedSummaryCase.cpp ${CEE_CURRENT_LIST_DIR}RimCalculatedSummaryCurveReader.cpp ${CEE_CURRENT_LIST_DIR}RimSummaryAddress.cpp +${CEE_CURRENT_LIST_DIR}RimSummaryCrossPlot.cpp ) list(APPEND CODE_HEADER_FILES diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCrossPlot.cpp b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCrossPlot.cpp new file mode 100644 index 0000000000..3ace690695 --- /dev/null +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCrossPlot.cpp @@ -0,0 +1,33 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimSummaryCrossPlot.h" + + +CAF_PDM_SOURCE_INIT(RimSummaryCrossPlot, "SummaryCrossPlot"); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimSummaryCrossPlot::RimSummaryCrossPlot() +{ + CAF_PDM_InitObject("Summary Cross Plot", ":/SummaryPlotLight16x16.png", "", ""); + + setAsCrossPlot(); +} + diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCrossPlot.h b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCrossPlot.h new file mode 100644 index 0000000000..9076af6cb7 --- /dev/null +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCrossPlot.h @@ -0,0 +1,35 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + + +#pragma once + +#include "RimSummaryPlot.h" + + +//================================================================================================== +/// +/// +//================================================================================================== +class RimSummaryCrossPlot : public RimSummaryPlot +{ + CAF_PDM_HEADER_INIT; + +public: + RimSummaryCrossPlot(); +}; diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCrossPlotCollection.cpp b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCrossPlotCollection.cpp index 315fb53f22..0f7bc2e8a9 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCrossPlotCollection.cpp +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCrossPlotCollection.cpp @@ -19,6 +19,7 @@ #include "RimSummaryCrossPlotCollection.h" #include "RimSummaryPlot.h" +#include "RimSummaryCrossPlot.h" CAF_PDM_SOURCE_INIT(RimSummaryCrossPlotCollection, "SummaryCrossPlotCollection"); @@ -87,11 +88,10 @@ void RimSummaryCrossPlotCollection::summaryPlotItemInfos(QListsetDescription(QString("Summary Cross Plot %1").arg(m_summaryCrossPlots.size())); - plot->setAsCrossPlot(); return plot; } diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.cpp b/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.cpp index c5609233ff..3aed00d0a4 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.cpp @@ -105,10 +105,9 @@ RimSummaryPlot::RimSummaryPlot() CAF_PDM_InitField(&m_isAutoZoom, "AutoZoom", true, "Auto Zoom", "", "", ""); m_isAutoZoom.uiCapability()->setUiHidden(true); - CAF_PDM_InitField(&m_isCrossPlot, "IsCrossPlot", false, "Cross Plot", "", "", ""); - m_isCrossPlot.uiCapability()->setUiHidden(true); - setAsPlotMdiWindow(); + + m_isCrossPlot = false; } //-------------------------------------------------------------------------------------------------- @@ -1018,7 +1017,7 @@ void RimSummaryPlot::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering { caf::PdmUiTreeOrdering* axisFolder = uiTreeOrdering.add("Axes", ":/Axes16x16.png"); - if (!m_isCrossPlot()) + if (!m_isCrossPlot) { axisFolder->add(&m_timeAxisProperties); } diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.h b/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.h index cdee6f762b..74f58e3bf7 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.h +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.h @@ -56,8 +56,6 @@ public: QString description() const; void setShowDescription(bool showDescription); - void setAsCrossPlot(); - void addCurveAndUpdate(RimSummaryCurve* curve); void addCurveNoUpdate(RimSummaryCurve* curve); @@ -122,6 +120,8 @@ protected: virtual QImage snapshotWindowContent() override; + void setAsCrossPlot(); + private: std::vector visibleSummaryCurvesForAxis(RiaDefines::PlotAxis plotAxis) const; std::vector visibleTimeHistoryCurvesForAxis(RiaDefines::PlotAxis plotAxis) const; @@ -156,5 +156,5 @@ private: caf::PdmChildArrayField m_summaryCurves_OBSOLETE; caf::PdmChildArrayField m_curveFilters_OBSOLETE; - caf::PdmField m_isCrossPlot; + bool m_isCrossPlot; };