#9364 Well Log Plot and Track: Activate and improve Show Plot Data

This commit is contained in:
Magne Sjaastad 2022-10-14 13:20:05 +02:00
parent 905b2abe53
commit c8d6e29447
3 changed files with 32 additions and 21 deletions

View File

@ -25,12 +25,13 @@
#include "RimGridCrossPlot.h" #include "RimGridCrossPlot.h"
#include "RimGridCrossPlotCurve.h" #include "RimGridCrossPlotCurve.h"
#include "RimPlot.h" #include "RimPlotWindow.h"
#include "RimProject.h" #include "RimProject.h"
#include "RimSummaryCrossPlot.h" #include "RimSummaryCrossPlot.h"
#include "RimSummaryPlot.h" #include "RimSummaryPlot.h"
#include "RimVfpPlot.h" #include "RimVfpPlot.h"
#include "RimWellLogPlot.h" #include "RimWellLogPlot.h"
#include "RimWellLogTrack.h"
#include "RiuPlotMainWindow.h" #include "RiuPlotMainWindow.h"
#include "RiuTextDialog.h" #include "RiuTextDialog.h"
@ -174,7 +175,7 @@ bool RicShowPlotDataFeature::isCommandEnabled()
return true; return true;
} }
std::vector<RimPlot*> selection; std::vector<RimPlotWindow*> selection;
getSelection( selection ); getSelection( selection );
int validPlots = 0; int validPlots = 0;
@ -186,9 +187,9 @@ bool RicShowPlotDataFeature::isCommandEnabled()
return false; return false;
} }
if ( dynamic_cast<RimSummaryPlot*>( plot ) != nullptr || if ( dynamic_cast<RimSummaryPlot*>( plot ) || dynamic_cast<RimWellLogPlot*>( plot ) ||
( dynamic_cast<RimWellLogPlot*>( plot ) != nullptr || dynamic_cast<RimGridCrossPlot*>( plot ) != nullptr || dynamic_cast<RimWellLogTrack*>( plot ) || dynamic_cast<RimGridCrossPlot*>( plot ) ||
dynamic_cast<RimVfpPlot*>( plot ) != nullptr ) ) dynamic_cast<RimVfpPlot*>( plot ) )
{ {
validPlots++; validPlots++;
} }
@ -217,46 +218,50 @@ void RicShowPlotDataFeature::onActionTriggered( bool isChecked )
this->disableModelChangeContribution(); this->disableModelChangeContribution();
std::vector<RimPlot*> selection; std::vector<RimPlotWindow*> selection;
getSelection( selection ); getSelection( selection );
std::vector<RimSummaryPlot*> selectedSummaryPlots; std::vector<RimSummaryPlot*> selectedSummaryPlots;
std::vector<RimWellLogPlot*> wellLogPlots; std::vector<RimWellLogPlot*> wellLogPlots;
std::vector<RimGridCrossPlot*> crossPlots; std::vector<RimGridCrossPlot*> crossPlots;
std::vector<RimVfpPlot*> vfpPlots; std::vector<RimVfpPlot*> vfpPlots;
std::vector<RimWellLogTrack*> depthTracks;
for ( auto plot : selection ) for ( auto plot : selection )
{ {
auto sumPlot = dynamic_cast<RimSummaryPlot*>( plot ); if ( auto sumPlot = dynamic_cast<RimSummaryPlot*>( plot ) )
if ( sumPlot )
{ {
selectedSummaryPlots.push_back( sumPlot ); selectedSummaryPlots.push_back( sumPlot );
continue; continue;
} }
auto wellPlot = dynamic_cast<RimWellLogPlot*>( plot ); if ( auto wellPlot = dynamic_cast<RimWellLogPlot*>( plot ) )
if ( wellPlot )
{ {
wellLogPlots.push_back( wellPlot ); wellLogPlots.push_back( wellPlot );
continue; continue;
} }
auto xPlot = dynamic_cast<RimGridCrossPlot*>( plot ); if ( auto xPlot = dynamic_cast<RimGridCrossPlot*>( plot ) )
if ( xPlot )
{ {
crossPlots.push_back( xPlot ); crossPlots.push_back( xPlot );
continue; continue;
} }
auto vfpPlot = dynamic_cast<RimVfpPlot*>( plot ); if ( auto vfpPlot = dynamic_cast<RimVfpPlot*>( plot ) )
if ( vfpPlot )
{ {
vfpPlots.push_back( vfpPlot ); vfpPlots.push_back( vfpPlot );
continue; continue;
} }
if ( auto depthTrack = dynamic_cast<RimWellLogTrack*>( plot ) )
{
depthTracks.push_back( depthTrack );
continue;
}
} }
if ( selectedSummaryPlots.empty() && wellLogPlots.empty() && crossPlots.empty() && vfpPlots.empty() ) if ( selectedSummaryPlots.empty() && wellLogPlots.empty() && crossPlots.empty() && vfpPlots.empty() &&
depthTracks.empty() )
{ {
CVF_ASSERT( false ); CVF_ASSERT( false );
@ -279,6 +284,13 @@ void RicShowPlotDataFeature::onActionTriggered( bool isChecked )
RicShowPlotDataFeature::showTextWindow( title, text ); RicShowPlotDataFeature::showTextWindow( title, text );
} }
for ( auto* plot : depthTracks )
{
QString title = plot->description();
QString text = plot->asciiDataForPlotExport();
RicShowPlotDataFeature::showTextWindow( title, text );
}
for ( RimVfpPlot* vfpPlot : vfpPlots ) for ( RimVfpPlot* vfpPlot : vfpPlots )
{ {
QString title = vfpPlot->description(); QString title = vfpPlot->description();
@ -339,14 +351,14 @@ void RicShowPlotDataFeature::showTextWindow( const QString& title, const QString
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RicShowPlotDataFeature::getSelection( std::vector<RimPlot*>& selection ) void RicShowPlotDataFeature::getSelection( std::vector<RimPlotWindow*>& selection )
{ {
if ( sender() ) if ( sender() )
{ {
QVariant userData = this->userData(); QVariant userData = this->userData();
if ( !userData.isNull() && userData.canConvert<void*>() ) if ( !userData.isNull() && userData.canConvert<void*>() )
{ {
RimPlot* plot = static_cast<RimPlot*>( userData.value<void*>() ); auto* plot = static_cast<RimPlotWindow*>( userData.value<void*>() );
if ( plot ) selection.push_back( plot ); if ( plot ) selection.push_back( plot );
} }
} }

View File

@ -20,11 +20,10 @@
#include "cafCmdFeature.h" #include "cafCmdFeature.h"
#include <functional>
#include <vector> #include <vector>
class RiuTabbedTextProvider; class RiuTabbedTextProvider;
class RimPlot; class RimPlotWindow;
//================================================================================================== //==================================================================================================
/// ///
@ -39,7 +38,7 @@ protected:
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
private: private:
void getSelection( std::vector<RimPlot*>& selection ); void getSelection( std::vector<RimPlotWindow*>& selection );
public: public:
static void showTabbedTextWindow( RiuTabbedTextProvider* textProvider ); static void showTabbedTextWindow( RiuTabbedTextProvider* textProvider );

View File

@ -1061,7 +1061,7 @@ QString RimWellLogTrack::asciiDataForPlotExport() const
out += QString::number( curveDepth, 'f', 3 ); out += QString::number( curveDepth, 'f', 3 );
for ( std::vector<double> plotVector : curvesPlotXValues ) for ( std::vector<double> plotVector : curvesPlotXValues )
{ {
out += " \t" + QString::number( plotVector[i], 'g' ); out += QString( " %1" ).arg( QString::number( plotVector[i], 'f', 3 ), 12 );
} }
out += "\n"; out += "\n";
} }