mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Adjustments related to cross plot curves
* Verify vector size only for cross plot regression curves * Add filtering on axis orientation Makes it possible to show only horizontal or vertical axes when selecting an axis to attach a curve to. * Send curvesChanged signal to trigger multi plot updates This signal will trigger update of axes and set correct scaling factor * Use object name for axis object * Use address for both x and y axis to create ensemble curve name * Fix bug for drag/drop of ensemble object into plot * Add RiaSummaryCurveAddress to RiaSummaryCurveDefinition * Remove SummaryDataSource * Use childFieldChangedByUi to trigger update of curves and titles
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
#include "RiaSummaryCurveDefinition.h"
|
||||
#include "RiaStdStringTools.h"
|
||||
#include "RiaSummaryCurveAddress.h"
|
||||
|
||||
#include "RifSummaryReaderInterface.h"
|
||||
|
||||
@@ -66,6 +67,19 @@ RiaSummaryCurveDefinition::RiaSummaryCurveDefinition( RimSummaryCaseCollection*
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaSummaryCurveDefinition::RiaSummaryCurveDefinition( RimSummaryCaseCollection* ensemble, const RiaSummaryCurveAddress& summaryCurveAddress )
|
||||
: m_summaryCaseY( nullptr )
|
||||
, m_summaryAddressY( summaryCurveAddress.summaryAddressY() )
|
||||
, m_summaryCaseX( nullptr )
|
||||
, m_summaryAddressX( summaryCurveAddress.summaryAddressX() )
|
||||
, m_ensemble( ensemble )
|
||||
, m_isEnsembleCurve( true )
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -82,6 +96,14 @@ RimSummaryCaseCollection* RiaSummaryCurveDefinition::ensemble() const
|
||||
return m_ensemble;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaSummaryCurveDefinition::setEnsemble( RimSummaryCaseCollection* ensemble )
|
||||
{
|
||||
m_ensemble = ensemble;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -138,6 +160,14 @@ RifEclipseSummaryAddress RiaSummaryCurveDefinition::summaryAddressX() const
|
||||
return m_summaryAddressX;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaSummaryCurveAddress RiaSummaryCurveDefinition::summaryCurveAddress() const
|
||||
{
|
||||
return RiaSummaryCurveAddress( m_summaryAddressX, m_summaryAddressY );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
|
||||
class RimSummaryCase;
|
||||
class RimSummaryCaseCollection;
|
||||
class RiaSummaryCurveAddress;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@@ -40,13 +41,17 @@ public:
|
||||
RiaSummaryCurveDefinition();
|
||||
explicit RiaSummaryCurveDefinition( RimSummaryCase* summaryCaseY, const RifEclipseSummaryAddress& summaryAddressY, bool isEnsembleCurve );
|
||||
explicit RiaSummaryCurveDefinition( RimSummaryCaseCollection* ensemble, const RifEclipseSummaryAddress& summaryAddressY );
|
||||
explicit RiaSummaryCurveDefinition( RimSummaryCaseCollection* ensemble, const RiaSummaryCurveAddress& summaryCurveAddress );
|
||||
|
||||
// X and Y Axis
|
||||
RimSummaryCaseCollection* ensemble() const;
|
||||
void setEnsemble( RimSummaryCaseCollection* ensemble );
|
||||
|
||||
// Y Axis
|
||||
RimSummaryCase* summaryCaseY() const;
|
||||
RifEclipseSummaryAddress summaryAddressY() const;
|
||||
RimSummaryCaseCollection* ensemble() const;
|
||||
bool isEnsembleCurve() const;
|
||||
void setSummaryAddressY( const RifEclipseSummaryAddress& address );
|
||||
RimSummaryCase* summaryCaseY() const;
|
||||
RifEclipseSummaryAddress summaryAddressY() const;
|
||||
bool isEnsembleCurve() const;
|
||||
void setSummaryAddressY( const RifEclipseSummaryAddress& address );
|
||||
|
||||
// X Axis
|
||||
void setSummaryCaseX( RimSummaryCase* summaryCase );
|
||||
@@ -54,6 +59,8 @@ public:
|
||||
RimSummaryCase* summaryCaseX() const;
|
||||
RifEclipseSummaryAddress summaryAddressX() const;
|
||||
|
||||
RiaSummaryCurveAddress summaryCurveAddress() const;
|
||||
|
||||
void setIdentifierText( SummaryCategory category, const std::string& name );
|
||||
|
||||
bool operator<( const RiaSummaryCurveDefinition& other ) const;
|
||||
|
||||
@@ -50,6 +50,13 @@ public:
|
||||
NUMBER_FORMAT_SCIENTIFIC
|
||||
};
|
||||
|
||||
enum class Orientation
|
||||
{
|
||||
HORIZONTAL,
|
||||
VERTICAL,
|
||||
ANY
|
||||
};
|
||||
|
||||
public:
|
||||
caf::Signal<bool> logarithmicChanged;
|
||||
caf::Signal<RimPlotAxisProperties*, RiuPlotAxis, RiuPlotAxis> axisPositionChanged;
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
#include "RimSummaryCaseCollection.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryCurveAutoName.h"
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimTimeStepFilter.h"
|
||||
|
||||
@@ -147,11 +148,10 @@ RimEnsembleCurveSet::RimEnsembleCurveSet()
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_xAddressSelector, "XAddressSelector", "" );
|
||||
m_xAddressSelector = new RimSummaryAddressSelector;
|
||||
m_xAddressSelector->setAxisOrientation( RimPlotAxisProperties::Orientation::HORIZONTAL );
|
||||
m_xAddressSelector.uiCapability()->setUiTreeHidden( true );
|
||||
m_xAddressSelector.uiCapability()->setUiTreeChildrenHidden( true );
|
||||
|
||||
m_xAddressSelector->addressChanged.connect( this, &RimEnsembleCurveSet::onXAxisAddressChanged );
|
||||
|
||||
CAF_PDM_InitField( &m_colorMode, "ColorMode", caf::AppEnum<ColorMode>( ColorMode::SINGLE_COLOR_WITH_ALPHA ), "Coloring Mode" );
|
||||
|
||||
CAF_PDM_InitField( &m_colorForRealizations, "Color", RiaColorTools::textColor3f(), "Color" );
|
||||
@@ -203,7 +203,7 @@ RimEnsembleCurveSet::RimEnsembleCurveSet()
|
||||
CAF_PDM_InitFieldNoDefault( &m_plotAxis_OBSOLETE, "PlotAxis", "Axis" );
|
||||
m_plotAxis_OBSOLETE.xmlCapability()->setIOWritable( false );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_plotAxisProperties, "Axis", "Axis" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_yPlotAxisProperties, "Axis", "Axis" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_legendConfig, "LegendConfig", "" );
|
||||
m_legendConfig = new RimRegularLegendConfig();
|
||||
@@ -425,6 +425,15 @@ void RimEnsembleCurveSet::setCurveAddress( RiaSummaryCurveAddress address )
|
||||
{
|
||||
setSummaryAddress( address.summaryAddressY() );
|
||||
setSummaryAddressX( address.summaryAddressX() );
|
||||
|
||||
if ( address.summaryAddressX().category() == SummaryCategory::SUMMARY_TIME )
|
||||
{
|
||||
m_xAxisType = RiaDefines::HorizontalAxisType::TIME;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_xAxisType = RiaDefines::HorizontalAxisType::SUMMARY_VECTOR;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -564,6 +573,7 @@ void RimEnsembleCurveSet::onLegendDefinitionChanged()
|
||||
void RimEnsembleCurveSet::setSummaryCaseCollection( RimSummaryCaseCollection* sumCaseCollection )
|
||||
{
|
||||
m_yValuesSummaryCaseCollection = sumCaseCollection;
|
||||
m_xAddressSelector->setEnsemble( sumCaseCollection );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -853,7 +863,7 @@ void RimEnsembleCurveSet::fieldChangedByUi( const caf::PdmFieldHandle* changedFi
|
||||
updateCurveColors();
|
||||
updateTimeAnnotations();
|
||||
}
|
||||
else if ( changedField == &m_plotAxisProperties )
|
||||
else if ( changedField == &m_yPlotAxisProperties )
|
||||
{
|
||||
for ( RimSummaryCurve* curve : curves() )
|
||||
{
|
||||
@@ -987,6 +997,33 @@ void RimEnsembleCurveSet::defineObjectEditorAttribute( QString uiConfigName, caf
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEnsembleCurveSet::childFieldChangedByUi( const caf::PdmFieldHandle* changedChildField )
|
||||
{
|
||||
if ( changedChildField == &m_xAddressSelector )
|
||||
{
|
||||
updateAllCurves();
|
||||
|
||||
// The recommended way to trigger update in a parent object is by using caf::Signal. Here we need to update two parent classes, and
|
||||
// they are multiple levels away. To avoid a long signal path that is hard to debug, we use firstAncestorOrThisOfType()
|
||||
|
||||
auto summaryPlot = firstAncestorOrThisOfType<RimSummaryPlot>();
|
||||
if ( summaryPlot )
|
||||
{
|
||||
summaryPlot->updateAll();
|
||||
summaryPlot->zoomAll();
|
||||
}
|
||||
|
||||
auto multiPlot = firstAncestorOrThisOfType<RimSummaryMultiPlot>();
|
||||
if ( multiPlot )
|
||||
{
|
||||
multiPlot->updatePlotTitles();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1000,7 +1037,7 @@ void RimEnsembleCurveSet::defineUiOrdering( QString uiConfigName, caf::PdmUiOrde
|
||||
curveDataGroup->add( &m_yValuesSummaryAddressUiField );
|
||||
curveDataGroup->add( &m_yPushButtonSelectSummaryAddress, { false, 1, 0 } );
|
||||
curveDataGroup->add( &m_resampling );
|
||||
curveDataGroup->add( &m_plotAxisProperties );
|
||||
curveDataGroup->add( &m_yPlotAxisProperties );
|
||||
}
|
||||
|
||||
{
|
||||
@@ -1076,14 +1113,6 @@ void RimEnsembleCurveSet::onCustomObjectiveFunctionChanged( const caf::SignalEmi
|
||||
updateObjectiveFunctionLegend();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEnsembleCurveSet::onXAxisAddressChanged( const caf::SignalEmitter* emitter )
|
||||
{
|
||||
updateAllCurves();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1431,10 +1460,10 @@ QList<caf::PdmOptionItemInfo> RimEnsembleCurveSet::calculateValueOptions( const
|
||||
options.push_back( caf::PdmOptionItemInfo( name, objFunc ) );
|
||||
}
|
||||
}
|
||||
else if ( fieldNeedingOptions == &m_plotAxisProperties )
|
||||
else if ( fieldNeedingOptions == &m_yPlotAxisProperties )
|
||||
{
|
||||
auto plot = firstAncestorOrThisOfTypeAsserted<RimSummaryPlot>();
|
||||
for ( auto axis : plot->plotAxes() )
|
||||
for ( auto axis : plot->plotAxes( RimPlotAxisProperties::Orientation::VERTICAL ) )
|
||||
{
|
||||
options.push_back( caf::PdmOptionItemInfo( axis->objectName(), axis ) );
|
||||
}
|
||||
@@ -2331,9 +2360,7 @@ QString RimEnsembleCurveSet::createAutoName() const
|
||||
{
|
||||
auto plot = firstAncestorOrThisOfTypeAsserted<RimSummaryPlot>();
|
||||
|
||||
QString curveSetName = m_summaryAddressNameTools->curveName( RiaSummaryCurveAddress( m_yValuesSummaryAddress->address() ),
|
||||
plot->plotTitleHelper(),
|
||||
plot->plotTitleHelper() );
|
||||
QString curveSetName = m_summaryAddressNameTools->curveName( curveAddress(), plot->plotTitleHelper(), plot->plotTitleHelper() );
|
||||
|
||||
if ( curveSetName.isEmpty() )
|
||||
{
|
||||
@@ -2391,19 +2418,30 @@ int statisticsCurveSymbolSize( RiuPlotCurveSymbol::PointSymbolEnum symbol )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuPlotAxis RimEnsembleCurveSet::axisY() const
|
||||
{
|
||||
if ( m_plotAxisProperties )
|
||||
return m_plotAxisProperties->plotAxis();
|
||||
if ( m_yPlotAxisProperties )
|
||||
return m_yPlotAxisProperties->plotAxis();
|
||||
else
|
||||
return RiuPlotAxis::defaultLeft();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuPlotAxis RimEnsembleCurveSet::axisX() const
|
||||
{
|
||||
if ( m_xAddressSelector->plotAxisProperties() )
|
||||
return m_xAddressSelector->plotAxisProperties()->plotAxis();
|
||||
else
|
||||
return RiuPlotAxis::defaultBottomForSummaryVectors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEnsembleCurveSet::setLeftOrRightAxisY( RiuPlotAxis plotAxis )
|
||||
{
|
||||
auto plot = firstAncestorOrThisOfTypeAsserted<RimSummaryPlot>();
|
||||
m_plotAxisProperties = plot->axisPropertiesForPlotAxis( plotAxis );
|
||||
auto plot = firstAncestorOrThisOfTypeAsserted<RimSummaryPlot>();
|
||||
m_yPlotAxisProperties = plot->axisPropertiesForPlotAxis( plotAxis );
|
||||
|
||||
for ( RimSummaryCurve* curve : curves() )
|
||||
{
|
||||
@@ -2411,17 +2449,31 @@ void RimEnsembleCurveSet::setLeftOrRightAxisY( RiuPlotAxis plotAxis )
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEnsembleCurveSet::setBottomOrTopAxisX( RiuPlotAxis plotAxis )
|
||||
{
|
||||
auto plot = firstAncestorOrThisOfTypeAsserted<RimSummaryPlot>();
|
||||
m_xAddressSelector->setPlotAxisProperties( plot->axisPropertiesForPlotAxis( plotAxis ) );
|
||||
|
||||
for ( RimSummaryCurve* curve : curves() )
|
||||
{
|
||||
curve->setTopOrBottomAxisX( axisX() );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEnsembleCurveSet::initAfterRead()
|
||||
{
|
||||
if ( m_plotAxisProperties.value() == nullptr )
|
||||
if ( m_yPlotAxisProperties.value() == nullptr )
|
||||
{
|
||||
auto plot = firstAncestorOrThisOfType<RimSummaryPlot>();
|
||||
if ( plot )
|
||||
{
|
||||
m_plotAxisProperties = plot->axisPropertiesForPlotAxis( RiuPlotAxis( m_plotAxis_OBSOLETE() ) );
|
||||
m_yPlotAxisProperties = plot->axisPropertiesForPlotAxis( RiuPlotAxis( m_plotAxis_OBSOLETE() ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,7 +180,9 @@ public:
|
||||
std::vector<cvf::Color3f> generateColorsForCases( const std::vector<RimSummaryCase*>& summaryCases ) const;
|
||||
|
||||
RiuPlotAxis axisY() const;
|
||||
RiuPlotAxis axisX() const;
|
||||
void setLeftOrRightAxisY( RiuPlotAxis plotAxis );
|
||||
void setBottomOrTopAxisX( RiuPlotAxis plotAxis );
|
||||
|
||||
protected:
|
||||
void initAfterRead() override;
|
||||
@@ -204,6 +206,7 @@ private:
|
||||
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
void defineObjectEditorAttribute( QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
|
||||
void childFieldChangedByUi( const caf::PdmFieldHandle* changedChildField ) override;
|
||||
|
||||
void updatePlotAxis();
|
||||
|
||||
@@ -219,7 +222,6 @@ private:
|
||||
|
||||
void onObjectiveFunctionChanged( const caf::SignalEmitter* emitter );
|
||||
void onCustomObjectiveFunctionChanged( const caf::SignalEmitter* emitter );
|
||||
void onXAxisAddressChanged( const caf::SignalEmitter* emitter );
|
||||
|
||||
void setTransparentCurveColor();
|
||||
void onColorTagClicked( const SignalEmitter* emitter, size_t index );
|
||||
@@ -261,7 +263,7 @@ private:
|
||||
caf::PdmField<std::vector<QDateTime>> m_selectedTimeSteps;
|
||||
|
||||
caf::PdmField<caf::AppEnum<RiaDefines::PlotAxis>> m_plotAxis_OBSOLETE;
|
||||
caf::PdmPtrField<RimPlotAxisPropertiesInterface*> m_plotAxisProperties;
|
||||
caf::PdmPtrField<RimPlotAxisPropertiesInterface*> m_yPlotAxisProperties;
|
||||
|
||||
caf::PdmChildField<RimRegularLegendConfig*> m_legendConfig;
|
||||
caf::PdmChildField<RimEnsembleCurveFilterCollection*> m_curveFilters;
|
||||
|
||||
@@ -72,8 +72,8 @@ RimSummaryAddressSelector::RimSummaryAddressSelector()
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_resamplingPeriod, "Resampling", "Resampling" );
|
||||
|
||||
m_dataSource = SummaryDataSource::SINGLE_CASE;
|
||||
m_showDataSource = true;
|
||||
m_showDataSource = true;
|
||||
m_plotAxisOrientation = RimPlotAxisProperties::Orientation::ANY;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -82,7 +82,6 @@ RimSummaryAddressSelector::RimSummaryAddressSelector()
|
||||
void RimSummaryAddressSelector::setSummaryCase( RimSummaryCase* summaryCase )
|
||||
{
|
||||
m_summaryCase = summaryCase;
|
||||
m_dataSource = SummaryDataSource::SINGLE_CASE;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -91,7 +90,6 @@ void RimSummaryAddressSelector::setSummaryCase( RimSummaryCase* summaryCase )
|
||||
void RimSummaryAddressSelector::setEnsemble( RimSummaryCaseCollection* ensemble )
|
||||
{
|
||||
m_summaryCaseCollection = ensemble;
|
||||
m_dataSource = SummaryDataSource::ENSEMBLE;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -126,6 +124,14 @@ void RimSummaryAddressSelector::setShowDataSource( bool enable )
|
||||
m_showDataSource = enable;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryAddressSelector::setAxisOrientation( RimPlotAxisProperties::Orientation orientation )
|
||||
{
|
||||
m_plotAxisOrientation = orientation;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -175,16 +181,16 @@ void RimSummaryAddressSelector::fieldChangedByUi( const caf::PdmFieldHandle* cha
|
||||
{
|
||||
RiuSummaryVectorSelectionDialog dlg( nullptr );
|
||||
|
||||
if ( m_dataSource == SummaryDataSource::SINGLE_CASE )
|
||||
{
|
||||
dlg.hideEnsembles();
|
||||
dlg.setCaseAndAddress( m_summaryCase(), m_summaryAddress->address() );
|
||||
}
|
||||
else if ( m_dataSource == SummaryDataSource::ENSEMBLE )
|
||||
if ( isEnsemble() )
|
||||
{
|
||||
dlg.hideSummaryCases();
|
||||
dlg.setEnsembleAndAddress( m_summaryCaseCollection(), m_summaryAddress->address() );
|
||||
}
|
||||
else
|
||||
{
|
||||
dlg.hideEnsembles();
|
||||
dlg.setCaseAndAddress( m_summaryCase(), m_summaryAddress->address() );
|
||||
}
|
||||
|
||||
if ( dlg.exec() == QDialog::Accepted )
|
||||
{
|
||||
@@ -283,7 +289,11 @@ QList<caf::PdmOptionItemInfo> RimSummaryAddressSelector::calculateValueOptions(
|
||||
if ( fieldNeedingOptions == &m_summaryAddressUiField )
|
||||
{
|
||||
std::set<RifEclipseSummaryAddress> addresses;
|
||||
if ( m_dataSource == SummaryDataSource::SINGLE_CASE && m_summaryCase() )
|
||||
if ( isEnsemble() && m_summaryCaseCollection() )
|
||||
{
|
||||
addresses = m_summaryCaseCollection()->ensembleSummaryAddresses();
|
||||
}
|
||||
else if ( m_summaryCase() )
|
||||
{
|
||||
RifSummaryReaderInterface* reader = m_summaryCase()->summaryReader();
|
||||
if ( reader )
|
||||
@@ -291,10 +301,6 @@ QList<caf::PdmOptionItemInfo> RimSummaryAddressSelector::calculateValueOptions(
|
||||
addresses = reader->allResultAddresses();
|
||||
}
|
||||
}
|
||||
else if ( m_dataSource == SummaryDataSource::ENSEMBLE && m_summaryCaseCollection() )
|
||||
{
|
||||
addresses = m_summaryCaseCollection()->ensembleSummaryAddresses();
|
||||
}
|
||||
|
||||
return createOptionsForAddresses( addresses );
|
||||
}
|
||||
@@ -304,7 +310,7 @@ QList<caf::PdmOptionItemInfo> RimSummaryAddressSelector::calculateValueOptions(
|
||||
if ( auto plot = firstAncestorOrThisOfTypeAsserted<RimSummaryPlot>() )
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
for ( auto axis : plot->plotAxes() )
|
||||
for ( auto axis : plot->plotAxes( m_plotAxisOrientation ) )
|
||||
{
|
||||
options.push_back( caf::PdmOptionItemInfo( axis->objectName(), axis ) );
|
||||
}
|
||||
@@ -323,13 +329,13 @@ void RimSummaryAddressSelector::defineUiOrdering( QString uiConfigName, caf::Pdm
|
||||
{
|
||||
if ( m_showDataSource )
|
||||
{
|
||||
if ( m_dataSource == SummaryDataSource::SINGLE_CASE )
|
||||
if ( isEnsemble() )
|
||||
{
|
||||
uiOrdering.add( &m_summaryCase );
|
||||
uiOrdering.add( &m_summaryCaseCollection );
|
||||
}
|
||||
else
|
||||
{
|
||||
uiOrdering.add( &m_summaryCaseCollection );
|
||||
uiOrdering.add( &m_summaryCase );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -358,3 +364,11 @@ void RimSummaryAddressSelector::defineEditorAttribute( const caf::PdmFieldHandle
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSummaryAddressSelector::isEnsemble() const
|
||||
{
|
||||
return m_summaryCaseCollection() != nullptr;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#include "RifEclipseSummaryAddress.h"
|
||||
#include "RifEclipseSummaryAddressQMetaType.h"
|
||||
|
||||
#include "RimPlotAxisProperties.h"
|
||||
|
||||
#include "cafPdmChildField.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
@@ -38,12 +40,6 @@ class RimSummaryAddressSelector : public caf::PdmObject
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
enum class SummaryDataSource
|
||||
{
|
||||
SINGLE_CASE,
|
||||
ENSEMBLE
|
||||
};
|
||||
|
||||
caf::Signal<> addressChanged;
|
||||
|
||||
public:
|
||||
@@ -55,6 +51,7 @@ public:
|
||||
void setResamplingPeriod( RiaDefines::DateTimePeriodEnum resampling );
|
||||
void setPlotAxisProperties( RimPlotAxisPropertiesInterface* plotAxisProperties );
|
||||
void setShowDataSource( bool enable );
|
||||
void setAxisOrientation( RimPlotAxisProperties::Orientation orientation );
|
||||
|
||||
RimSummaryCase* summaryCase() const;
|
||||
RimSummaryCaseCollection* ensemble() const;
|
||||
@@ -68,6 +65,8 @@ private:
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
|
||||
|
||||
bool isEnsemble() const;
|
||||
|
||||
private:
|
||||
caf::PdmPtrField<RimSummaryCase*> m_summaryCase;
|
||||
caf::PdmPtrField<RimSummaryCaseCollection*> m_summaryCaseCollection;
|
||||
@@ -77,6 +76,7 @@ private:
|
||||
caf::PdmPtrField<RimPlotAxisPropertiesInterface*> m_plotAxisProperties;
|
||||
caf::PdmField<RiaDefines::DateTimePeriodEnum> m_resamplingPeriod;
|
||||
|
||||
SummaryDataSource m_dataSource;
|
||||
bool m_showDataSource;
|
||||
bool m_showDataSource;
|
||||
|
||||
RimPlotAxisProperties::Orientation m_plotAxisOrientation;
|
||||
};
|
||||
|
||||
@@ -551,20 +551,16 @@ QList<caf::PdmOptionItemInfo> RimSummaryCurve::calculateValueOptions( const caf:
|
||||
{
|
||||
auto plot = firstAncestorOrThisOfTypeAsserted<RimSummaryPlot>();
|
||||
|
||||
for ( auto axis : plot->plotAxes() )
|
||||
for ( auto axis : plot->plotAxes( RimPlotAxisProperties::Orientation::VERTICAL ) )
|
||||
{
|
||||
// TODO: Should we allow time axis to be used as Y axis?
|
||||
if ( dynamic_cast<RimPlotAxisProperties*>( axis ) )
|
||||
{
|
||||
options.push_back( caf::PdmOptionItemInfo( axis->objectName(), axis ) );
|
||||
}
|
||||
options.push_back( caf::PdmOptionItemInfo( axis->objectName(), axis ) );
|
||||
}
|
||||
}
|
||||
else if ( fieldNeedingOptions == &m_xPlotAxisProperties )
|
||||
{
|
||||
auto plot = firstAncestorOrThisOfTypeAsserted<RimSummaryPlot>();
|
||||
|
||||
for ( auto axis : plot->plotAxes() )
|
||||
for ( auto axis : plot->plotAxes( RimPlotAxisProperties::Orientation::HORIZONTAL ) )
|
||||
{
|
||||
options.push_back( caf::PdmOptionItemInfo( axis->objectName(), axis ) );
|
||||
}
|
||||
|
||||
@@ -864,7 +864,7 @@ void RimSummaryMultiPlot::syncAxisRanges()
|
||||
|
||||
for ( auto p : summaryPlots() )
|
||||
{
|
||||
for ( auto ax : p->plotYAxes() )
|
||||
for ( auto ax : p->plotAxes( RimPlotAxisProperties::Orientation::ANY ) )
|
||||
{
|
||||
ax->setAutoZoomIfNoCustomRangeIsSet();
|
||||
}
|
||||
@@ -878,7 +878,7 @@ void RimSummaryMultiPlot::syncAxisRanges()
|
||||
// gather current min/max values for each category (axis label)
|
||||
for ( auto plot : summaryPlots() )
|
||||
{
|
||||
for ( auto axis : plot->plotYAxes() )
|
||||
for ( auto axis : plot->plotAxes( RimPlotAxisProperties::Orientation::ANY ) )
|
||||
{
|
||||
double minVal = axis->visibleRangeMin();
|
||||
double maxVal = axis->visibleRangeMax();
|
||||
@@ -900,7 +900,7 @@ void RimSummaryMultiPlot::syncAxisRanges()
|
||||
// set all plots to use the global min/max values for each category
|
||||
for ( auto plot : summaryPlots() )
|
||||
{
|
||||
for ( auto axis : plot->plotYAxes() )
|
||||
for ( auto axis : plot->plotAxes( RimPlotAxisProperties::Orientation::ANY ) )
|
||||
{
|
||||
auto [minVal, maxVal] = axisRanges[axis->objectName()];
|
||||
if ( axis->isAxisInverted() ) std::swap( minVal, maxVal );
|
||||
@@ -1080,7 +1080,7 @@ void RimSummaryMultiPlot::computeAggregatedAxisRange()
|
||||
{
|
||||
std::map<RiuPlotAxis, std::pair<double, double>> axisRanges;
|
||||
|
||||
for ( auto axis : plot->plotYAxes() )
|
||||
for ( auto axis : plot->plotAxes( RimPlotAxisProperties::Orientation::ANY ) )
|
||||
{
|
||||
for ( auto curve : plot->summaryCurves() )
|
||||
{
|
||||
@@ -1146,7 +1146,7 @@ void RimSummaryMultiPlot::computeAggregatedAxisRange()
|
||||
}
|
||||
|
||||
// set all plots to use the global min/max values for each category
|
||||
for ( auto axis : plot->plotYAxes() )
|
||||
for ( auto axis : plot->plotAxes( RimPlotAxisProperties::Orientation::ANY ) )
|
||||
{
|
||||
auto [minVal, maxVal] = axisRanges[axis->plotAxis()];
|
||||
if ( RiaDefines::isVertical( axis->plotAxis().axis() ) && !std::isinf( minVal ) && !std::isinf( maxVal ) )
|
||||
@@ -1215,7 +1215,7 @@ void RimSummaryMultiPlot::setAutoValueStatesForPlot( RimSummaryPlot* summaryPlot
|
||||
auto timeAxisProp = summaryPlot->timeAxisProperties();
|
||||
if ( timeAxisProp ) timeAxisProp->enableAutoValueForMajorTickmarkCount( enableAutoValueAppearance );
|
||||
|
||||
for ( auto plotAxis : summaryPlot->plotYAxes() )
|
||||
for ( auto plotAxis : summaryPlot->plotAxes( RimPlotAxisProperties::Orientation::ANY ) )
|
||||
{
|
||||
plotAxis->enableAutoValueMinMax( enableAutoValueMinMax );
|
||||
plotAxis->enableAutoValueForMajorTickmarkCount( enableAutoValueAppearance );
|
||||
@@ -1281,10 +1281,8 @@ void RimSummaryMultiPlot::analyzePlotsAndAdjustAppearanceSettings()
|
||||
timeAxisProp->setAutoValueForMajorTickmarkCount( tickMarkCount, notifyFieldChanged );
|
||||
}
|
||||
|
||||
for ( auto* axisProp : p->plotYAxes() )
|
||||
for ( auto* axisProp : p->plotAxes( RimPlotAxisProperties::Orientation::ANY ) )
|
||||
{
|
||||
if ( !axisProp ) continue;
|
||||
|
||||
auto tickMarkCount = ( rowsPerPage() == 1 ) ? RimPlotAxisProperties::LegendTickmarkCount::TICKMARK_DEFAULT
|
||||
: RimPlotAxisProperties::LegendTickmarkCount::TICKMARK_FEW;
|
||||
|
||||
@@ -1314,10 +1312,8 @@ void RimSummaryMultiPlot::analyzePlotsAndAdjustAppearanceSettings()
|
||||
{
|
||||
for ( auto p : summaryPlots() )
|
||||
{
|
||||
for ( auto* axisProp : p->plotYAxes() )
|
||||
for ( auto* axisProp : p->plotAxes( RimPlotAxisProperties::Orientation::ANY ) )
|
||||
{
|
||||
if ( !axisProp ) continue;
|
||||
|
||||
axisProp->computeAndSetAutoValueForScaleFactor();
|
||||
axisProp->setShowUnitText( true );
|
||||
axisProp->setShowDescription( true );
|
||||
|
||||
@@ -49,7 +49,6 @@
|
||||
#include "RimGridTimeHistoryCurve.h"
|
||||
#include "RimMultiPlot.h"
|
||||
#include "RimPlotAxisLogRangeCalculator.h"
|
||||
#include "RimPlotAxisProperties.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryAddress.h"
|
||||
#include "RimSummaryAddressCollection.h"
|
||||
@@ -621,7 +620,7 @@ const RimSummaryNameHelper* RimSummaryPlot::plotTitleHelper() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::copyAxisPropertiesFromOther( const RimSummaryPlot& sourceSummaryPlot )
|
||||
{
|
||||
for ( auto ap : sourceSummaryPlot.plotAxes() )
|
||||
for ( auto ap : sourceSummaryPlot.allPlotAxes() )
|
||||
{
|
||||
QString data = ap->writeObjectToXmlString();
|
||||
|
||||
@@ -638,7 +637,7 @@ void RimSummaryPlot::copyAxisPropertiesFromOther( const RimSummaryPlot& sourceSu
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::copyAxisPropertiesFromOther( RiaDefines::PlotAxis plotAxisType, const RimSummaryPlot& sourceSummaryPlot )
|
||||
{
|
||||
for ( auto ap : sourceSummaryPlot.plotAxes() )
|
||||
for ( auto ap : sourceSummaryPlot.allPlotAxes() )
|
||||
{
|
||||
if ( ap->plotAxis().axis() != plotAxisType ) continue;
|
||||
|
||||
@@ -657,9 +656,9 @@ void RimSummaryPlot::copyAxisPropertiesFromOther( RiaDefines::PlotAxis plotAxisT
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::copyMatchingAxisPropertiesFromOther( const RimSummaryPlot& summaryPlot )
|
||||
{
|
||||
for ( auto apToCopy : summaryPlot.plotAxes() )
|
||||
for ( auto apToCopy : summaryPlot.allPlotAxes() )
|
||||
{
|
||||
for ( auto ap : plotAxes() )
|
||||
for ( auto ap : allPlotAxes() )
|
||||
{
|
||||
if ( ap->objectName().compare( apToCopy->objectName() ) == 0 )
|
||||
{
|
||||
@@ -925,18 +924,35 @@ void RimSummaryPlot::updateNumericalAxis( RiaDefines::PlotAxis plotAxis )
|
||||
std::vector<RiaSummaryCurveDefinition> curveDefs;
|
||||
for ( auto summaryCurve : summaryCurves() )
|
||||
{
|
||||
if ( summaryCurve->axisY() == riuPlotAxis || summaryCurve->axisX() == riuPlotAxis )
|
||||
if ( summaryCurve->axisY() == riuPlotAxis )
|
||||
{
|
||||
curveDefs.push_back( summaryCurve->curveDefinition() );
|
||||
curveDefs.push_back( RiaSummaryCurveDefinition( summaryCurve->summaryCaseY(),
|
||||
summaryCurve->summaryAddressY(),
|
||||
summaryCurve->isEnsembleCurve() ) );
|
||||
}
|
||||
if ( summaryCurve->axisX() == riuPlotAxis )
|
||||
{
|
||||
curveDefs.push_back( RiaSummaryCurveDefinition( summaryCurve->summaryCaseX(),
|
||||
summaryCurve->summaryAddressX(),
|
||||
summaryCurve->isEnsembleCurve() ) );
|
||||
}
|
||||
}
|
||||
|
||||
for ( auto curveSet : ensembleCurveSetCollection()->curveSets() )
|
||||
{
|
||||
if ( curveSet->axisY() != riuPlotAxis ) continue;
|
||||
if ( curveSet->axisY() == riuPlotAxis )
|
||||
{
|
||||
RiaSummaryCurveDefinition def( curveSet->summaryCaseCollection(), curveSet->summaryAddress() );
|
||||
curveDefs.push_back( def );
|
||||
}
|
||||
if ( curveSet->axisX() == riuPlotAxis )
|
||||
{
|
||||
RiaSummaryCurveDefinition def;
|
||||
def.setEnsemble( curveSet->summaryCaseCollection() );
|
||||
def.setSummaryAddressX( curveSet->curveAddress().summaryAddressX() );
|
||||
|
||||
RiaSummaryCurveDefinition def( curveSet->summaryCaseCollection(), curveSet->summaryAddress() );
|
||||
curveDefs.push_back( def );
|
||||
curveDefs.push_back( def );
|
||||
}
|
||||
}
|
||||
|
||||
RimSummaryPlotAxisFormatter calc( axisProps, {}, curveDefs, visibleAsciiDataCurvesForAxis( riuPlotAxis ), timeHistoryQuantities );
|
||||
@@ -2047,6 +2063,8 @@ void RimSummaryPlot::disconnectCurveSignals( RimSummaryCurve* curve )
|
||||
void RimSummaryPlot::curveDataChanged( const caf::SignalEmitter* emitter )
|
||||
{
|
||||
loadDataAndUpdate();
|
||||
|
||||
curvesChanged.send();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -2321,11 +2339,11 @@ RimSummaryPlot::CurveInfo RimSummaryPlot::handleEnsembleDrop( RimSummaryCaseColl
|
||||
int newCurves = 0;
|
||||
std::vector<RimEnsembleCurveSet*> curveSetsToUpdate;
|
||||
|
||||
std::map<RifEclipseSummaryAddress, std::set<RimSummaryCaseCollection*>> dataVectorMap;
|
||||
std::map<RiaSummaryCurveAddress, std::set<RimSummaryCaseCollection*>> dataVectorMap;
|
||||
|
||||
for ( auto& curve : curveSets() )
|
||||
{
|
||||
const auto addr = curve->summaryAddress();
|
||||
const auto addr = curve->curveAddress();
|
||||
dataVectorMap[addr].insert( curve->summaryCaseCollection() );
|
||||
}
|
||||
|
||||
@@ -2333,7 +2351,7 @@ RimSummaryPlot::CurveInfo RimSummaryPlot::handleEnsembleDrop( RimSummaryCaseColl
|
||||
{
|
||||
if ( ensembles.count( ensemble ) > 0 ) continue;
|
||||
|
||||
auto curveSet = addNewEnsembleCurveY( addr, ensemble );
|
||||
auto curveSet = addNewEnsembleCurve( addr, ensemble );
|
||||
curveSetsToUpdate.push_back( curveSet );
|
||||
newCurves++;
|
||||
}
|
||||
@@ -2364,14 +2382,14 @@ RimSummaryPlot::CurveInfo RimSummaryPlot::handleAddressCollectionDrop( RimSummar
|
||||
{
|
||||
sourceCurveDefs.push_back( curve->curveDefinition() );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ensembleCase )
|
||||
if ( ensembleCase )
|
||||
{
|
||||
auto curveSets = m_ensembleCurveSetCollection->curveSets();
|
||||
for ( auto curveSet : curveSets )
|
||||
{
|
||||
auto curveSets = m_ensembleCurveSetCollection->curveSets();
|
||||
for ( auto curveSet : curveSets )
|
||||
{
|
||||
sourceCurveDefs.push_back( RiaSummaryCurveDefinition( ensembleCase, curveSet->summaryAddress() ) );
|
||||
}
|
||||
sourceCurveDefs.push_back( RiaSummaryCurveDefinition( ensembleCase, curveSet->curveAddress() ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2435,7 +2453,7 @@ RimSummaryPlot::CurveInfo RimSummaryPlot::handleAddressCollectionDrop( RimSummar
|
||||
auto addresses = curveDef.ensemble()->ensembleSummaryAddresses();
|
||||
if ( addresses.find( curveDef.summaryAddressY() ) != addresses.end() )
|
||||
{
|
||||
curveSetsToUpdate.push_back( addNewEnsembleCurveY( curveDef.summaryAddressY(), curveDef.ensemble() ) );
|
||||
curveSetsToUpdate.push_back( addNewEnsembleCurve( curveDef.summaryCurveAddress(), curveDef.ensemble() ) );
|
||||
newCurves++;
|
||||
}
|
||||
}
|
||||
@@ -2505,7 +2523,8 @@ RimSummaryPlot::CurveInfo RimSummaryPlot::handleSummaryAddressDrop( RimSummaryAd
|
||||
|
||||
if ( !skipAddress )
|
||||
{
|
||||
curveSetsToUpdate.push_back( addNewEnsembleCurveY( droppedAddress, ensemble ) );
|
||||
curveSetsToUpdate.push_back(
|
||||
addNewEnsembleCurve( RiaSummaryCurveAddress( RifEclipseSummaryAddress::timeAddress(), droppedAddress ), ensemble ) );
|
||||
newCurves++;
|
||||
}
|
||||
}
|
||||
@@ -2627,12 +2646,13 @@ RimSummaryCurve* RimSummaryPlot::addNewCurve( const RifEclipseSummaryAddress& ad
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimEnsembleCurveSet* RimSummaryPlot::addNewEnsembleCurveY( const RifEclipseSummaryAddress& address, RimSummaryCaseCollection* ensemble )
|
||||
RimEnsembleCurveSet* RimSummaryPlot::addNewEnsembleCurve( const RiaSummaryCurveAddress& address, RimSummaryCaseCollection* ensemble )
|
||||
{
|
||||
auto* curveSet = new RimEnsembleCurveSet();
|
||||
|
||||
curveSet->setSummaryCaseCollection( ensemble );
|
||||
curveSet->setSummaryAddressAndStatisticsFlag( address );
|
||||
curveSet->setSummaryAddressAndStatisticsFlag( address.summaryAddressY() );
|
||||
curveSet->setCurveAddress( address );
|
||||
|
||||
cvf::Color3f curveColor =
|
||||
RimSummaryCurveAppearanceCalculator::computeTintedCurveColorForAddress( curveSet->summaryAddress(),
|
||||
@@ -2646,6 +2666,9 @@ RimEnsembleCurveSet* RimSummaryPlot::addNewEnsembleCurveY( const RifEclipseSumma
|
||||
|
||||
ensembleCurveSetCollection()->addCurveSet( curveSet );
|
||||
|
||||
curveSet->setLeftOrRightAxisY( RiuPlotAxis::defaultLeft() );
|
||||
curveSet->setBottomOrTopAxisX( RiuPlotAxis::defaultBottomForSummaryVectors() );
|
||||
|
||||
return curveSet;
|
||||
}
|
||||
|
||||
@@ -2659,7 +2682,7 @@ void RimSummaryPlot::onPlotZoomed()
|
||||
setAutoScaleYEnabled( false );
|
||||
|
||||
// Disable auto value for min/max fields
|
||||
for ( auto p : plotYAxes() )
|
||||
for ( auto p : plotAxes( RimPlotAxisProperties::Orientation::ANY ) )
|
||||
{
|
||||
p->enableAutoValueMinMax( false );
|
||||
}
|
||||
@@ -3106,27 +3129,29 @@ bool RimSummaryPlot::isDeletable() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimPlotAxisPropertiesInterface*> RimSummaryPlot::plotAxes() const
|
||||
std::vector<RimPlotAxisPropertiesInterface*> RimSummaryPlot::allPlotAxes() const
|
||||
{
|
||||
std::vector<RimPlotAxisPropertiesInterface*> axisProps;
|
||||
for ( const auto& ap : m_axisPropertiesArray )
|
||||
{
|
||||
axisProps.push_back( ap );
|
||||
}
|
||||
|
||||
return axisProps;
|
||||
return m_axisPropertiesArray.childrenByType();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimPlotAxisProperties*> RimSummaryPlot::plotYAxes() const
|
||||
std::vector<RimPlotAxisProperties*> RimSummaryPlot::plotAxes( RimPlotAxisProperties::Orientation orientation ) const
|
||||
{
|
||||
std::vector<RimPlotAxisProperties*> axisProps;
|
||||
for ( const auto& ap : m_axisPropertiesArray )
|
||||
{
|
||||
auto plotAxisProp = dynamic_cast<RimPlotAxisProperties*>( ap.p() );
|
||||
if ( plotAxisProp && plotAxisProp->plotAxis().isVertical() )
|
||||
if ( !plotAxisProp ) continue;
|
||||
|
||||
if ( ( orientation == RimPlotAxisProperties::Orientation::ANY ) ||
|
||||
( orientation == RimPlotAxisProperties::Orientation::VERTICAL && plotAxisProp->plotAxis().isVertical() ) )
|
||||
{
|
||||
axisProps.push_back( plotAxisProp );
|
||||
}
|
||||
else if ( ( orientation == RimPlotAxisProperties::Orientation::ANY ) ||
|
||||
( orientation == RimPlotAxisProperties::Orientation::HORIZONTAL && plotAxisProp->plotAxis().isHorizontal() ) )
|
||||
{
|
||||
axisProps.push_back( plotAxisProp );
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "RiaPlotDefines.h"
|
||||
|
||||
#include "RimPlot.h"
|
||||
#include "RimPlotAxisProperties.h"
|
||||
#include "RimSummaryDataSourceStepping.h"
|
||||
|
||||
#include "RiuQwtPlotWidget.h"
|
||||
@@ -61,6 +62,7 @@ class RimSummaryPlotSourceStepping;
|
||||
class RimTimeAxisAnnotation;
|
||||
class RiaSummaryCurveDefinition;
|
||||
class RifEclipseSummaryAddress;
|
||||
class RiaSummaryCurveAddress;
|
||||
|
||||
class QwtInterval;
|
||||
class QwtPlotCurve;
|
||||
@@ -201,8 +203,7 @@ public:
|
||||
std::vector<RimEnsembleCurveSet*> curveSets() const override;
|
||||
std::vector<RimSummaryCurve*> allCurves( RimSummaryDataSourceStepping::Axis axis ) const override;
|
||||
|
||||
std::vector<RimPlotAxisPropertiesInterface*> plotAxes() const;
|
||||
std::vector<RimPlotAxisProperties*> plotYAxes() const;
|
||||
std::vector<RimPlotAxisProperties*> plotAxes( RimPlotAxisProperties::Orientation orientation ) const;
|
||||
|
||||
RimPlotAxisPropertiesInterface* axisPropertiesForPlotAxis( RiuPlotAxis plotAxis ) const;
|
||||
RimPlotAxisProperties* addNewAxisProperties( RiaDefines::PlotAxis, const QString& name );
|
||||
@@ -293,6 +294,8 @@ private:
|
||||
RiuPlotAxis oldPlotAxis,
|
||||
RiuPlotAxis newPlotAxis );
|
||||
|
||||
std::vector<RimPlotAxisPropertiesInterface*> allPlotAxes() const;
|
||||
|
||||
void timeAxisSettingsChanged( const caf::SignalEmitter* emitter );
|
||||
void timeAxisSettingsChangedReloadRequired( const caf::SignalEmitter* emitter );
|
||||
|
||||
@@ -305,7 +308,7 @@ private:
|
||||
RimSummaryCase* summaryCase,
|
||||
const RifEclipseSummaryAddress& addressX,
|
||||
RimSummaryCase* summaryCaseX );
|
||||
RimEnsembleCurveSet* addNewEnsembleCurveY( const RifEclipseSummaryAddress& address, RimSummaryCaseCollection* ensemble );
|
||||
RimEnsembleCurveSet* addNewEnsembleCurve( const RiaSummaryCurveAddress& curveAddress, RimSummaryCaseCollection* ensemble );
|
||||
|
||||
void updateStackedCurveData();
|
||||
bool updateStackedCurveDataForAxis( RiuPlotAxis plotAxis );
|
||||
|
||||
@@ -131,7 +131,7 @@ void RimSummaryPlotAxisFormatter::applyAxisPropertiesToPlot( RiuPlotWidget* plot
|
||||
}
|
||||
|
||||
QString objectName = createAxisObjectName();
|
||||
m_axisProperties->setNameAndAxis( objectName + axisTitle, axisTitle, axis.axis(), axis.index() );
|
||||
m_axisProperties->setNameAndAxis( objectName, axisTitle, axis.axis(), axis.index() );
|
||||
plotWidget->setAxisTitleText( axis, axisTitle );
|
||||
|
||||
bool titleBold = false;
|
||||
|
||||
@@ -123,19 +123,19 @@ void RimSummaryRegressionAnalysisCurve::onLoadDataAndUpdate( bool updateParentPl
|
||||
auto timeStepsX = RimSummaryCurve::timeStepsX();
|
||||
auto timeStepsY = RimSummaryCurve::timeStepsY();
|
||||
|
||||
if ( xValues.size() != yValues.size() ) return RiaLogging::error( "X value count and Y value count differs." );
|
||||
if ( xValues.size() != timeStepsX.size() ) return RiaLogging::error( "X value count and X time step count differs." );
|
||||
if ( xValues.size() != timeStepsY.size() ) return RiaLogging::error( "X value count and Y time step count differs." );
|
||||
|
||||
if ( timeStepsX != timeStepsY )
|
||||
{
|
||||
return RiaLogging::error(
|
||||
"Differences in time steps for X and Y axis detected. This is currently not supported. Make sure that the same "
|
||||
"case is used for both axis." );
|
||||
}
|
||||
|
||||
if ( axisTypeX() == RiaDefines::HorizontalAxisType::SUMMARY_VECTOR )
|
||||
{
|
||||
if ( xValues.size() != yValues.size() ) return RiaLogging::error( "X value count and Y value count differs." );
|
||||
if ( xValues.size() != timeStepsX.size() ) return RiaLogging::error( "X value count and X time step count differs." );
|
||||
if ( xValues.size() != timeStepsY.size() ) return RiaLogging::error( "X value count and Y time step count differs." );
|
||||
|
||||
if ( timeStepsX != timeStepsY )
|
||||
{
|
||||
return RiaLogging::error(
|
||||
"Differences in time steps for X and Y axis detected. This is currently not supported. Make sure that the same "
|
||||
"case is used for both axis." );
|
||||
}
|
||||
|
||||
// NB! Assume that time stamps for X and Y are the same
|
||||
std::vector<size_t> indicesToRemove;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user