Show Plot Data: Add special handling for well log plots

Well log plots do not derive from RimPlot, add special handling.
This commit is contained in:
Magne Sjaastad
2023-10-18 08:50:04 +02:00
parent 09d6df74bf
commit 5f0f483025
2 changed files with 23 additions and 3 deletions

View File

@@ -233,6 +233,9 @@ void RicShowPlotDataFeature::onActionTriggered( bool isChecked )
// Using RiuTabbedGridCrossPlotTextProvider
std::vector<RimGridCrossPlot*> crossPlots;
// Special handling for well log plots
std::vector<RimWellLogPlot*> wellLogPlots;
// Show content using RimPlot::description() and RimPlot::asciiDataForPlotExport()
std::vector<RimPlot*> rimPlots;
@@ -250,6 +253,12 @@ void RicShowPlotDataFeature::onActionTriggered( bool isChecked )
continue;
}
if ( auto wellLogPlot = dynamic_cast<RimWellLogPlot*>( plot ) )
{
wellLogPlots.push_back( wellLogPlot );
continue;
}
if ( auto correlationReportPlot = dynamic_cast<RimCorrelationReportPlot*>( plot ) )
{
// A correlation report plot contains three plots. Add them as individual plots to rimPlots to make the data available in three
@@ -288,6 +297,17 @@ void RicShowPlotDataFeature::onActionTriggered( bool isChecked )
RicShowPlotDataFeature::showTextWindow( title, text );
}
for ( auto wellLogPlot : wellLogPlots )
{
QString title = wellLogPlot->description();
QString text = title;
text += "\n";
text += "\n";
text += wellLogPlot->asciiDataForPlotExport();
RicShowPlotDataFeature::showTextWindow( title, text );
}
}
//--------------------------------------------------------------------------------------------------

View File

@@ -896,17 +896,17 @@ void RimDepthTrackPlot::setAvailableDepthTypes( const std::set<DepthTypeEnum>& d
//--------------------------------------------------------------------------------------------------
QString RimDepthTrackPlot::asciiDataForPlotExport() const
{
QString out = description() + "\n";
QString plotContentAsText;
for ( RimPlot* plot : plots() )
{
if ( plot->showWindow() )
{
out += plot->asciiDataForPlotExport();
plotContentAsText += plot->asciiDataForPlotExport();
}
}
return out;
return plotContentAsText;
}
//--------------------------------------------------------------------------------------------------