Skip to content

Commit

Permalink
Show Plot Data: Add special handling for well log plots
Browse files Browse the repository at this point in the history
Well log plots do not derive from RimPlot, add special handling.
  • Loading branch information
magnesj committed Oct 18, 2023
1 parent af3c06b commit b8075af
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
Expand Down Expand Up @@ -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 );
}
}

//--------------------------------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions ApplicationLibCode/ProjectDataModel/RimDepthTrackPlot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

//--------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit b8075af

Please sign in to comment.