Adjustments for release

* Add notification of parent object when multiple objects are updated

* Make sure unchecked curves are removed from track

* Use object names instead of "Sub Items" when possible

* Set default simulation well visualization to top of reservoir

* Show plot window after plot is created

* Allow setting plot rendering flags

* Add more plots for update when clicking in 3D view

* Seismic Difference: Fix typo for poly line data extraction

* Version RC_5
This commit is contained in:
Magne Sjaastad 2023-06-16 09:27:35 +02:00 committed by GitHub
parent 36811e7f94
commit 06b5c9afbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 184 additions and 32 deletions

View File

@ -26,6 +26,8 @@
#include "RimWellAllocationPlot.h" #include "RimWellAllocationPlot.h"
#include "RimWellDistributionPlotCollection.h" #include "RimWellDistributionPlotCollection.h"
#include "RiuPlotMainWindowTools.h"
#include "cafSelectionManager.h" #include "cafSelectionManager.h"
#include <QAction> #include <QAction>
@ -77,9 +79,15 @@ void RicShowCumulativePhasePlotFeature::onActionTriggered( bool isChecked )
RimWellDistributionPlotCollection* wdp = flowPlotColl->wellDistributionPlotCollection(); RimWellDistributionPlotCollection* wdp = flowPlotColl->wellDistributionPlotCollection();
if ( wdp && eclipseResultCase ) if ( wdp && eclipseResultCase )
{ {
RiuPlotMainWindowTools::showPlotMainWindow();
wdp->setData( eclipseResultCase, wellName, timeStep ); wdp->setData( eclipseResultCase, wellName, timeStep );
wdp->setShowWindow( true ); wdp->setShowWindow( true );
wdp->loadDataAndUpdate(); wdp->loadDataAndUpdate();
wdp->updateConnectedEditors();
RiuPlotMainWindowTools::onObjectAppended( wdp );
} }
} }

View File

@ -50,8 +50,8 @@ void RicToggleItemsFeature::setupActionLook( QAction* actionToSetup )
{ {
if ( RicToggleItemsFeatureImpl::isToggleCommandsForSubItems() ) if ( RicToggleItemsFeatureImpl::isToggleCommandsForSubItems() )
{ {
QString objectName = "Sub Items"; QString objectName = "Sub Items";
auto collectionName = RicToggleItemsFeatureImpl::findCollectionName( RicToggleItemsFeatureImpl::SelectionToggleType::TOGGLE ); auto collectionName = RicToggleItemsFeatureImpl::findCollectionName( RicToggleItemsFeatureImpl::SelectionToggleType::TOGGLE_SUBITEMS );
if ( !collectionName.isEmpty() ) objectName = collectionName; if ( !collectionName.isEmpty() ) objectName = collectionName;
actionToSetup->setText( "Toggle " + objectName ); actionToSetup->setText( "Toggle " + objectName );

View File

@ -148,6 +148,18 @@ void RicToggleItemsFeatureImpl::setObjectToggleStateForSelection( SelectionToggl
field->setValue( value ); field->setValue( value );
} }
} }
// If multiple fields are updated, we call onChildrenUpdated() on the owner of the first field
// Example: Trigger replot of curves when multiple curves are toggled
if ( fieldsToUpdate.size() > 1 )
{
auto [ownerOfChildArrayField, childArrayFieldHandle] = RicToggleItemsFeatureImpl::findOwnerAndChildArrayField( fieldsToUpdate.front() );
if ( ownerOfChildArrayField && childArrayFieldHandle )
{
std::vector<caf::PdmObjectHandle*> objs;
ownerOfChildArrayField->onChildrenUpdated( childArrayFieldHandle, objs );
}
}
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -178,7 +190,7 @@ QString RicToggleItemsFeatureImpl::findCollectionName( SelectionToggleType state
auto arrayField = dynamic_cast<caf::PdmChildArrayFieldHandle*>( childObj->parentField() ); auto arrayField = dynamic_cast<caf::PdmChildArrayFieldHandle*>( childObj->parentField() );
if ( arrayField && arrayField->ownerObject() ) if ( arrayField && arrayField->ownerObject() )
{ {
return arrayField->ownerObject()->uiCapability()->uiName(); return arrayField->uiCapability()->uiName();
} }
} }
} }
@ -310,3 +322,43 @@ std::vector<caf::PdmField<bool>*> RicToggleItemsFeatureImpl::findToggleFieldsFro
return fields; return fields;
} }
//--------------------------------------------------------------------------------------------------
/// Based on code in CmdUiCommandSystemImpl::fieldChangedCommand()
/// Could be merged and put into a tool class
//--------------------------------------------------------------------------------------------------
std::pair<caf::PdmObjectHandle*, caf::PdmChildArrayFieldHandle*>
RicToggleItemsFeatureImpl::findOwnerAndChildArrayField( caf::PdmFieldHandle* fieldHandle )
{
if ( !fieldHandle ) return {};
caf::PdmChildArrayFieldHandle* childArrayFieldHandle = nullptr;
caf::PdmObjectHandle* ownerOfChildArrayField = nullptr;
// Find the first childArrayField by traversing parent field and objects. Usually, the childArrayField is
// the parent, but in some cases when we change fields in a sub-object of the object we need to traverse
// more levels
ownerOfChildArrayField = fieldHandle->ownerObject();
while ( ownerOfChildArrayField )
{
if ( ownerOfChildArrayField->parentField() )
{
childArrayFieldHandle = dynamic_cast<caf::PdmChildArrayFieldHandle*>( ownerOfChildArrayField->parentField() );
ownerOfChildArrayField = ownerOfChildArrayField->parentField()->ownerObject();
if ( childArrayFieldHandle && ownerOfChildArrayField ) break;
}
else
{
ownerOfChildArrayField = nullptr;
}
}
if ( ownerOfChildArrayField && childArrayFieldHandle )
{
return { ownerOfChildArrayField, childArrayFieldHandle };
}
return {};
}

