mirror of
https://github.com/OPM/ResInsight.git
synced 2026-11-02 09:00:14 -06:00
#12008 Improve display of curves from selected cells in 3D view
* Remove obsolete base class * Add conversion between one/zero-based IJK * Move code to RiaTextStringTools * Add automatic update of grid cell curves when clicking in 3D view * Fix missing conversion to QString
This commit is contained in:
1 parent
f743957b0a
commit
860588d755
29 files changed
+402
-272
No files matched your search
+19
-26
@@ -53,31 +53,6 @@
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicNewGridTimeHistoryCurveFeature, "RicNewGridTimeHistoryCurveFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewGridTimeHistoryCurveFeature::createCurveFromSelectionItem( const RiuSelectionItem* selectionItem, RimSummaryPlot* plot )
|
||||
{
|
||||
CVF_ASSERT( selectionItem );
|
||||
CVF_ASSERT( plot );
|
||||
|
||||
RimGridTimeHistoryCurve* newCurve = new RimGridTimeHistoryCurve();
|
||||
newCurve->setFromSelectionItem( selectionItem );
|
||||
newCurve->setLineThickness( 2 );
|
||||
|
||||
cvf::Color3f curveColor = RicWellLogPlotCurveFeatureImpl::curveColorFromTable( plot->curveCount() );
|
||||
newCurve->setColor( curveColor );
|
||||
|
||||
plot->addGridTimeHistoryCurve( newCurve );
|
||||
|
||||
newCurve->loadDataAndUpdate( true );
|
||||
|
||||
plot->updateConnectedEditors();
|
||||
|
||||
RiuPlotMainWindowTools::showPlotMainWindow();
|
||||
RiuPlotMainWindowTools::selectAsCurrentItem( newCurve );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -92,10 +67,28 @@ RimSummaryPlot* RicNewGridTimeHistoryCurveFeature::userSelectedSummaryPlot()
|
||||
QString lastUsedPlotRef = app->cacheDataObject( lastUsedSummaryPlotKey ).toString();
|
||||
RimSummaryPlot* lastUsedPlot =
|
||||
dynamic_cast<RimSummaryPlot*>( caf::PdmReferenceHelper::objectFromReference( app->project(), lastUsedPlotRef ) );
|
||||
|
||||
if ( lastUsedPlot )
|
||||
{
|
||||
defaultSelectedPlot = lastUsedPlot;
|
||||
}
|
||||
else
|
||||
{
|
||||
auto getFirstSummaryPlot = []() -> RimSummaryPlot*
|
||||
{
|
||||
auto summaryPlotColl = RiaSummaryTools::summaryMultiPlotCollection();
|
||||
for ( auto multiPlot : summaryPlotColl->multiPlots() )
|
||||
{
|
||||
for ( auto summaryPlot : multiPlot->summaryPlots() )
|
||||
{
|
||||
return summaryPlot;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
};
|
||||
|
||||
defaultSelectedPlot = getFirstSummaryPlot();
|
||||
}
|
||||
}
|
||||
|
||||
RicSelectSummaryPlotUI featureUi;
|
||||
@@ -250,7 +243,7 @@ void RicNewGridTimeHistoryCurveFeature::onActionTriggered( bool isChecked )
|
||||
|
||||
for ( auto item : items )
|
||||
{
|
||||
RicNewGridTimeHistoryCurveFeature::createCurveFromSelectionItem( item, summaryPlot );
|
||||
RimGridTimeHistoryCurve::createCurveFromSelectionItem( item, summaryPlot );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@ protected:
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
|
||||
private:
|
||||
static void createCurveFromSelectionItem( const RiuSelectionItem* selectionItem, RimSummaryPlot* plot );
|
||||
static RimSummaryPlot* userSelectedSummaryPlot();
|
||||
static QString suggestedNewPlotName();
|
||||
};
|
||||
Reference in new issue
Block a user