#1967 Curve Calculator : Add RiaSummaryCurveDefinition

This commit is contained in:
Magne Sjaastad 2017-10-11 19:46:52 +02:00
parent 5cd7ffc75e
commit ae915a7898
3 changed files with 101 additions and 0 deletions

View File

@ -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

View File

@ -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 <http://www.gnu.org/licenses/gpl.html>
// 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());
}

View File

@ -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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RifEclipseSummaryAddress.h"
#include <utility>
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<RimSummaryCase*, RifEclipseSummaryAddress> m_curveDefinition;
};