View File

@ -28,6 +28,7 @@ namespace caf
class PdmUiItem; class PdmUiItem;
class PdmUiTreeOrdering; class PdmUiTreeOrdering;
class PdmUiTreeView; class PdmUiTreeView;
class PdmChildArrayFieldHandle;
}; // namespace caf }; // namespace caf
//================================================================================================== //==================================================================================================
@ -55,4 +56,6 @@ private:
static caf::PdmUiTreeView* findTreeView( const caf::PdmUiItem* uiItem ); static caf::PdmUiTreeView* findTreeView( const caf::PdmUiItem* uiItem );
static caf::PdmUiTreeOrdering* findTreeItemFromSelectedUiItem( const caf::PdmUiItem* uiItem ); static caf::PdmUiTreeOrdering* findTreeItemFromSelectedUiItem( const caf::PdmUiItem* uiItem );
static std::vector<caf::PdmField<bool>*> findToggleFieldsFromSelection( SelectionToggleType state ); static std::vector<caf::PdmField<bool>*> findToggleFieldsFromSelection( SelectionToggleType state );
static std::pair<caf::PdmObjectHandle*, caf::PdmChildArrayFieldHandle*> findOwnerAndChildArrayField( caf::PdmFieldHandle* fieldHandle );
}; };

View File

