mirror of
https://github.com/OPM/ResInsight.git
synced 2026-11-30 17:42:13 -06:00
Summary Plot: Add support for multiple plot axis.
This commit is contained in:
1 parent
a3ad9d2c1e
commit
e92e2e8764
54 files changed
+1222
-828
No files matched your search
@@ -0,0 +1,120 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2022- 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 "RiuPlotAxis.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuPlotAxis::RiuPlotAxis()
|
||||
: m_axis( RiaDefines::PlotAxis::PLOT_AXIS_LEFT )
|
||||
, m_index( 0 )
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuPlotAxis::RiuPlotAxis( RiaDefines::PlotAxis axis )
|
||||
: m_axis( axis )
|
||||
, m_index( 0 )
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuPlotAxis::RiuPlotAxis( RiaDefines::PlotAxis axis, int index )
|
||||
: m_axis( axis )
|
||||
, m_index( index )
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuPlotAxis::~RiuPlotAxis()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuPlotAxis RiuPlotAxis::defaultLeft()
|
||||
{
|
||||
return RiuPlotAxis( RiaDefines::PlotAxis::PLOT_AXIS_LEFT );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuPlotAxis RiuPlotAxis::defaultRight()
|
||||
{
|
||||
return RiuPlotAxis( RiaDefines::PlotAxis::PLOT_AXIS_RIGHT );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuPlotAxis RiuPlotAxis::defaultTop()
|
||||
{
|
||||
return RiuPlotAxis( RiaDefines::PlotAxis::PLOT_AXIS_TOP );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuPlotAxis RiuPlotAxis::defaultBottom()
|
||||
{
|
||||
return RiuPlotAxis( RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaDefines::PlotAxis RiuPlotAxis::axis() const
|
||||
{
|
||||
return m_axis;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RiuPlotAxis::index() const
|
||||
{
|
||||
return m_index;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiuPlotAxis::operator<( const RiuPlotAxis& rhs ) const
|
||||
{
|
||||
if ( m_axis != rhs.m_axis )
|
||||
return m_axis < rhs.m_axis;
|
||||
else
|
||||
return m_index < rhs.m_index;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiuPlotAxis::operator==( const RiuPlotAxis& rhs )
|
||||
{
|
||||
return m_axis == rhs.m_axis && m_index == rhs.m_index;
|
||||
}
|
||||
Reference in new issue
Block a user