Show packer in RFT topology track

* Show packers in topology track
* Support optional display of property axis values
* Add legend item clickable option to RimPlotWindow
This commit is contained in:
Magne Sjaastad 2022-10-13 13:03:55 +02:00 committed by GitHub
parent 8c03fb1b36
commit 1d23e8f5c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 331 additions and 127 deletions

View File

@ -68,6 +68,7 @@ void RicNewMultiPhaseRftSegmentPlotFeature::onActionTriggered( bool isChecked )
RiaDefines::namingVariableWellBranch() + ", " + RiaDefines::namingVariableTime(); RiaDefines::namingVariableWellBranch() + ", " + RiaDefines::namingVariableTime();
plot->setNameTemplateText( templateText ); plot->setNameTemplateText( templateText );
plot->setPlotTitleVisible( true ); plot->setPlotTitleVisible( true );
plot->setLegendItemsClickable( false );
QString wellName = "Unknown"; QString wellName = "Unknown";

View File

@ -67,6 +67,7 @@ void RicNewRftSegmentWellLogPlotFeature::onActionTriggered( bool isChecked )
RiaDefines::namingVariableWellBranch() + ", " + RiaDefines::namingVariableTime(); RiaDefines::namingVariableWellBranch() + ", " + RiaDefines::namingVariableTime();
plot->setNameTemplateText( templateText ); plot->setNameTemplateText( templateText );
plot->setPlotTitleVisible( true ); plot->setPlotTitleVisible( true );
plot->setLegendItemsClickable( false );
QString wellName = "Unknown"; QString wellName = "Unknown";
@ -140,6 +141,7 @@ void RicNewRftSegmentWellLogPlotFeature::appendTopologyTrack( RimWellLogPlot* pl
auto track = new RimWellLogTrack(); auto track = new RimWellLogTrack();
track->setDescription( "Topology" ); track->setDescription( "Topology" );
track->enablePropertyAxis( false );
plot->addPlot( track ); plot->addPlot( track );
@ -149,8 +151,13 @@ void RicNewRftSegmentWellLogPlotFeature::appendTopologyTrack( RimWellLogPlot* pl
for ( auto branchType : branchTypes ) for ( auto branchType : branchTypes )
{ {
auto curve = new RimRftTopologyCurve; auto curve = RimRftTopologyCurve::createTopologyCurve( summaryCase, dateTime, wellName, branchIndex, branchType );
curve->setDataSource( summaryCase, dateTime, wellName, branchIndex, branchType ); curve->applyDefaultAppearance();
track->addCurve( curve );
}
{
auto curve = RimRftTopologyCurve::createPackerCurve( summaryCase, dateTime, wellName, branchIndex );
curve->applyDefaultAppearance(); curve->applyDefaultAppearance();
track->addCurve( curve ); track->addCurve( curve );
} }

View File

@ -313,6 +313,32 @@ std::vector<size_t> RifRftSegment::segmentIndicesForBranchIndex( int branchIndex
return v; return v;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<size_t> RifRftSegment::packerSegmentIndicesOnAnnulus( int branchIndex ) const
{
auto segmentIndices = segmentIndicesForBranchIndex( branchIndex, RiaDefines::RftBranchType::RFT_ANNULUS );
std::vector<size_t> packerSegmentIndices;
for ( auto segmentIndex : segmentIndices )
{
auto segment = m_topology[segmentIndex];
auto outflowSegmentNumber = segment.segNext();
auto candidateSegment = segmentData( outflowSegmentNumber );
auto candidateBranchType = branchType( candidateSegment->segBrno() );
if ( candidateBranchType == RiaDefines::RftBranchType::RFT_DEVICE )
{
packerSegmentIndices.push_back( segmentIndex );
}
}
return packerSegmentIndices;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -75,6 +75,7 @@ public:
std::vector<size_t> segmentIndicesForBranchNumber( int branchNumber ) const; std::vector<size_t> segmentIndicesForBranchNumber( int branchNumber ) const;
std::vector<size_t> segmentIndicesForBranchIndex( int branchIndex, RiaDefines::RftBranchType branchType ) const; std::vector<size_t> segmentIndicesForBranchIndex( int branchIndex, RiaDefines::RftBranchType branchType ) const;
std::vector<size_t> packerSegmentIndicesOnAnnulus( int branchIndex ) const;
std::vector<int> segmentNumbersForBranchIndex( int oneBasedBranchIndex, RiaDefines::RftBranchType branchType ) const; std::vector<int> segmentNumbersForBranchIndex( int oneBasedBranchIndex, RiaDefines::RftBranchType branchType ) const;

View File

@ -975,7 +975,7 @@ void RimWellPltPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
if ( track ) if ( track )
{ {
track->uiOrderingForRftPltFormations( uiOrdering ); track->uiOrderingForRftPltFormations( uiOrdering );
track->uiOrderingForXAxisSettings( uiOrdering ); track->uiOrderingForPropertyAxisSettings( uiOrdering );
caf::PdmUiGroup* depthGroup = uiOrdering.addNewGroup( "Depth Axis Settings" ); caf::PdmUiGroup* depthGroup = uiOrdering.addNewGroup( "Depth Axis Settings" );
uiOrderingForDepthAxis( uiConfigName, *depthGroup ); uiOrderingForDepthAxis( uiConfigName, *depthGroup );

View File

@ -974,7 +974,7 @@ void RimWellRftPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
if ( track ) if ( track )
{ {
track->uiOrderingForRftPltFormations( uiOrdering ); track->uiOrderingForRftPltFormations( uiOrdering );
track->uiOrderingForXAxisSettings( uiOrdering ); track->uiOrderingForPropertyAxisSettings( uiOrdering );
caf::PdmUiGroup* depthGroup = uiOrdering.addNewGroup( "Depth Axis Settings" ); caf::PdmUiGroup* depthGroup = uiOrdering.addNewGroup( "Depth Axis Settings" );
uiOrderingForDepthAxis( uiConfigName, *depthGroup ); uiOrderingForDepthAxis( uiConfigName, *depthGroup );

View File

@ -1086,9 +1086,10 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
} }
else if ( dynamic_cast<RimRftCase*>( firstUiItem ) ) else if ( dynamic_cast<RimRftCase*>( firstUiItem ) )
{ {
menuBuilder << "RicNewRftWellLogPlotFeature";
menuBuilder << "RicNewRftSegmentWellLogPlotFeature"; menuBuilder << "RicNewRftSegmentWellLogPlotFeature";
menuBuilder << "RicNewMultiPhaseRftSegmentPlotFeature"; menuBuilder << "RicNewMultiPhaseRftSegmentPlotFeature";
menuBuilder.addSeparator();
menuBuilder << "RicNewRftWellLogPlotFeature";
} }
if ( dynamic_cast<Rim3dView*>( firstUiItem ) ) if ( dynamic_cast<Rim3dView*>( firstUiItem ) )

View File

@ -41,7 +41,8 @@ template <>
void caf::AppEnum<RimPlotWindow::LegendPosition>::setUp() void caf::AppEnum<RimPlotWindow::LegendPosition>::setUp()
{ {
addItem( RimPlotWindow::LegendPosition::ABOVE, "ABOVE", "Above" ); addItem( RimPlotWindow::LegendPosition::ABOVE, "ABOVE", "Above" );
addItem( RimPlotWindow::LegendPosition::INSIDE, "INSIDE", "Inside" ); addItem( RimPlotWindow::LegendPosition::INSIDE_UPPER_RIGHT, "INSIDE_UPPER_RIGHT", "Inside Right", { "INSIDE" } );
addItem( RimPlotWindow::LegendPosition::INSIDE_UPPER_LEFT, "INSIDE_UPPER_LEFT", "Inside Left" );
setDefault( RimPlotWindow::LegendPosition::ABOVE ); setDefault( RimPlotWindow::LegendPosition::ABOVE );
} }
}; // namespace caf }; // namespace caf
@ -68,6 +69,7 @@ RimPlotWindow::RimPlotWindow()
CAF_PDM_InitField( &m_showPlotTitle, "ShowPlotTitle", true, "Show Plot Title" ); CAF_PDM_InitField( &m_showPlotTitle, "ShowPlotTitle", true, "Show Plot Title" );
CAF_PDM_InitField( &m_showPlotLegends, "ShowTrackLegends", true, "Show Legends" ); CAF_PDM_InitField( &m_showPlotLegends, "ShowTrackLegends", true, "Show Legends" );
CAF_PDM_InitField( &m_plotLegendsHorizontal, "TrackLegendsHorizontal", true, "Legend Orientation" ); CAF_PDM_InitField( &m_plotLegendsHorizontal, "TrackLegendsHorizontal", true, "Legend Orientation" );
CAF_PDM_InitField( &m_legendItemsClickable, "LegendItemsClickable", true, "Legend Items Clickable" );
m_plotLegendsHorizontal.uiCapability()->setUiEditorTypeName( caf::PdmUiComboBoxEditor::uiEditorTypeName() ); m_plotLegendsHorizontal.uiCapability()->setUiEditorTypeName( caf::PdmUiComboBoxEditor::uiEditorTypeName() );
CAF_PDM_InitFieldNoDefault( &m_titleFontSize, "TitleFontSize", "Title Font Size" ); CAF_PDM_InitFieldNoDefault( &m_titleFontSize, "TitleFontSize", "Title Font Size" );
@ -101,6 +103,7 @@ RimPlotWindow& RimPlotWindow::operator=( RimPlotWindow&& rhs )
m_showPlotTitle = rhs.m_showPlotTitle(); m_showPlotTitle = rhs.m_showPlotTitle();
m_showPlotLegends = rhs.m_showPlotLegends(); m_showPlotLegends = rhs.m_showPlotLegends();
m_plotLegendsHorizontal = rhs.m_plotLegendsHorizontal(); m_plotLegendsHorizontal = rhs.m_plotLegendsHorizontal();
m_legendItemsClickable = rhs.m_legendItemsClickable();
m_titleFontSize = rhs.m_titleFontSize(); m_titleFontSize = rhs.m_titleFontSize();
m_legendFontSize = rhs.m_legendFontSize(); m_legendFontSize = rhs.m_legendFontSize();
m_legendPosition = rhs.m_legendPosition(); m_legendPosition = rhs.m_legendPosition();
@ -155,6 +158,22 @@ void RimPlotWindow::setLegendsHorizontal( bool horizontal )
m_plotLegendsHorizontal = horizontal; m_plotLegendsHorizontal = horizontal;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimPlotWindow::legendItemsClickable() const
{
return m_legendItemsClickable();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimPlotWindow::setLegendItemsClickable( bool clickable )
{
m_legendItemsClickable = clickable;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -282,7 +301,8 @@ void RimPlotWindow::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
} }
if ( changedField == &m_showPlotLegends || changedField == &m_plotLegendsHorizontal || if ( changedField == &m_showPlotLegends || changedField == &m_plotLegendsHorizontal ||
changedField == &m_legendFontSize || changedField == &m_titleFontSize || changedField == &m_legendPosition ) changedField == &m_legendFontSize || changedField == &m_titleFontSize || changedField == &m_legendPosition ||
changedField == &m_legendItemsClickable )
{ {
updateLayout(); updateLayout();
} }
@ -316,6 +336,7 @@ void RimPlotWindow::uiOrderingForPlotLayout( QString uiConfigName, caf::PdmUiOrd
{ {
uiOrdering.add( &m_showPlotLegends ); uiOrdering.add( &m_showPlotLegends );
uiOrdering.add( &m_plotLegendsHorizontal ); uiOrdering.add( &m_plotLegendsHorizontal );
uiOrdering.add( &m_legendItemsClickable );
if ( showLegendPosition ) if ( showLegendPosition )
{ {
uiOrdering.add( &m_legendPosition ); uiOrdering.add( &m_legendPosition );

View File

@ -47,7 +47,8 @@ public:
enum class LegendPosition enum class LegendPosition
{ {
ABOVE, ABOVE,
INSIDE, INSIDE_UPPER_RIGHT,
INSIDE_UPPER_LEFT,
}; };
RimPlotWindow(); RimPlotWindow();
@ -65,6 +66,8 @@ public:
void setLegendsVisible( bool doShow ); void setLegendsVisible( bool doShow );
bool legendsHorizontal() const; bool legendsHorizontal() const;
void setLegendsHorizontal( bool horizontal ); void setLegendsHorizontal( bool horizontal );
bool legendItemsClickable() const;
void setLegendItemsClickable( bool clickable );
void setLegendPosition( RimPlotWindow::LegendPosition legendPosition ); void setLegendPosition( RimPlotWindow::LegendPosition legendPosition );
RimPlotWindow::LegendPosition legendPosition() const; RimPlotWindow::LegendPosition legendPosition() const;
@ -112,6 +115,7 @@ protected:
caf::PdmField<bool> m_showPlotTitle; caf::PdmField<bool> m_showPlotTitle;
caf::PdmField<bool> m_showPlotLegends; caf::PdmField<bool> m_showPlotLegends;
caf::PdmField<bool> m_plotLegendsHorizontal; caf::PdmField<bool> m_plotLegendsHorizontal;
caf::PdmField<bool> m_legendItemsClickable;
caf::PdmField<caf::AppEnum<LegendPosition>> m_legendPosition; caf::PdmField<caf::AppEnum<LegendPosition>> m_legendPosition;
caf::PdmField<caf::FontTools::RelativeSizeEnum> m_titleFontSize; caf::PdmField<caf::FontTools::RelativeSizeEnum> m_titleFontSize;

View File

@ -19,6 +19,7 @@
#include "RimRftTopologyCurve.h" #include "RimRftTopologyCurve.h"
#include "RiaColorTables.h" #include "RiaColorTables.h"
#include "RiaColorTools.h"
#include "RiaSummaryTools.h" #include "RiaSummaryTools.h"
#include "RifReaderOpmRft.h" #include "RifReaderOpmRft.h"
@ -50,20 +51,39 @@ RimRftTopologyCurve::RimRftTopologyCurve()
CAF_PDM_InitField( &m_segmentBranchIndex, "SegmentBranchIndex", -1, "Branch" ); CAF_PDM_InitField( &m_segmentBranchIndex, "SegmentBranchIndex", -1, "Branch" );
CAF_PDM_InitFieldNoDefault( &m_segmentBranchType, "SegmentBranchType", "Completion" ); CAF_PDM_InitFieldNoDefault( &m_segmentBranchType, "SegmentBranchType", "Completion" );
CAF_PDM_InitField( &m_isPackerCurve, "IsPackerCurve", false, "Packer Curve" );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimRftTopologyCurve::setDataSource( RimSummaryCase* summaryCase, RimRftTopologyCurve* RimRftTopologyCurve::createPackerCurve( RimSummaryCase* summaryCase,
const QDateTime& timeStep, const QDateTime& timeStep,
const QString& wellName, const QString& wellName,
int segmentBranchIndex, int segmentBranchIndex )
RiaDefines::RftBranchType branchType )
{ {
setDataSource( summaryCase, timeStep, wellName, segmentBranchIndex ); RimRftTopologyCurve* curve = new RimRftTopologyCurve();
curve->setDataSource( summaryCase, timeStep, wellName, segmentBranchIndex );
curve->m_isPackerCurve = true;
m_segmentBranchType = branchType; return curve;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimRftTopologyCurve* RimRftTopologyCurve::createTopologyCurve( RimSummaryCase* summaryCase,
const QDateTime& timeStep,
const QString& wellName,
int segmentBranchIndex,
RiaDefines::RftBranchType branchType )
{
RimRftTopologyCurve* curve = new RimRftTopologyCurve();
curve->setDataSource( summaryCase, timeStep, wellName, segmentBranchIndex );
curve->m_segmentBranchType = branchType;
return curve;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -85,7 +105,7 @@ void RimRftTopologyCurve::setDataSource( RimSummaryCase* summaryCase,
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
QString RimRftTopologyCurve::wellName() const QString RimRftTopologyCurve::wellName() const
{ {
return "Topology curve"; return m_wellName;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -111,9 +131,16 @@ QString RimRftTopologyCurve::createCurveAutoName()
{ {
QString text; QString text;
if ( m_segmentBranchType() == RiaDefines::RftBranchType::RFT_ANNULUS ) text += "Annulus"; if ( m_isPackerCurve() )
if ( m_segmentBranchType() == RiaDefines::RftBranchType::RFT_DEVICE ) text += "Device"; {
if ( m_segmentBranchType() == RiaDefines::RftBranchType::RFT_TUBING ) text += "Tubing"; text += "Packer";
}
else
{
if ( m_segmentBranchType() == RiaDefines::RftBranchType::RFT_ANNULUS ) text += "Annulus";
if ( m_segmentBranchType() == RiaDefines::RftBranchType::RFT_DEVICE ) text += "Device";
if ( m_segmentBranchType() == RiaDefines::RftBranchType::RFT_TUBING ) text += "Tubing";
}
text += QString( " (%1)" ).arg( m_segmentBranchIndex() ); text += QString( " (%1)" ).arg( m_segmentBranchIndex() );
@ -131,8 +158,13 @@ void RimRftTopologyCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrde
curveDataGroup->add( &m_summaryCase ); curveDataGroup->add( &m_summaryCase );
curveDataGroup->add( &m_wellName ); curveDataGroup->add( &m_wellName );
curveDataGroup->add( &m_timeStep ); curveDataGroup->add( &m_timeStep );
curveDataGroup->add( &m_isPackerCurve );
curveDataGroup->add( &m_segmentBranchIndex ); curveDataGroup->add( &m_segmentBranchIndex );
curveDataGroup->add( &m_segmentBranchType ); if ( !m_isPackerCurve() )
{
curveDataGroup->add( &m_segmentBranchType );
}
caf::PdmUiGroup* stackingGroup = uiOrdering.addNewGroup( "Stacking" ); caf::PdmUiGroup* stackingGroup = uiOrdering.addNewGroup( "Stacking" );
RimStackablePlotCurve::stackingUiOrdering( *stackingGroup ); RimStackablePlotCurve::stackingUiOrdering( *stackingGroup );
@ -225,23 +257,44 @@ void RimRftTopologyCurve::onLoadDataAndUpdate( bool updateParentPlot )
std::vector<double> depths; std::vector<double> depths;
std::vector<double> propertyValues; std::vector<double> propertyValues;
// Assign a static property value to each type of curve to make sure they all are separated and easily // Assign a static property value to each type of curve to make sure they all are separated and
// visible // easily visible
double curveValue = 1.0; double curveValue = 1.0;
if ( m_segmentBranchType() == RiaDefines::RftBranchType::RFT_TUBING ) curveValue = 2.0; if ( m_segmentBranchType() == RiaDefines::RftBranchType::RFT_TUBING ) curveValue = 2.0;
if ( m_segmentBranchType() == RiaDefines::RftBranchType::RFT_DEVICE ) curveValue = 3.0; if ( m_segmentBranchType() == RiaDefines::RftBranchType::RFT_DEVICE ) curveValue = 3.0;
if ( m_segmentBranchType() == RiaDefines::RftBranchType::RFT_ANNULUS ) curveValue = 4.0; if ( m_segmentBranchType() == RiaDefines::RftBranchType::RFT_ANNULUS ) curveValue = 4.0;
if ( m_isPackerCurve )
{
curveValue = 3.5;
}
// Adjust the location of each branch if multiple branches are visible at the same time // Adjust the location of each branch if multiple branches are visible at the same time
curveValue += m_segmentBranchIndex() * 0.2; curveValue += m_segmentBranchIndex() * 0.2;
for ( auto segmentIndex : segmentIndices ) if ( m_isPackerCurve )
{ {
depths.push_back( seglenstValues[segmentIndex] ); auto packerSegmentIndices = segment.packerSegmentIndicesOnAnnulus( m_segmentBranchIndex() );
depths.push_back( seglenenValues[segmentIndex] );
propertyValues.push_back( curveValue ); for ( auto segmentIndex : packerSegmentIndices )
propertyValues.push_back( curveValue ); {
depths.push_back( seglenstValues[segmentIndex] );
depths.push_back( seglenenValues[segmentIndex] );
propertyValues.push_back( curveValue );
propertyValues.push_back( curveValue );
}
}
else
{
for ( auto segmentIndex : segmentIndices )
{
depths.push_back( seglenstValues[segmentIndex] );
depths.push_back( seglenenValues[segmentIndex] );
propertyValues.push_back( curveValue );
propertyValues.push_back( curveValue );
}
} }
RimDepthTrackPlot* wellLogPlot; RimDepthTrackPlot* wellLogPlot;
@ -255,16 +308,16 @@ void RimRftTopologyCurve::onLoadDataAndUpdate( bool updateParentPlot )
// Assign curve values based on horizontal or vertical plot // Assign curve values based on horizontal or vertical plot
setPropertyAndDepthValuesToPlotCurve( propertyValues, depths ); setPropertyAndDepthValuesToPlotCurve( propertyValues, depths );
}
if ( updateParentPlot ) if ( updateParentPlot )
{ {
updateZoomInParentPlot(); updateZoomInParentPlot();
} }
if ( m_parentPlot ) if ( m_parentPlot )
{ {
m_parentPlot->replot(); m_parentPlot->replot();
}
} }
} }
} }
@ -275,23 +328,41 @@ void RimRftTopologyCurve::onLoadDataAndUpdate( bool updateParentPlot )
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimRftTopologyCurve::applyDefaultAppearance() void RimRftTopologyCurve::applyDefaultAppearance()
{ {
cvf::Color3f color = cvf::Color3f::BLUE; if ( m_isPackerCurve() )
if ( m_segmentBranchType() == RiaDefines::RftBranchType::RFT_TUBING )
{ {
color = RiaColorTables::wellLogPlotPaletteColors().cycledColor3f( 0 ); auto color = RiaColorTools::fromQColorTo3f( QColor( "DarkGoldenRod" ) );
} int adjustedSymbolSize = symbolSize() * 2;
else if ( m_segmentBranchType() == RiaDefines::RftBranchType::RFT_DEVICE )
{
color = RiaColorTables::wellLogPlotPaletteColors().cycledColor3f( 1 );
setLineStyle( RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_NONE );
}
else if ( m_segmentBranchType() == RiaDefines::RftBranchType::RFT_ANNULUS )
{
color = RiaColorTables::wellLogPlotPaletteColors().cycledColor3f( 2 );
setLineStyle( RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_NONE );
}
setColor( color ); setColor( color );
setLineThickness( 5.0 ); setSymbolSize( adjustedSymbolSize );
setSymbol( RiuPlotCurveSymbol::PointSymbolEnum::SYMBOL_ELLIPSE ); setLineStyle( RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_NONE );
setSymbol( RiuPlotCurveSymbol::PointSymbolEnum::SYMBOL_RECT );
}
else
{
if ( m_segmentBranchType() == RiaDefines::RftBranchType::RFT_TUBING )
{
auto color = RiaColorTools::fromQColorTo3f( QColor( "ForestGreen" ) );
setColor( color );
setLineThickness( 5.0 );
}
else if ( m_segmentBranchType() == RiaDefines::RftBranchType::RFT_DEVICE )
{
auto color = RiaColorTools::fromQColorTo3f( QColor( "IndianRed" ) );
setColor( color );
setSymbolEdgeColor( color );
setLineStyle( RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_NONE );
}
else if ( m_segmentBranchType() == RiaDefines::RftBranchType::RFT_ANNULUS )
{
auto color = RiaColorTools::fromQColorTo3f( QColor( "DeepSkyBlue" ) );
setColor( color );
setSymbolEdgeColor( color );
setLineStyle( RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_NONE );
}
int adjustedSymbolSize = symbolSize() * 1.5;
setSymbolSize( adjustedSymbolSize );
setSymbol( RiuPlotCurveSymbol::PointSymbolEnum::SYMBOL_ELLIPSE );
}
} }

View File

@ -38,11 +38,16 @@ class RimRftTopologyCurve : public RimWellLogCurve
public: public:
RimRftTopologyCurve(); RimRftTopologyCurve();
void setDataSource( RimSummaryCase* summaryCase, static RimRftTopologyCurve* createPackerCurve( RimSummaryCase* summaryCase,
const QDateTime& timeStep, const QDateTime& timeStep,
const QString& wellName, const QString& wellName,
int segmentBranchIndex, int segmentBranchIndex );
RiaDefines::RftBranchType branchType );
static RimRftTopologyCurve* createTopologyCurve( RimSummaryCase* summaryCase,
const QDateTime& timeStep,
const QString& wellName,
int segmentBranchIndex,
RiaDefines::RftBranchType branchType );
void setDataSource( RimSummaryCase* summaryCase, const QDateTime& timeStep, const QString& wellName, int segmentBranchIndex ); void setDataSource( RimSummaryCase* summaryCase, const QDateTime& timeStep, const QString& wellName, int segmentBranchIndex );
@ -67,4 +72,6 @@ private:
caf::PdmField<QString> m_wellName; caf::PdmField<QString> m_wellName;
caf::PdmField<int> m_segmentBranchIndex; caf::PdmField<int> m_segmentBranchIndex;
caf::PdmField<caf::AppEnum<RiaDefines::RftBranchType>> m_segmentBranchType; caf::PdmField<caf::AppEnum<RiaDefines::RftBranchType>> m_segmentBranchType;
caf::PdmField<bool> m_isPackerCurve;
}; };

View File

@ -206,17 +206,18 @@ RimWellLogTrack::RimWellLogTrack()
CAF_PDM_InitField( &m_isAutoScalePropertyValuesEnabled, "AutoScaleX", true, "Auto Scale" ); CAF_PDM_InitField( &m_isAutoScalePropertyValuesEnabled, "AutoScaleX", true, "Auto Scale" );
m_isAutoScalePropertyValuesEnabled.uiCapability()->setUiHidden( true ); m_isAutoScalePropertyValuesEnabled.uiCapability()->setUiHidden( true );
CAF_PDM_InitField( &m_isLogarithmicScaleEnabled, "LogarithmicScaleX", false, "Logarithmic Scale" ); CAF_PDM_InitField( &m_isPropertyLogarithmicScaleEnabled, "LogarithmicScaleX", false, "Logarithmic Scale" );
CAF_PDM_InitField( &m_invertPropertyValueAxis, "InvertPropertyValueAxis", false, "Invert Axis Range" ); CAF_PDM_InitField( &m_invertPropertyValueAxis, "InvertPropertyValueAxis", false, "Invert Axis Range" );
CAF_PDM_InitField( &m_isPropertyAxisEnabled, "IsPropertyAxisEnabled", true, "Show Axis" );
CAF_PDM_InitFieldNoDefault( &m_propertyValueAxisGridVisibility, "ShowXGridLines", "Show Grid Lines" ); CAF_PDM_InitFieldNoDefault( &m_propertyValueAxisGridVisibility, "ShowXGridLines", "Show Grid Lines" );
CAF_PDM_InitField( &m_explicitTickIntervals, "ExplicitTickIntervals", false, "Manually Set Tick Intervals" ); CAF_PDM_InitField( &m_explicitTickIntervalsPropertyValueAxis, "ExplicitTickIntervals", false, "Manually Set Tick Intervals" );
CAF_PDM_InitField( &m_minAndMaxTicksOnly, "MinAndMaxTicksOnly", false, "Show Ticks at Min and Max" ); CAF_PDM_InitField( &m_propertyAxisMinAndMaxTicksOnly, "MinAndMaxTicksOnly", false, "Show Ticks at Min and Max" );
CAF_PDM_InitField( &m_majorTickInterval, "MajorTickIntervals", 0.0, "Major Tick Interval" ); CAF_PDM_InitField( &m_majorTickIntervalPropertyAxis, "MajorTickIntervals", 0.0, "Major Tick Interval" );
CAF_PDM_InitField( &m_minorTickInterval, "MinorTickIntervals", 0.0, "Minor Tick Interval" ); CAF_PDM_InitField( &m_minorTickIntervalPropertyAxis, "MinorTickIntervals", 0.0, "Minor Tick Interval" );
m_majorTickInterval.uiCapability()->setUiHidden( true ); m_majorTickIntervalPropertyAxis.uiCapability()->setUiHidden( true );
m_minorTickInterval.uiCapability()->setUiHidden( true ); m_minorTickIntervalPropertyAxis.uiCapability()->setUiHidden( true );
CAF_PDM_InitFieldNoDefault( &m_axisFontSize, "AxisFontSize", "Axis Font Size" ); CAF_PDM_InitFieldNoDefault( &m_axisFontSize, "AxisFontSize", "Axis Font Size" );
@ -402,9 +403,9 @@ void RimWellLogTrack::calculatePropertyValueZoomRange()
minValue = 0; minValue = 0;
maxValue = 0; maxValue = 0;
} }
else if ( m_minorTickInterval() != 0.0 ) else if ( m_minorTickIntervalPropertyAxis() != 0.0 )
{ {
std::tie( minValue, maxValue ) = adjustXRange( minValue, maxValue, m_minorTickInterval() ); std::tie( minValue, maxValue ) = adjustXRange( minValue, maxValue, m_minorTickIntervalPropertyAxis() );
} }
else else
{ {
@ -488,7 +489,7 @@ void RimWellLogTrack::updatePropertyValueZoom()
m_visiblePropertyValueRangeMin = m_availablePropertyValueRangeMin; m_visiblePropertyValueRangeMin = m_availablePropertyValueRangeMin;
m_visiblePropertyValueRangeMax = m_availablePropertyValueRangeMax; m_visiblePropertyValueRangeMax = m_availablePropertyValueRangeMax;
if ( !visibleStackedCurves().empty() && !m_isLogarithmicScaleEnabled ) if ( !visibleStackedCurves().empty() && !m_isPropertyLogarithmicScaleEnabled )
{ {
// Try to ensure we include the base line whether the values are negative or positive. // Try to ensure we include the base line whether the values are negative or positive.
m_visiblePropertyValueRangeMin = std::min( m_visiblePropertyValueRangeMin(), 0.0 ); m_visiblePropertyValueRangeMin = std::min( m_visiblePropertyValueRangeMin(), 0.0 );
@ -583,22 +584,27 @@ void RimWellLogTrack::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
{ {
updateParentLayout(); updateParentLayout();
} }
else if ( changedField == &m_explicitTickIntervals ) else if ( changedField == &m_explicitTickIntervalsPropertyValueAxis )
{ {
if ( m_plotWidget ) if ( m_plotWidget )
{ {
m_majorTickInterval = m_plotWidget->majorTickInterval( valueAxis() ); m_majorTickIntervalPropertyAxis = m_plotWidget->majorTickInterval( valueAxis() );
m_minorTickInterval = m_plotWidget->minorTickInterval( valueAxis() ); m_minorTickIntervalPropertyAxis = m_plotWidget->minorTickInterval( valueAxis() );
} }
m_majorTickInterval.uiCapability()->setUiHidden( !m_explicitTickIntervals() ); m_majorTickIntervalPropertyAxis.uiCapability()->setUiHidden( !m_explicitTickIntervalsPropertyValueAxis() );
m_minorTickInterval.uiCapability()->setUiHidden( !m_explicitTickIntervals() ); m_minorTickIntervalPropertyAxis.uiCapability()->setUiHidden( !m_explicitTickIntervalsPropertyValueAxis() );
if ( !m_explicitTickIntervals() ) if ( !m_explicitTickIntervalsPropertyValueAxis() )
{ {
updatePropertyValueAxisAndGridTickIntervals(); updatePropertyValueAxisAndGridTickIntervals();
} }
} }
else if ( changedField == &m_propertyValueAxisGridVisibility || changedField == &m_majorTickInterval || else if ( changedField == &m_isPropertyAxisEnabled )
changedField == &m_minorTickInterval || changedField == &m_minAndMaxTicksOnly || {
updatePropertyValueAxisAndGridTickIntervals();
updateParentLayout();
}
else if ( changedField == &m_propertyValueAxisGridVisibility || changedField == &m_majorTickIntervalPropertyAxis ||
changedField == &m_minorTickIntervalPropertyAxis || changedField == &m_propertyAxisMinAndMaxTicksOnly ||
changedField == &m_invertPropertyValueAxis ) changedField == &m_invertPropertyValueAxis )
{ {
updatePropertyValueAxisAndGridTickIntervals(); updatePropertyValueAxisAndGridTickIntervals();
@ -606,7 +612,7 @@ void RimWellLogTrack::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
else if ( changedField == &m_visiblePropertyValueRangeMin || changedField == &m_visiblePropertyValueRangeMax ) else if ( changedField == &m_visiblePropertyValueRangeMin || changedField == &m_visiblePropertyValueRangeMax )
{ {
bool emptyRange = isEmptyVisiblePropertyRange(); bool emptyRange = isEmptyVisiblePropertyRange();
m_explicitTickIntervals.uiCapability()->setUiReadOnly( emptyRange ); m_explicitTickIntervalsPropertyValueAxis.uiCapability()->setUiReadOnly( emptyRange );
m_propertyValueAxisGridVisibility.uiCapability()->setUiReadOnly( emptyRange ); m_propertyValueAxisGridVisibility.uiCapability()->setUiReadOnly( emptyRange );
m_isAutoScalePropertyValuesEnabled = false; m_isAutoScalePropertyValuesEnabled = false;
@ -624,14 +630,14 @@ void RimWellLogTrack::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
m_plotWidget->scheduleReplot(); m_plotWidget->scheduleReplot();
} }
} }
else if ( changedField == &m_isLogarithmicScaleEnabled ) else if ( changedField == &m_isPropertyLogarithmicScaleEnabled )
{ {
updateAxisScaleEngine(); updateAxisScaleEngine();
if ( m_isLogarithmicScaleEnabled() ) if ( m_isPropertyLogarithmicScaleEnabled() )
{ {
m_explicitTickIntervals = false; m_explicitTickIntervalsPropertyValueAxis = false;
} }
m_explicitTickIntervals.uiCapability()->setUiHidden( m_isLogarithmicScaleEnabled() ); m_explicitTickIntervalsPropertyValueAxis.uiCapability()->setUiHidden( m_isPropertyLogarithmicScaleEnabled() );
updatePropertyValueZoom(); updatePropertyValueZoom();
loadDataAndUpdate(); loadDataAndUpdate();
@ -822,7 +828,7 @@ void RimWellLogTrack::updatePropertyValueAxisAndGridTickIntervals()
auto rangeBoundaryB = m_visiblePropertyValueRangeMax(); auto rangeBoundaryB = m_visiblePropertyValueRangeMax();
if ( m_invertPropertyValueAxis() ) std::swap( rangeBoundaryA, rangeBoundaryB ); if ( m_invertPropertyValueAxis() ) std::swap( rangeBoundaryA, rangeBoundaryB );
if ( m_minAndMaxTicksOnly ) if ( m_propertyAxisMinAndMaxTicksOnly )
{ {
auto roundToDigits = []( double value, int numberOfDigits, bool useFloor ) { auto roundToDigits = []( double value, int numberOfDigits, bool useFloor ) {
if ( value == 0.0 ) return 0.0; if ( value == 0.0 ) return 0.0;
@ -867,11 +873,11 @@ void RimWellLogTrack::updatePropertyValueAxisAndGridTickIntervals()
m_plotWidget->qwtPlot()->setAxisScaleDiv( QwtAxis::YLeft, div ); m_plotWidget->qwtPlot()->setAxisScaleDiv( QwtAxis::YLeft, div );
} }
} }
else if ( m_explicitTickIntervals ) else if ( m_explicitTickIntervalsPropertyValueAxis )
{ {
m_plotWidget->setMajorAndMinorTickIntervals( valueAxis(), m_plotWidget->setMajorAndMinorTickIntervals( valueAxis(),
m_majorTickInterval(), m_majorTickIntervalPropertyAxis(),
m_minorTickInterval(), m_minorTickIntervalPropertyAxis(),
rangeBoundaryA, rangeBoundaryA,
rangeBoundaryB ); rangeBoundaryB );
} }
@ -896,6 +902,9 @@ void RimWellLogTrack::updatePropertyValueAxisAndGridTickIntervals()
wellLogPlot->depthAxisGridLinesEnabled() & RimWellLogPlot::AXIS_GRID_MAJOR, wellLogPlot->depthAxisGridLinesEnabled() & RimWellLogPlot::AXIS_GRID_MAJOR,
wellLogPlot->depthAxisGridLinesEnabled() & RimWellLogPlot::AXIS_GRID_MINOR ); wellLogPlot->depthAxisGridLinesEnabled() & RimWellLogPlot::AXIS_GRID_MINOR );
} }
m_plotWidget->enableAxisNumberLabels( valueAxis(), m_isPropertyAxisEnabled() );
m_plotWidget->scheduleReplot(); m_plotWidget->scheduleReplot();
} }
@ -1375,11 +1384,11 @@ void RimWellLogTrack::onLoadDataAndUpdate()
} }
this->updatePropertyValueAxisAndGridTickIntervals(); this->updatePropertyValueAxisAndGridTickIntervals();
m_majorTickInterval.uiCapability()->setUiHidden( !m_explicitTickIntervals() ); m_majorTickIntervalPropertyAxis.uiCapability()->setUiHidden( !m_explicitTickIntervalsPropertyValueAxis() );
m_minorTickInterval.uiCapability()->setUiHidden( !m_explicitTickIntervals() ); m_minorTickIntervalPropertyAxis.uiCapability()->setUiHidden( !m_explicitTickIntervalsPropertyValueAxis() );
bool emptyRange = isEmptyVisiblePropertyRange(); bool emptyRange = isEmptyVisiblePropertyRange();
m_explicitTickIntervals.uiCapability()->setUiReadOnly( emptyRange ); m_explicitTickIntervalsPropertyValueAxis.uiCapability()->setUiReadOnly( emptyRange );
m_propertyValueAxisGridVisibility.uiCapability()->setUiReadOnly( emptyRange ); m_propertyValueAxisGridVisibility.uiCapability()->setUiReadOnly( emptyRange );
updateDepthZoom(); updateDepthZoom();
@ -1742,9 +1751,9 @@ void RimWellLogTrack::updateZoomInParentPlot()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogTrack::setTickIntervals( double majorTickInterval, double minorTickInterval ) void RimWellLogTrack::setTickIntervals( double majorTickInterval, double minorTickInterval )
{ {
m_explicitTickIntervals = true; m_explicitTickIntervalsPropertyValueAxis = true;
m_majorTickInterval = majorTickInterval; m_majorTickIntervalPropertyAxis = majorTickInterval;
m_minorTickInterval = minorTickInterval; m_minorTickIntervalPropertyAxis = minorTickInterval;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -1752,7 +1761,7 @@ void RimWellLogTrack::setTickIntervals( double majorTickInterval, double minorTi
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogTrack::setMinAndMaxTicksOnly( bool enable ) void RimWellLogTrack::setMinAndMaxTicksOnly( bool enable )
{ {
m_minAndMaxTicksOnly = enable; m_propertyAxisMinAndMaxTicksOnly = enable;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -2043,7 +2052,7 @@ void RimWellLogTrack::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering
uiOrdering.add( &m_ensembleWellLogCurveSet ); uiOrdering.add( &m_ensembleWellLogCurveSet );
uiOrderingForXAxisSettings( uiOrdering ); uiOrderingForPropertyAxisSettings( uiOrdering );
uiOrdering.skipRemainingFields( true ); uiOrdering.skipRemainingFields( true );
} }
@ -2119,7 +2128,7 @@ void RimWellLogTrack::updateAxisScaleEngine()
{ {
m_plotWidget->setAxisInverted( RiuPlotAxis::defaultLeft(), true ); m_plotWidget->setAxisInverted( RiuPlotAxis::defaultLeft(), true );
if ( m_isLogarithmicScaleEnabled ) if ( m_isPropertyLogarithmicScaleEnabled )
{ {
m_plotWidget->qwtPlot()->setAxisScaleEngine( QwtAxis::XTop, new QwtLogScaleEngine ); m_plotWidget->qwtPlot()->setAxisScaleEngine( QwtAxis::XTop, new QwtLogScaleEngine );
@ -2138,7 +2147,7 @@ void RimWellLogTrack::updateAxisScaleEngine()
{ {
m_plotWidget->setAxisInverted( RiuPlotAxis::defaultLeft(), false ); m_plotWidget->setAxisInverted( RiuPlotAxis::defaultLeft(), false );
if ( m_isLogarithmicScaleEnabled ) if ( m_isPropertyLogarithmicScaleEnabled )
{ {
m_plotWidget->qwtPlot()->setAxisScaleEngine( QwtAxis::YLeft, new QwtLogScaleEngine ); m_plotWidget->qwtPlot()->setAxisScaleEngine( QwtAxis::YLeft, new QwtLogScaleEngine );
@ -2332,7 +2341,7 @@ void RimWellLogTrack::connectCurveSignals( RimWellLogCurve* curve )
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogTrack::computeAndSetPropertyValueRangeMinForLogarithmicScale() void RimWellLogTrack::computeAndSetPropertyValueRangeMinForLogarithmicScale()
{ {
if ( m_isAutoScalePropertyValuesEnabled && m_isLogarithmicScaleEnabled ) if ( m_isAutoScalePropertyValuesEnabled && m_isPropertyLogarithmicScaleEnabled )
{ {
double pos = HUGE_VAL; double pos = HUGE_VAL;
double neg = -HUGE_VAL; double neg = -HUGE_VAL;
@ -2359,7 +2368,7 @@ void RimWellLogTrack::computeAndSetPropertyValueRangeMinForLogarithmicScale()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogTrack::setLogarithmicScale( bool enable ) void RimWellLogTrack::setLogarithmicScale( bool enable )
{ {
m_isLogarithmicScaleEnabled = enable; m_isPropertyLogarithmicScaleEnabled = enable;
updateAxisScaleEngine(); updateAxisScaleEngine();
computeAndSetPropertyValueRangeMinForLogarithmicScale(); computeAndSetPropertyValueRangeMinForLogarithmicScale();
@ -2370,7 +2379,7 @@ void RimWellLogTrack::setLogarithmicScale( bool enable )
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RimWellLogTrack::isLogarithmicScale() const bool RimWellLogTrack::isLogarithmicScale() const
{ {
return m_isLogarithmicScaleEnabled; return m_isPropertyLogarithmicScaleEnabled;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -2451,15 +2460,16 @@ void RimWellLogTrack::uiOrderingForRftPltFormations( caf::PdmUiOrdering& uiOrder
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogTrack::uiOrderingForXAxisSettings( caf::PdmUiOrdering& uiOrdering ) void RimWellLogTrack::uiOrderingForPropertyAxisSettings( caf::PdmUiOrdering& uiOrdering )
{ {
caf::PdmUiGroup* gridGroup = uiOrdering.addNewGroup( "Property Axis Settings" ); caf::PdmUiGroup* gridGroup = uiOrdering.addNewGroup( "Property Axis Settings" );
gridGroup->add( &m_isLogarithmicScaleEnabled ); gridGroup->add( &m_isPropertyAxisEnabled );
gridGroup->add( &m_isPropertyLogarithmicScaleEnabled );
gridGroup->add( &m_visiblePropertyValueRangeMin ); gridGroup->add( &m_visiblePropertyValueRangeMin );
gridGroup->add( &m_visiblePropertyValueRangeMax ); gridGroup->add( &m_visiblePropertyValueRangeMax );
gridGroup->add( &m_invertPropertyValueAxis ); gridGroup->add( &m_invertPropertyValueAxis );
gridGroup->add( &m_propertyValueAxisGridVisibility ); gridGroup->add( &m_propertyValueAxisGridVisibility );
gridGroup->add( &m_minAndMaxTicksOnly ); gridGroup->add( &m_propertyAxisMinAndMaxTicksOnly );
// TODO Revisit if these settings are required // TODO Revisit if these settings are required
// See issue https://github.com/OPM/ResInsight/issues/4367 // See issue https://github.com/OPM/ResInsight/issues/4367
@ -2468,6 +2478,22 @@ void RimWellLogTrack::uiOrderingForXAxisSettings( caf::PdmUiOrdering& uiOrdering
// gridGroup->add( &m_minorTickInterval ); // gridGroup->add( &m_minorTickInterval );
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::enablePropertyAxis( bool enable )
{
m_isPropertyAxisEnabled = enable;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellLogTrack::isPropertyAxisEnabled() const
{
return m_isPropertyAxisEnabled();
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -2724,7 +2750,7 @@ void RimWellLogTrack::updateStackedCurveData()
0.0, 0.0,
displayUnit, displayUnit,
false, false,
m_isLogarithmicScaleEnabled ); m_isPropertyLogarithmicScaleEnabled );
auto plotDepthValues = tempCurveData.depths( depthType ); auto plotDepthValues = tempCurveData.depths( depthType );
auto polyLineStartStopIndices = tempCurveData.polylineStartStopIndices(); auto polyLineStartStopIndices = tempCurveData.polylineStartStopIndices();

View File

@ -202,7 +202,9 @@ public:
std::vector<RimWellLogCurve*> visibleCurves() const; std::vector<RimWellLogCurve*> visibleCurves() const;
void uiOrderingForRftPltFormations( caf::PdmUiOrdering& uiOrdering ); void uiOrderingForRftPltFormations( caf::PdmUiOrdering& uiOrdering );
void uiOrderingForXAxisSettings( caf::PdmUiOrdering& uiOrdering ); void uiOrderingForPropertyAxisSettings( caf::PdmUiOrdering& uiOrdering );
void enablePropertyAxis( bool enable );
bool isPropertyAxisEnabled() const;
void setFormationsForCaseWithSimWellOnly( bool caseWithSimWellOnly ); void setFormationsForCaseWithSimWellOnly( bool caseWithSimWellOnly );
void updatePropertyValueAxisAndGridTickIntervals(); void updatePropertyValueAxisAndGridTickIntervals();
@ -316,25 +318,25 @@ private:
bool isEmptyVisiblePropertyRange() const; bool isEmptyVisiblePropertyRange() const;
private: private:
QString m_propertyValueAxisTitle; caf::PdmField<QString> m_description;
caf::PdmField<QString> m_description;
caf::PdmChildArrayField<RimWellLogCurve*> m_curves; caf::PdmChildArrayField<RimWellLogCurve*> m_curves;
caf::PdmField<double> m_visiblePropertyValueRangeMin;
caf::PdmField<double> m_visiblePropertyValueRangeMax;
caf::PdmField<double> m_visibleDepthRangeMin;
caf::PdmField<double> m_visibleDepthRangeMax;
// Property value axis
caf::PdmField<bool> m_isPropertyAxisEnabled;
caf::PdmField<double> m_visiblePropertyValueRangeMin;
caf::PdmField<double> m_visiblePropertyValueRangeMax;
caf::PdmField<bool> m_isAutoScalePropertyValuesEnabled; caf::PdmField<bool> m_isAutoScalePropertyValuesEnabled;
caf::PdmField<bool> m_isLogarithmicScaleEnabled; caf::PdmField<bool> m_isPropertyLogarithmicScaleEnabled;
caf::PdmField<bool> m_invertPropertyValueAxis; caf::PdmField<bool> m_invertPropertyValueAxis;
caf::PdmField<RimWellLogPlot::AxisGridEnum> m_propertyValueAxisGridVisibility; caf::PdmField<RimWellLogPlot::AxisGridEnum> m_propertyValueAxisGridVisibility;
caf::PdmField<bool> m_propertyAxisMinAndMaxTicksOnly;
caf::PdmField<bool> m_explicitTickIntervalsPropertyValueAxis;
caf::PdmField<double> m_majorTickIntervalPropertyAxis;
caf::PdmField<double> m_minorTickIntervalPropertyAxis;
caf::PdmField<bool> m_explicitTickIntervals; // Depth axis
caf::PdmField<bool> m_minAndMaxTicksOnly; caf::PdmField<double> m_visibleDepthRangeMin;
caf::PdmField<double> m_majorTickInterval; caf::PdmField<double> m_visibleDepthRangeMax;
caf::PdmField<double> m_minorTickInterval;
caf::PdmField<caf::FontTools::RelativeSizeEnum> m_axisFontSize; caf::PdmField<caf::FontTools::RelativeSizeEnum> m_axisFontSize;
@ -374,8 +376,9 @@ private:
QPointer<RiuWellLogTrack> m_plotWidget; QPointer<RiuWellLogTrack> m_plotWidget;
std::unique_ptr<RiuPlotAnnotationTool> m_annotationTool; std::unique_ptr<RiuPlotAnnotationTool> m_annotationTool;
double m_availablePropertyValueRangeMin; QString m_propertyValueAxisTitle;
double m_availablePropertyValueRangeMax; double m_availablePropertyValueRangeMin;
double m_availableDepthRangeMin; double m_availablePropertyValueRangeMax;
double m_availableDepthRangeMax; double m_availableDepthRangeMin;
double m_availableDepthRangeMax;
}; };

View File

@ -193,7 +193,12 @@ void RiuMultiPlotPage::insertPlot( RiuPlotWidget* plotWidget, size_t index )
legend->setMaxColumns( legendColumns ); legend->setMaxColumns( legendColumns );
legend->horizontalScrollBar()->setVisible( false ); legend->horizontalScrollBar()->setVisible( false );
legend->verticalScrollBar()->setVisible( false ); legend->verticalScrollBar()->setVisible( false );
legend->setDefaultItemMode( QwtLegendData::Clickable );
// The legend item mode must be set before the widget is created
// See https://qwt.sourceforge.io/class_qwt_legend.html#af977ff3e749f8281ee8ad4b926542b50
auto legendItemMode = m_plotDefinition->legendItemsClickable() ? QwtLegendData::Clickable : QwtLegendData::ReadOnly;
legend->setDefaultItemMode( legendItemMode );
if ( qwtPlotWidget ) if ( qwtPlotWidget )
{ {
legend->connect( qwtPlotWidget->qwtPlot(), legend->connect( qwtPlotWidget->qwtPlot(),
@ -744,11 +749,17 @@ void RiuMultiPlotPage::addLegendWidget( RiuPlotWidget* plotWidget,
} }
else else
{ {
CAF_ASSERT( m_plotDefinition->legendPosition() == RimPlotWindow::LegendPosition::INSIDE ); auto anchor = RiuDraggableOverlayFrame::AnchorCorner::TopRight;
if ( m_plotDefinition->legendPosition() == RimPlotWindow::LegendPosition::INSIDE_UPPER_RIGHT )
anchor = RiuDraggableOverlayFrame::AnchorCorner::TopRight;
else if ( m_plotDefinition->legendPosition() == RimPlotWindow::LegendPosition::INSIDE_UPPER_LEFT )
anchor = RiuDraggableOverlayFrame::AnchorCorner::TopLeft;
auto overlayFrame = new RiuQwtLegendOverlayContentFrame; auto overlayFrame = new RiuQwtLegendOverlayContentFrame;
overlayFrame->setLegend( legend ); overlayFrame->setLegend( legend );
legendFrame->setContentFrame( overlayFrame ); legendFrame->setContentFrame( overlayFrame );
legendFrame->setAnchorCorner( RiuDraggableOverlayFrame::AnchorCorner::TopRight ); legendFrame->setAnchorCorner( anchor );
plotWidget->removeOverlayFrame( legendFrame ); plotWidget->removeOverlayFrame( legendFrame );
plotWidget->addOverlayFrame( legendFrame ); plotWidget->addOverlayFrame( legendFrame );
} }
@ -769,7 +780,8 @@ void RiuMultiPlotPage::updateLegendVisibility( RiuPlotWidget* plotWid
updateLegendFont( legend ); updateLegendFont( legend );
legend->show(); legend->show();
if ( m_plotDefinition->legendPosition() == RimPlotWindow::LegendPosition::INSIDE ) if ( m_plotDefinition->legendPosition() == RimPlotWindow::LegendPosition::INSIDE_UPPER_LEFT ||
m_plotDefinition->legendPosition() == RimPlotWindow::LegendPosition::INSIDE_UPPER_RIGHT )
{ {
plotWidget->addOverlayFrame( legendFrame ); plotWidget->addOverlayFrame( legendFrame );
legendFrame->show(); legendFrame->show();

View File

@ -51,7 +51,12 @@ RiuQwtPlotLegend::RiuQwtPlotLegend( QWidget* parent /*= nullptr */ )
void RiuQwtPlotLegend::resizeEvent( QResizeEvent* event ) void RiuQwtPlotLegend::resizeEvent( QResizeEvent* event )
{ {
QWidget::resizeEvent( event ); QWidget::resizeEvent( event );
QSize size = event->size();
QSize size = event->size();
// Avoid updating geometry if height is very small
if ( size.height() < 10 ) return;
const QwtDynGridLayout* legendLayout = qobject_cast<QwtDynGridLayout*>( contentsWidget()->layout() ); const QwtDynGridLayout* legendLayout = qobject_cast<QwtDynGridLayout*>( contentsWidget()->layout() );
if ( legendLayout ) if ( legendLayout )
{ {

View File

@ -2,6 +2,7 @@
#include "RimDepthTrackPlot.h" #include "RimDepthTrackPlot.h"
#include "RimPlotWindow.h" #include "RimPlotWindow.h"
#include "RimWellLogTrack.h"
#include "RiuQwtPlotWidget.h" #include "RiuQwtPlotWidget.h"
#include "RiuWellLogTrack.h" #include "RiuWellLogTrack.h"
@ -39,7 +40,7 @@ RiuWellLogPlot::RiuWellLogPlot( RimDepthTrackPlot* plotDefinition, QWidget* pare
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RimDepthTrackPlot* RiuWellLogPlot::depthTrackPlot() RimDepthTrackPlot* RiuWellLogPlot::depthTrackPlot() const
{ {
auto* wellLogPlot = dynamic_cast<RimDepthTrackPlot*>( m_plotDefinition.p() ); auto* wellLogPlot = dynamic_cast<RimDepthTrackPlot*>( m_plotDefinition.p() );
CAF_ASSERT( wellLogPlot ); CAF_ASSERT( wellLogPlot );
@ -101,7 +102,25 @@ void RiuWellLogPlot::renderTo( QPaintDevice* paintDevice )
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RiuWellLogPlot::showYAxis( int row, int column ) const bool RiuWellLogPlot::showYAxis( int row, int column ) const
{ {
return column == 0; if ( depthTrackPlot() )
{
if ( depthTrackPlot()->depthOrientation() == RimDepthTrackPlot::DepthOrientation::VERTICAL )
{
return column == 0;
}
auto index = static_cast<size_t>( std::max( row, column ) );
if ( index < depthTrackPlot()->plots().size() )
{
auto track = dynamic_cast<RimWellLogTrack*>( depthTrackPlot()->plotByIndex( index ) );
if ( track )
{
return track->isPropertyAxisEnabled();
}
}
}
return true;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -41,7 +41,7 @@ protected:
void alignScrollbar( int offset ); void alignScrollbar( int offset );
private: private:
RimDepthTrackPlot* depthTrackPlot(); RimDepthTrackPlot* depthTrackPlot() const;
private slots: private slots:
void slotSetMinDepth( int value ); void slotSetMinDepth( int value );