@ -220,7 +220,7 @@ bool RicWellPathPickEventHandler::handle3dPickEvent( const Ric3dPickEvent& event
RiuMainWindow::instance()->setResultInfo( wellPathText ); RiuMainWindow::instance()->setResultInfo( wellPathText );
RiuPlotMainWindow::onWellSelected( wellPathSourceInfo->wellPath()->name() ); RiuPlotMainWindow::onWellSelected( wellPathSourceInfo->wellPath()->name(), rimView->currentTimeStep() );
if ( objectToSelect ) if ( objectToSelect )
{ {

View File

@ -170,6 +170,15 @@ void RimWellAllocationOverTimePlot::setFromSimulationWell( RimSimWellInView* sim
onLoadDataAndUpdate(); onLoadDataAndUpdate();
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellAllocationOverTimePlot::setWellName( const QString& wellName )
{
m_wellName = wellName;
onLoadDataAndUpdate();
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -68,6 +68,7 @@ public:
void setDescription( const QString& description ); void setDescription( const QString& description );
void setFromSimulationWell( RimSimWellInView* simWell ); void setFromSimulationWell( RimSimWellInView* simWell );
void setWellName( const QString& wellName );
// RimPlot implementations // RimPlot implementations
RiuPlotWidget* plotWidget() override; RiuPlotWidget* plotWidget() override;

View File

@ -185,6 +185,26 @@ void RimWellAllocationPlot::setFromSimulationWell( RimSimWellInView* simWell )
onLoadDataAndUpdate(); onLoadDataAndUpdate();
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellAllocationPlot::setWellName( const QString& wellName )
{
m_wellName = wellName;
onLoadDataAndUpdate();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellAllocationPlot::setTimeStep( int timeStep )
{
if ( timeStep < 0 ) return;
m_timeStep = timeStep;
onLoadDataAndUpdate();
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -68,6 +68,8 @@ public:
int id() const final; int id() const final;
void setFromSimulationWell( RimSimWellInView* simWell ); void setFromSimulationWell( RimSimWellInView* simWell );
void setWellName( const QString& wellName );
void setTimeStep( int timeStep );
void setDescription( const QString& description ); void setDescription( const QString& description );
QString description() const; QString description() const;

View File

@ -150,13 +150,7 @@ void RimWellDistributionPlot::updateLegend()
return; return;
} }
// Hide the legend when in multiplot mode, as the legend is handeled by the multi plot grid layout bool doShowLegend = true;
bool doShowLegend = false;
if ( isMdiWindow() )
{
doShowLegend = m_showPlotLegends;
}
if ( doShowLegend ) if ( doShowLegend )
{ {
QwtLegend* legend = new QwtLegend( m_plotWidget ); QwtLegend* legend = new QwtLegend( m_plotWidget );
@ -315,14 +309,7 @@ void RimWellDistributionPlot::onLoadDataAndUpdate()
// cvf::Trace::show("RimWellDistributionPlot::onLoadDataAndUpdate()"); // cvf::Trace::show("RimWellDistributionPlot::onLoadDataAndUpdate()");
// cvf::DebugTimer tim("RimWellDistributionPlot::onLoadDataAndUpdate()"); // cvf::DebugTimer tim("RimWellDistributionPlot::onLoadDataAndUpdate()");
if ( isMdiWindow() ) updateParentLayout();
{
updateMdiWindowVisibility();
}
else
{
updateParentLayout();
}
if ( !m_plotWidget ) if ( !m_plotWidget )
{ {
@ -363,6 +350,7 @@ void RimWellDistributionPlot::onLoadDataAndUpdate()
const QString timeStepName = m_case ? m_case->timeStepName( m_timeStepIndex ) : "N/A"; const QString timeStepName = m_case ? m_case->timeStepName( m_timeStepIndex ) : "N/A";
const QString plotTitleStr = QString( "%1 Distribution: %2, %3" ).arg( phaseString ).arg( m_wellName ).arg( timeStepName ); const QString plotTitleStr = QString( "%1 Distribution: %2, %3" ).arg( phaseString ).arg( m_wellName ).arg( timeStepName );
m_plotWidget->setPlotTitleRenderingFlags( Qt::AlignHCenter | Qt::TextWordWrap );
m_plotWidget->setPlotTitle( plotTitleStr ); m_plotWidget->setPlotTitle( plotTitleStr );
m_plotWidget->setAxisTitleText( RiuPlotAxis::defaultBottom(), "TOF [years]" ); m_plotWidget->setAxisTitleText( RiuPlotAxis::defaultBottom(), "TOF [years]" );

View File

@ -110,6 +110,30 @@ void RimWellDistributionPlotCollection::setData( RimEclipseResultCase* eclipseCa
applyPlotParametersToContainedPlots(); applyPlotParametersToContainedPlots();
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellDistributionPlotCollection::setWellName( const QString& wellName )
{
m_wellName = wellName;
applyPlotParametersToContainedPlots();
loadDataAndUpdate();
if ( m_viewer ) m_viewer->scheduleUpdate();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellDistributionPlotCollection::setTimeStep( int timeStep )
{
if ( timeStep < 0 ) return;
m_timeStepIndex = timeStep;
applyPlotParametersToContainedPlots();
loadDataAndUpdate();
if ( m_viewer ) m_viewer->scheduleUpdate();
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -308,6 +332,11 @@ void RimWellDistributionPlotCollection::fieldChangedByUi( const caf::PdmFieldHan
{ {
applyPlotParametersToContainedPlots(); applyPlotParametersToContainedPlots();
shouldRecalculatePlotData = true; shouldRecalculatePlotData = true;
if ( changedField == &m_showOil || changedField == &m_showGas || changedField == &m_showWater || changedField == &m_showWindow )
{
if ( m_viewer ) m_viewer->scheduleUpdate();
}
} }
RimPlotWindow::fieldChangedByUi( changedField, oldValue, newValue ); RimPlotWindow::fieldChangedByUi( changedField, oldValue, newValue );

View File

@ -52,6 +52,8 @@ public:
~RimWellDistributionPlotCollection() override; ~RimWellDistributionPlotCollection() override;
void setData( RimEclipseResultCase* eclipseCase, QString wellName, int timeStepIndex ); void setData( RimEclipseResultCase* eclipseCase, QString wellName, int timeStepIndex );
void setWellName( const QString& wellName );
void setTimeStep( int timeStep );
QWidget* viewWidget() override; QWidget* viewWidget() override;
QString description() const override; QString description() const override;

View File

@ -154,7 +154,7 @@ RimDepthTrackPlot::RimDepthTrackPlot()
CAF_PDM_InitFieldNoDefault( &m_ensembleCurveSet, "FilterEnsembleCurveSet", "Filter by Ensemble Curve Set" ); CAF_PDM_InitFieldNoDefault( &m_ensembleCurveSet, "FilterEnsembleCurveSet", "Filter by Ensemble Curve Set" );
CAF_PDM_InitFieldNoDefault( &m_depthEqualization, "DepthEqualization", "Depth Equalization" ); CAF_PDM_InitFieldNoDefault( &m_depthEqualization, "DepthEqualization", "Depth Equalization" );
CAF_PDM_InitFieldNoDefault( &m_plots, "Tracks", "" ); CAF_PDM_InitFieldNoDefault( &m_plots, "Tracks", "Tracks" );
m_plots.uiCapability()->setUiTreeHidden( true ); m_plots.uiCapability()->setUiTreeHidden( true );
auto reorderability = caf::PdmFieldReorderCapability::addToField( &m_plots ); auto reorderability = caf::PdmFieldReorderCapability::addToField( &m_plots );
reorderability->orderChanged.connect( this, &RimDepthTrackPlot::onPlotsReordered ); reorderability->orderChanged.connect( this, &RimDepthTrackPlot::onPlotsReordered );

View File

@ -48,6 +48,9 @@
#include "RimSummaryTableCollection.h" #include "RimSummaryTableCollection.h"
#include "RimVfpPlotCollection.h" #include "RimVfpPlotCollection.h"
#include "RimViewWindow.h" #include "RimViewWindow.h"
#include "RimWellAllocationOverTimePlot.h"
#include "RimWellAllocationPlot.h"
#include "RimWellDistributionPlotCollection.h"
#include "RimWellLogPlot.h" #include "RimWellLogPlot.h"
#include "RimWellLogPlotCollection.h" #include "RimWellLogPlotCollection.h"
#include "RimWellPltPlot.h" #include "RimWellPltPlot.h"
@ -399,7 +402,7 @@ void RimMainPlotCollection::loadDataAndUpdateAllPlots()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimMainPlotCollection::updateSelectedWell( QString wellName ) void RimMainPlotCollection::updateSelectedWell( const QString& wellName, int timeStep )
{ {
for ( auto plot : summaryMultiPlotCollection()->multiPlots() ) for ( auto plot : summaryMultiPlotCollection()->multiPlots() )
{ {
@ -410,6 +413,23 @@ void RimMainPlotCollection::updateSelectedWell( QString wellName )
{ {
plot->selectWell( wellName ); plot->selectWell( wellName );
} }
if ( auto plot = flowPlotCollection()->defaultWellAllocOverTimePlot() )
{
plot->setWellName( wellName );
}
if ( auto plot = flowPlotCollection()->defaultWellAllocPlot() )
{
plot->setWellName( wellName );
plot->setTimeStep( timeStep );
}
if ( auto plot = flowPlotCollection()->wellDistributionPlotCollection() )
{
plot->setWellName( wellName );
plot->setTimeStep( timeStep );
}
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -91,7 +91,7 @@ public:
void deleteAllCachedData(); void deleteAllCachedData();
void ensureDefaultFlowPlotsAreCreated(); void ensureDefaultFlowPlotsAreCreated();
void loadDataAndUpdateAllPlots(); void loadDataAndUpdateAllPlots();
void updateSelectedWell( QString wellName ); void updateSelectedWell( const QString& wellName, int timeStep );
protected: protected:
void initAfterRead() override; void initAfterRead() override;

View File

@ -203,7 +203,7 @@ RimSimWellInViewCollection::RimSimWellInViewCollection()
"Toggle whether the well pipe visualization will try to detect when a part of the well \nis " "Toggle whether the well pipe visualization will try to detect when a part of the well \nis "
"really a branch, and thus is starting from wellhead", "really a branch, and thus is starting from wellhead",
"" ); "" );
CAF_PDM_InitField( &wellHeadPosition, "WellHeadPosition", WellHeadPositionEnum( WELLHEAD_POS_TOP_COLUMN ), "Well Head Position" ); CAF_PDM_InitField( &wellHeadPosition, "WellHeadPosition", WellHeadPositionEnum( WELLHEAD_POS_ACTIVE_CELLS_BB ), "Well Head Position" );
CAF_PDM_InitFieldNoDefault( &wells, "Wells", "Wells" ); CAF_PDM_InitFieldNoDefault( &wells, "Wells", "Wells" );
wells.uiCapability()->setUiTreeHidden( true ); wells.uiCapability()->setUiTreeHidden( true );

View File

@ -462,7 +462,7 @@ std::shared_ptr<ZGYAccess::SeismicSliceData>
if ( !isInputDataOK() ) return nullptr; if ( !isInputDataOK() ) return nullptr;
auto data1 = m_seismicData1->sliceData( worldX1, worldY1, worldX2, worldY2, zMin, zMax ); auto data1 = m_seismicData1->sliceData( worldX1, worldY1, worldX2, worldY2, zMin, zMax );
auto data2 = m_seismicData1->sliceData( worldX1, worldY1, worldX2, worldY2, zMin, zMax ); auto data2 = m_seismicData2->sliceData( worldX1, worldY1, worldX2, worldY2, zMin, zMax );
if ( ( data1 == nullptr ) || ( data2 == nullptr ) ) return nullptr; if ( ( data1 == nullptr ) || ( data2 == nullptr ) ) return nullptr;

View File

@ -51,7 +51,7 @@ RimSummaryCurveCollection::RimSummaryCurveCollection()
{ {
CAF_PDM_InitObject( "Summary Curves", ":/SummaryCurveFilter16x16.png" ); CAF_PDM_InitObject( "Summary Curves", ":/SummaryCurveFilter16x16.png" );
CAF_PDM_InitFieldNoDefault( &m_curves, "CollectionCurves", "Collection Curves" ); CAF_PDM_InitFieldNoDefault( &m_curves, "CollectionCurves", "Curves" );
m_curves.uiCapability()->setUiTreeHidden( true ); m_curves.uiCapability()->setUiTreeHidden( true );
m_curves.uiCapability()->setUiTreeChildrenHidden( false ); m_curves.uiCapability()->setUiTreeChildrenHidden( false );
caf::PdmFieldReorderCapability::addToFieldWithCallback( &m_curves, this, &RimSummaryCurveCollection::onCurvesReordered ); caf::PdmFieldReorderCapability::addToFieldWithCallback( &m_curves, this, &RimSummaryCurveCollection::onCurvesReordered );

View File

@ -185,7 +185,7 @@ RimWellLogTrack::RimWellLogTrack()
CAF_PDM_InitFieldNoDefault( &m_description, "TrackDescription", "Name" ); CAF_PDM_InitFieldNoDefault( &m_description, "TrackDescription", "Name" );
CAF_PDM_InitFieldNoDefault( &m_curves, "Curves", "" ); CAF_PDM_InitFieldNoDefault( &m_curves, "Curves", "Curves" );
m_curves.uiCapability()->setUiTreeHidden( true ); m_curves.uiCapability()->setUiTreeHidden( true );
auto reorderability = caf::PdmFieldReorderCapability::addToField( &m_curves ); auto reorderability = caf::PdmFieldReorderCapability::addToField( &m_curves );
reorderability->orderChanged.connect( this, &RimWellLogTrack::curveDataChanged ); reorderability->orderChanged.connect( this, &RimWellLogTrack::curveDataChanged );
@ -1368,6 +1368,10 @@ void RimWellLogTrack::onChildrenUpdated( caf::PdmChildArrayFieldHandle* childArr
{ {
if ( childArray == &m_curves ) if ( childArray == &m_curves )
{ {
// If multiple curves are unchecked, we need to attach/reattach to make sure the unchecked curves are not visible
detachAllCurves();
reattachAllCurves();
loadDataAndUpdate(); loadDataAndUpdate();
} }
} }

View File

@ -156,14 +156,14 @@ RiuPlotMainWindow* RiuPlotMainWindow::instance()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiuPlotMainWindow::onWellSelected( QString wellName ) void RiuPlotMainWindow::onWellSelected( const QString& wellName, int timeStep )
{ {
RiuPlotMainWindow* plotWnd = instance(); RiuPlotMainWindow* plotWnd = instance();
if ( !plotWnd ) return; if ( !plotWnd ) return;
if ( !plotWnd->selection3DLinkEnabled() ) return; if ( !plotWnd->selection3DLinkEnabled() ) return;
RimMainPlotCollection::current()->updateSelectedWell( wellName ); RimMainPlotCollection::current()->updateSelectedWell( wellName, timeStep );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -60,7 +60,7 @@ public:
~RiuPlotMainWindow() override; ~RiuPlotMainWindow() override;
static RiuPlotMainWindow* instance(); static RiuPlotMainWindow* instance();
static void onWellSelected( QString wellName ); static void onWellSelected( const QString& wellName, int timeStep );
QString mainWindowName() override; QString mainWindowName() override;

View File

@ -78,6 +78,7 @@
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RiuQwtPlotWidget::RiuQwtPlotWidget( RimPlot* plotDefinition, QWidget* parent ) RiuQwtPlotWidget::RiuQwtPlotWidget( RimPlot* plotDefinition, QWidget* parent )
: RiuPlotWidget( plotDefinition, parent ) : RiuPlotWidget( plotDefinition, parent )
, m_titleRenderingFlags( Qt::AlignHCenter | Qt::TextSingleLine )
{ {
auto* layout = new QVBoxLayout; auto* layout = new QVBoxLayout;
layout->setContentsMargins( 0, 0, 0, 0 ); layout->setContentsMargins( 0, 0, 0, 0 );
@ -248,9 +249,18 @@ void RiuQwtPlotWidget::setPlotTitleFontSize( int titleFontSize )
QFont font = title.font(); QFont font = title.font();
font.setPixelSize( caf::FontTools::pointSizeToPixelSize( titleFontSize ) ); font.setPixelSize( caf::FontTools::pointSizeToPixelSize( titleFontSize ) );
title.setFont( font ); title.setFont( font );
title.setRenderFlags( title.renderFlags() | Qt::TextWordWrap );
m_plot->setTitle( title ); m_plot->setTitle( title );
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuQwtPlotWidget::setPlotTitleRenderingFlags( int flags )
{
m_titleRenderingFlags = flags;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -668,7 +678,7 @@ void RiuQwtPlotWidget::applyPlotTitleToQwt()
{ {
QString plotTitleToApply = m_plotTitleEnabled ? m_plotTitle : QString( "" ); QString plotTitleToApply = m_plotTitleEnabled ? m_plotTitle : QString( "" );
QwtText plotTitle = m_plot->title(); QwtText plotTitle = m_plot->title();
plotTitle.setRenderFlags( Qt::AlignHCenter | Qt::TextSingleLine ); plotTitle.setRenderFlags( m_titleRenderingFlags );
if ( plotTitleToApply != plotTitle.text() ) if ( plotTitleToApply != plotTitle.text() )
{ {
plotTitle.setText( plotTitleToApply ); plotTitle.setText( plotTitleToApply );

View File

@ -101,6 +101,7 @@ public:
void setPlotTitleEnabled( bool enabled ) override; void setPlotTitleEnabled( bool enabled ) override;
bool plotTitleEnabled() const override; bool plotTitleEnabled() const override;
void setPlotTitleFontSize( int titleFontSize ) override; void setPlotTitleFontSize( int titleFontSize ) override;
void setPlotTitleRenderingFlags( int flags );
void setLegendFontSize( int fontSize ) override; void setLegendFontSize( int fontSize ) override;
void setInternalLegendVisible( bool visible ) override; void setInternalLegendVisible( bool visible ) override;
@ -234,4 +235,6 @@ private:
std::map<RiuPlotAxis, QwtAxisId> m_axisMapping; std::map<RiuPlotAxis, QwtAxisId> m_axisMapping;
QPointer<QwtPlot> m_plot; QPointer<QwtPlot> m_plot;
int m_titleRenderingFlags;
}; };

View File

@ -832,7 +832,8 @@ void RiuViewerCommands::handlePickAction( int winPosX, int winPosY, Qt::Keyboard
{ {
bool allowActiveViewChange = dynamic_cast<Rim2dIntersectionView*>( m_viewer->ownerViewWindow() ) == nullptr; bool allowActiveViewChange = dynamic_cast<Rim2dIntersectionView*>( m_viewer->ownerViewWindow() ) == nullptr;
RiuPlotMainWindow::onWellSelected( eclipseWellSourceInfo->well()->name() ); RiuPlotMainWindow::onWellSelected( eclipseWellSourceInfo->well()->name(), mainOrComparisonView->currentTimeStep() );
RiuMainWindow::instance()->selectAsCurrentItem( eclipseWellSourceInfo->well(), allowActiveViewChange ); RiuMainWindow::instance()->selectAsCurrentItem( eclipseWellSourceInfo->well(), allowActiveViewChange );
} }
else if ( wellConnectionSourceInfo ) else if ( wellConnectionSourceInfo )

View File

@ -5,7 +5,7 @@ set(RESINSIGHT_PATCH_VERSION 0)
# Opional text with no restrictions # Opional text with no restrictions
#set(RESINSIGHT_VERSION_TEXT "-dev") #set(RESINSIGHT_VERSION_TEXT "-dev")
set(RESINSIGHT_VERSION_TEXT "-RC_04") set(RESINSIGHT_VERSION_TEXT "-RC_05")
# Optional text # Optional text
# Must be unique and increasing within one combination of major/minor/patch version # Must be unique and increasing within one combination of major/minor/patch version