diff --git a/ApplicationCode/Application/CMakeLists_files.cmake b/ApplicationCode/Application/CMakeLists_files.cmake index 9274ba491c..775405cd0e 100644 --- a/ApplicationCode/Application/CMakeLists_files.cmake +++ b/ApplicationCode/Application/CMakeLists_files.cmake @@ -9,6 +9,7 @@ ${CEE_CURRENT_LIST_DIR}RiaApplication.h ${CEE_CURRENT_LIST_DIR}RiaDefines.h ${CEE_CURRENT_LIST_DIR}RiaPreferences.h ${CEE_CURRENT_LIST_DIR}RiaPorosityModel.h +${CEE_CURRENT_LIST_DIR}RiaSummaryCurveDefinition.h ) set (SOURCE_GROUP_SOURCE_FILES @@ -17,6 +18,7 @@ ${CEE_CURRENT_LIST_DIR}RiaDefines.cpp ${CEE_CURRENT_LIST_DIR}RiaMain.cpp ${CEE_CURRENT_LIST_DIR}RiaPreferences.cpp ${CEE_CURRENT_LIST_DIR}RiaPorosityModel.cpp +${CEE_CURRENT_LIST_DIR}RiaSummaryCurveDefinition.cpp ) list(APPEND CODE_HEADER_FILES diff --git a/ApplicationCode/Application/RiaSummaryCurveDefinition.cpp b/ApplicationCode/Application/RiaSummaryCurveDefinition.cpp new file mode 100644 index 0000000000..b94f6066b5 --- /dev/null +++ b/ApplicationCode/Application/RiaSummaryCurveDefinition.cpp @@ -0,0 +1,57 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// 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 "RiaSummaryCurveDefinition.h" + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RiaSummaryCurveDefinition::RiaSummaryCurveDefinition(RimSummaryCase* summaryCase, const RifEclipseSummaryAddress& summaryAddress) +{ + m_curveDefinition = std::make_pair(summaryCase, summaryAddress); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimSummaryCase* RiaSummaryCurveDefinition::summaryCase() const +{ + return m_curveDefinition.first; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const RifEclipseSummaryAddress& RiaSummaryCurveDefinition::summaryAddress() const +{ + return m_curveDefinition.second; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RiaSummaryCurveDefinition::operator<(const RiaSummaryCurveDefinition& other) const +{ + if (m_curveDefinition.first == other.summaryCase()) + { + return (m_curveDefinition.second < other.summaryAddress()); + } + + return (m_curveDefinition.first < other.summaryCase()); +} + diff --git a/ApplicationCode/Application/RiaSummaryCurveDefinition.h b/ApplicationCode/Application/RiaSummaryCurveDefinition.h new file mode 100644 index 0000000000..5e81022c41 --- /dev/null +++ b/ApplicationCode/Application/RiaSummaryCurveDefinition.h @@ -0,0 +1,42 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// 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 "RifEclipseSummaryAddress.h" + +#include + +class RimSummaryCase; + +//================================================================================================== +/// +//================================================================================================== +class RiaSummaryCurveDefinition +{ +public: + explicit RiaSummaryCurveDefinition(RimSummaryCase* summaryCase, const RifEclipseSummaryAddress& summaryAddress); + + RimSummaryCase* summaryCase() const; + const RifEclipseSummaryAddress& summaryAddress() const; + + bool operator < (const RiaSummaryCurveDefinition& other) const; + +private: + std::pair m_curveDefinition; +};