mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge remote-tracking branch 'origin/dev' into summary-template-adjustments
This commit is contained in:
@@ -61,8 +61,10 @@ void RicCreatePlotFromTemplateByShortcutFeature::onActionTriggered( bool isCheck
|
|||||||
|
|
||||||
if ( reply == QMessageBox::No ) return;
|
if ( reply == QMessageBox::No ) return;
|
||||||
|
|
||||||
QString fileName = RicSummaryPlotTemplateTools::selectPlotTemplatePath();
|
QString fileNameSelectedInUi = RicSummaryPlotTemplateTools::selectPlotTemplatePath();
|
||||||
|
if ( fileNameSelectedInUi.isEmpty() ) return;
|
||||||
|
|
||||||
|
fileName = fileNameSelectedInUi;
|
||||||
RiaApplication::instance()->preferences()->setDefaultPlotTemplatePath( fileName );
|
RiaApplication::instance()->preferences()->setDefaultPlotTemplatePath( fileName );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -240,8 +240,6 @@ QString RicSummaryPlotTemplateTools::htmlTextFromCount( const QString& itemText,
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QString RicSummaryPlotTemplateTools::selectPlotTemplatePath()
|
QString RicSummaryPlotTemplateTools::selectPlotTemplatePath()
|
||||||
{
|
{
|
||||||
QString fileName;
|
|
||||||
|
|
||||||
RiuPlotMainWindow* plotwindow = RiaGuiApplication::instance()->mainPlotWindow();
|
RiuPlotMainWindow* plotwindow = RiaGuiApplication::instance()->mainPlotWindow();
|
||||||
RicSelectPlotTemplateUi* ui = RiaGuiApplication::instance()->project()->dialogData()->selectPlotTemplateUi();
|
RicSelectPlotTemplateUi* ui = RiaGuiApplication::instance()->project()->dialogData()->selectPlotTemplateUi();
|
||||||
|
|
||||||
|
|||||||
@@ -659,9 +659,9 @@ void RicSummaryPlotFeatureImpl::createSummaryPlotsFromArgumentLine( const QStrin
|
|||||||
// Needed to avoid unneccessary activation of sub windows (plots)
|
// Needed to avoid unneccessary activation of sub windows (plots)
|
||||||
// which results in population of property editor, and missing deleteLater because we are outside any event
|
// which results in population of property editor, and missing deleteLater because we are outside any event
|
||||||
// loop when switching object. Results in stray widgets.
|
// loop when switching object. Results in stray widgets.
|
||||||
mpw->setBlockSlotSubWindowActivated( true );
|
mpw->setBlockSubWindowProjectTreeSelection( true );
|
||||||
RiuPlotMainWindowTools::showPlotMainWindow();
|
RiuPlotMainWindowTools::showPlotMainWindow();
|
||||||
mpw->setBlockSlotSubWindowActivated( false );
|
mpw->setBlockSubWindowProjectTreeSelection( false );
|
||||||
RiuPlotMainWindowTools::setExpanded( lastPlotCreated );
|
RiuPlotMainWindowTools::setExpanded( lastPlotCreated );
|
||||||
RiuPlotMainWindowTools::selectAsCurrentItem( lastPlotCreated );
|
RiuPlotMainWindowTools::selectAsCurrentItem( lastPlotCreated );
|
||||||
|
|
||||||
|
|||||||
@@ -236,7 +236,7 @@ void RimWellFlowRateCurve::updateStackedPlotData()
|
|||||||
stackedCurves = stackedCurveGroups[groupId()];
|
stackedCurves = stackedCurveGroups[groupId()];
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<double> allDepthValues = m_curveData->measuredDepths();
|
std::vector<double> allDepthValues = curveData()->measuredDepths();
|
||||||
std::vector<double> allStackedValues( allDepthValues.size() );
|
std::vector<double> allStackedValues( allDepthValues.size() );
|
||||||
|
|
||||||
for ( RimWellFlowRateCurve* stCurve : stackedCurves )
|
for ( RimWellFlowRateCurve* stCurve : stackedCurves )
|
||||||
@@ -305,6 +305,9 @@ void RimWellFlowRateCurve::updateStackedPlotData()
|
|||||||
polyLineStartStopIndices.front().second += 1;
|
polyLineStartStopIndices.front().second += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto minmax_it = std::minmax_element( stackedValues.begin(), stackedValues.end() );
|
||||||
|
|
||||||
|
this->setOverrideCurveDataXRange( *( minmax_it.first ), *( minmax_it.second ) );
|
||||||
m_qwtPlotCurve->setSamples( stackedValues.data(), depthValues.data(), static_cast<int>( depthValues.size() ) );
|
m_qwtPlotCurve->setSamples( stackedValues.data(), depthValues.data(), static_cast<int>( depthValues.size() ) );
|
||||||
m_qwtPlotCurve->setLineSegmentStartStopIndices( polyLineStartStopIndices );
|
m_qwtPlotCurve->setLineSegmentStartStopIndices( polyLineStartStopIndices );
|
||||||
|
|
||||||
@@ -344,9 +347,7 @@ void RimWellFlowRateCurve::setFlowValuesPrDepthValue( const QString&
|
|||||||
const std::vector<double>& depthValues,
|
const std::vector<double>& depthValues,
|
||||||
const std::vector<double>& flowRates )
|
const std::vector<double>& flowRates )
|
||||||
{
|
{
|
||||||
m_curveData = new RigWellLogCurveData;
|
this->setValuesAndMD( flowRates, depthValues, RiaDefines::UNIT_NONE, false );
|
||||||
|
|
||||||
m_curveData->setValuesAndMD( flowRates, depthValues, RiaDefines::UNIT_NONE, false );
|
|
||||||
|
|
||||||
m_curveAutoName = curveName;
|
m_curveAutoName = curveName;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -893,9 +893,10 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
|||||||
else if ( dynamic_cast<RimWellLogPlot*>( uiItem ) )
|
else if ( dynamic_cast<RimWellLogPlot*>( uiItem ) )
|
||||||
{
|
{
|
||||||
menuBuilder << "RicAsciiExportWellLogPlotFeature";
|
menuBuilder << "RicAsciiExportWellLogPlotFeature";
|
||||||
|
menuBuilder << "RicExportToLasFileFeature";
|
||||||
|
menuBuilder << "RicChangeDataSourceFeature";
|
||||||
}
|
}
|
||||||
else if ( dynamic_cast<RimWellLogCurve*>( uiItem ) || dynamic_cast<RimWellLogTrack*>( uiItem ) ||
|
else if ( dynamic_cast<RimWellLogCurve*>( uiItem ) || dynamic_cast<RimWellLogTrack*>( uiItem ) )
|
||||||
dynamic_cast<RimWellLogPlot*>( uiItem ) )
|
|
||||||
{
|
{
|
||||||
menuBuilder << "RicExportToLasFileFeature";
|
menuBuilder << "RicExportToLasFileFeature";
|
||||||
menuBuilder << "RicChangeDataSourceFeature";
|
menuBuilder << "RicChangeDataSourceFeature";
|
||||||
|
|||||||
@@ -49,6 +49,10 @@ RimWellLogCurve::RimWellLogCurve()
|
|||||||
m_qwtPlotCurve->setXAxis( QwtPlot::xTop );
|
m_qwtPlotCurve->setXAxis( QwtPlot::xTop );
|
||||||
m_qwtPlotCurve->setErrorBarsXAxis( QwtPlot::xTop );
|
m_qwtPlotCurve->setErrorBarsXAxis( QwtPlot::xTop );
|
||||||
m_qwtPlotCurve->setYAxis( QwtPlot::yLeft );
|
m_qwtPlotCurve->setYAxis( QwtPlot::yLeft );
|
||||||
|
|
||||||
|
m_curveData = new RigWellLogCurveData;
|
||||||
|
m_curveDataXRange = std::make_pair( std::numeric_limits<double>::infinity(),
|
||||||
|
-std::numeric_limits<double>::infinity() );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -67,25 +71,44 @@ bool RimWellLogCurve::xValueRangeInData( double* minimumValue, double* maximumVa
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ( m_curveData->xValues().empty() )
|
|
||||||
|
if ( m_curveDataXRange.first == -std::numeric_limits<double>::infinity() ||
|
||||||
|
m_curveDataXRange.second == std::numeric_limits<double>::infinity() )
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
*minimumValue = std::numeric_limits<double>::infinity();
|
*minimumValue = m_curveDataXRange.first;
|
||||||
*maximumValue = -std::numeric_limits<double>::infinity();
|
*maximumValue = m_curveDataXRange.second;
|
||||||
|
|
||||||
for ( double xValue : m_curveData->xValues() )
|
|
||||||
{
|
|
||||||
if ( RiaCurveDataTools::isValidValue( xValue, false ) )
|
|
||||||
{
|
|
||||||
*minimumValue = std::min( *minimumValue, xValue );
|
|
||||||
*maximumValue = std::max( *maximumValue, xValue );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimWellLogCurve::setValuesAndMD( const std::vector<double>& xValues,
|
||||||
|
const std::vector<double>& measuredDepths,
|
||||||
|
RiaDefines::DepthUnitType depthUnit,
|
||||||
|
bool isExtractionCurve )
|
||||||
|
{
|
||||||
|
m_curveData->setValuesAndMD( xValues, measuredDepths, depthUnit, isExtractionCurve );
|
||||||
|
calculateCurveDataXRange();
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimWellLogCurve::setValuesWithTVD( const std::vector<double>& xValues,
|
||||||
|
const std::vector<double>& measuredDepths,
|
||||||
|
const std::vector<double>& tvDepths,
|
||||||
|
RiaDefines::DepthUnitType depthUnit,
|
||||||
|
bool isExtractionCurve )
|
||||||
|
{
|
||||||
|
m_curveData->setValuesWithTVD( xValues, measuredDepths, tvDepths, depthUnit, isExtractionCurve );
|
||||||
|
calculateCurveDataXRange();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -127,3 +150,30 @@ void RimWellLogCurve::updateLegendsInPlot()
|
|||||||
wellLogTrack->updateAllLegendItems();
|
wellLogTrack->updateAllLegendItems();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimWellLogCurve::setOverrideCurveDataXRange( double minimumValue, double maximumValue )
|
||||||
|
{
|
||||||
|
m_curveDataXRange = std::make_pair( minimumValue, maximumValue );
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimWellLogCurve::calculateCurveDataXRange()
|
||||||
|
{
|
||||||
|
// Invalidate range first
|
||||||
|
m_curveDataXRange = std::make_pair( std::numeric_limits<double>::infinity(),
|
||||||
|
-std::numeric_limits<double>::infinity() );
|
||||||
|
|
||||||
|
for ( double xValue : m_curveData->xValues() )
|
||||||
|
{
|
||||||
|
if ( RiaCurveDataTools::isValidValue( xValue, false ) )
|
||||||
|
{
|
||||||
|
m_curveDataXRange.first = std::min( m_curveDataXRange.first, xValue );
|
||||||
|
m_curveDataXRange.second = std::max( m_curveDataXRange.second, xValue );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "RiaDefines.h"
|
||||||
#include "RimPlotCurve.h"
|
#include "RimPlotCurve.h"
|
||||||
|
|
||||||
#include "cvfObject.h"
|
#include "cvfObject.h"
|
||||||
@@ -40,6 +41,17 @@ public:
|
|||||||
|
|
||||||
bool xValueRangeInData( double* minimumValue, double* maximumValue ) const;
|
bool xValueRangeInData( double* minimumValue, double* maximumValue ) const;
|
||||||
|
|
||||||
|
void setValuesAndMD( const std::vector<double>& xValues,
|
||||||
|
const std::vector<double>& measuredDepths,
|
||||||
|
RiaDefines::DepthUnitType depthUnit,
|
||||||
|
bool isExtractionCurve );
|
||||||
|
|
||||||
|
void setValuesWithTVD( const std::vector<double>& xValues,
|
||||||
|
const std::vector<double>& measuredDepths,
|
||||||
|
const std::vector<double>& tvDepths,
|
||||||
|
RiaDefines::DepthUnitType depthUnit,
|
||||||
|
bool isExtractionCurve );
|
||||||
|
|
||||||
const RigWellLogCurveData* curveData() const;
|
const RigWellLogCurveData* curveData() const;
|
||||||
|
|
||||||
virtual QString wellName() const = 0;
|
virtual QString wellName() const = 0;
|
||||||
@@ -52,7 +64,12 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
void updateZoomInParentPlot() override;
|
void updateZoomInParentPlot() override;
|
||||||
void updateLegendsInPlot() override;
|
void updateLegendsInPlot() override;
|
||||||
|
void setOverrideCurveDataXRange( double minimumValue, double maximumValue );
|
||||||
|
|
||||||
protected:
|
private:
|
||||||
|
void calculateCurveDataXRange();
|
||||||
|
|
||||||
|
private:
|
||||||
cvf::ref<RigWellLogCurveData> m_curveData;
|
cvf::ref<RigWellLogCurveData> m_curveData;
|
||||||
|
std::pair<double, double> m_curveDataXRange;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -349,19 +349,19 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
|||||||
|
|
||||||
if ( wellLogPlot->depthType() == RimWellLogPlot::TRUE_VERTICAL_DEPTH )
|
if ( wellLogPlot->depthType() == RimWellLogPlot::TRUE_VERTICAL_DEPTH )
|
||||||
{
|
{
|
||||||
m_qwtPlotCurve->setSamples( m_curveData->xPlotValues().data(),
|
m_qwtPlotCurve->setSamples( curveData()->xPlotValues().data(),
|
||||||
m_curveData->trueDepthPlotValues( displayUnit ).data(),
|
curveData()->trueDepthPlotValues( displayUnit ).data(),
|
||||||
static_cast<int>( m_curveData->xPlotValues().size() ) );
|
static_cast<int>( curveData()->xPlotValues().size() ) );
|
||||||
isUsingPseudoLength = false;
|
isUsingPseudoLength = false;
|
||||||
}
|
}
|
||||||
else if ( wellLogPlot->depthType() == RimWellLogPlot::MEASURED_DEPTH )
|
else if ( wellLogPlot->depthType() == RimWellLogPlot::MEASURED_DEPTH )
|
||||||
{
|
{
|
||||||
m_qwtPlotCurve->setSamples( m_curveData->xPlotValues().data(),
|
m_qwtPlotCurve->setSamples( curveData()->xPlotValues().data(),
|
||||||
m_curveData->measuredDepthPlotValues( displayUnit ).data(),
|
curveData()->measuredDepthPlotValues( displayUnit ).data(),
|
||||||
static_cast<int>( m_curveData->xPlotValues().size() ) );
|
static_cast<int>( curveData()->xPlotValues().size() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_qwtPlotCurve->setLineSegmentStartStopIndices( m_curveData->polylineStartStopIndices() );
|
m_qwtPlotCurve->setLineSegmentStartStopIndices( curveData()->polylineStartStopIndices() );
|
||||||
|
|
||||||
this->RimPlotCurve::updateCurvePresentation( updateParentPlot );
|
this->RimPlotCurve::updateCurvePresentation( updateParentPlot );
|
||||||
|
|
||||||
@@ -497,16 +497,15 @@ void RimWellLogExtractionCurve::extractData( bool* isUsingPseudoLength )
|
|||||||
geomExtractor->curveData( m_geomResultDefinition->resultAddress(), m_timeStep, &values );
|
geomExtractor->curveData( m_geomResultDefinition->resultAddress(), m_timeStep, &values );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_curveData = new RigWellLogCurveData;
|
|
||||||
if ( values.size() && measuredDepthValues.size() )
|
if ( values.size() && measuredDepthValues.size() )
|
||||||
{
|
{
|
||||||
if ( !tvDepthValues.size() )
|
if ( !tvDepthValues.size() )
|
||||||
{
|
{
|
||||||
m_curveData->setValuesAndMD( values, measuredDepthValues, depthUnit, true );
|
this->setValuesAndMD( values, measuredDepthValues, depthUnit, true );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_curveData->setValuesWithTVD( values, measuredDepthValues, tvDepthValues, depthUnit, true );
|
this->setValuesWithTVD( values, measuredDepthValues, tvDepthValues, depthUnit, true );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,8 +77,6 @@ void RimWellLogFileCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
|||||||
|
|
||||||
if ( isCurveVisible() )
|
if ( isCurveVisible() )
|
||||||
{
|
{
|
||||||
m_curveData = new RigWellLogCurveData;
|
|
||||||
|
|
||||||
RimWellLogPlot* wellLogPlot;
|
RimWellLogPlot* wellLogPlot;
|
||||||
firstAncestorOrThisOfType( wellLogPlot );
|
firstAncestorOrThisOfType( wellLogPlot );
|
||||||
CVF_ASSERT( wellLogPlot );
|
CVF_ASSERT( wellLogPlot );
|
||||||
@@ -100,7 +98,7 @@ void RimWellLogFileCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
|||||||
|
|
||||||
if ( values.size() == measuredDepthValues.size() && values.size() == tvdMslValues.size() )
|
if ( values.size() == measuredDepthValues.size() && values.size() == tvdMslValues.size() )
|
||||||
{
|
{
|
||||||
m_curveData->setValuesWithTVD( values,
|
this->setValuesWithTVD( values,
|
||||||
measuredDepthValues,
|
measuredDepthValues,
|
||||||
tvdMslValues,
|
tvdMslValues,
|
||||||
wellLogFile->depthUnit(),
|
wellLogFile->depthUnit(),
|
||||||
@@ -124,7 +122,7 @@ void RimWellLogFileCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
|||||||
if ( values.size() == trueVerticeldepthValues.size() &&
|
if ( values.size() == trueVerticeldepthValues.size() &&
|
||||||
values.size() == measuredDepthValues.size() )
|
values.size() == measuredDepthValues.size() )
|
||||||
{
|
{
|
||||||
m_curveData->setValuesWithTVD( values,
|
this->setValuesWithTVD( values,
|
||||||
measuredDepthValues,
|
measuredDepthValues,
|
||||||
trueVerticeldepthValues,
|
trueVerticeldepthValues,
|
||||||
wellLogFile->depthUnit(),
|
wellLogFile->depthUnit(),
|
||||||
@@ -152,7 +150,7 @@ void RimWellLogFileCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
|||||||
{
|
{
|
||||||
if ( values.size() == measuredDepthValues.size() )
|
if ( values.size() == measuredDepthValues.size() )
|
||||||
{
|
{
|
||||||
m_curveData->setValuesAndMD( values, measuredDepthValues, wellLogFile->depthUnit(), false );
|
this->setValuesAndMD( values, measuredDepthValues, wellLogFile->depthUnit(), false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -170,17 +168,17 @@ void RimWellLogFileCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
|||||||
}
|
}
|
||||||
if ( wellLogPlot && wellLogPlot->depthType() == RimWellLogPlot::TRUE_VERTICAL_DEPTH )
|
if ( wellLogPlot && wellLogPlot->depthType() == RimWellLogPlot::TRUE_VERTICAL_DEPTH )
|
||||||
{
|
{
|
||||||
m_qwtPlotCurve->setSamples( m_curveData->xPlotValues().data(),
|
m_qwtPlotCurve->setSamples( this->curveData()->xPlotValues().data(),
|
||||||
m_curveData->trueDepthPlotValues( displayUnit ).data(),
|
this->curveData()->trueDepthPlotValues( displayUnit ).data(),
|
||||||
static_cast<int>( m_curveData->xPlotValues().size() ) );
|
static_cast<int>( this->curveData()->xPlotValues().size() ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_qwtPlotCurve->setSamples( m_curveData->xPlotValues().data(),
|
m_qwtPlotCurve->setSamples( this->curveData()->xPlotValues().data(),
|
||||||
m_curveData->measuredDepthPlotValues( displayUnit ).data(),
|
this->curveData()->measuredDepthPlotValues( displayUnit ).data(),
|
||||||
static_cast<int>( m_curveData->xPlotValues().size() ) );
|
static_cast<int>( this->curveData()->xPlotValues().size() ) );
|
||||||
}
|
}
|
||||||
m_qwtPlotCurve->setLineSegmentStartStopIndices( m_curveData->polylineStartStopIndices() );
|
m_qwtPlotCurve->setLineSegmentStartStopIndices( this->curveData()->polylineStartStopIndices() );
|
||||||
|
|
||||||
if ( updateParentPlot )
|
if ( updateParentPlot )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -372,8 +372,6 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
|||||||
|
|
||||||
if ( isCurveVisible() )
|
if ( isCurveVisible() )
|
||||||
{
|
{
|
||||||
m_curveData = new RigWellLogCurveData;
|
|
||||||
|
|
||||||
RimWellLogPlot* wellLogPlot;
|
RimWellLogPlot* wellLogPlot;
|
||||||
firstAncestorOrThisOfType( wellLogPlot );
|
firstAncestorOrThisOfType( wellLogPlot );
|
||||||
CVF_ASSERT( wellLogPlot );
|
CVF_ASSERT( wellLogPlot );
|
||||||
@@ -435,7 +433,7 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
|||||||
measuredDepthVector = tvDepthVector;
|
measuredDepthVector = tvDepthVector;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_curveData->setValuesWithTVD( values,
|
this->setValuesWithTVD( values,
|
||||||
measuredDepthVector,
|
measuredDepthVector,
|
||||||
tvDepthVector,
|
tvDepthVector,
|
||||||
RiaEclipseUnitTools::depthUnit( unitSystem ),
|
RiaEclipseUnitTools::depthUnit( unitSystem ),
|
||||||
@@ -451,8 +449,8 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
|||||||
{
|
{
|
||||||
m_qwtPlotCurve->showErrorBars( showErrorBarsInObservedData );
|
m_qwtPlotCurve->showErrorBars( showErrorBarsInObservedData );
|
||||||
m_qwtPlotCurve->setPerPointLabels( perPointLabels );
|
m_qwtPlotCurve->setPerPointLabels( perPointLabels );
|
||||||
m_qwtPlotCurve->setSamplesFromXValuesAndYValues( m_curveData->xPlotValues(),
|
m_qwtPlotCurve->setSamplesFromXValuesAndYValues( this->curveData()->xPlotValues(),
|
||||||
m_curveData->measuredDepthPlotValues( displayUnit ),
|
this->curveData()->measuredDepthPlotValues( displayUnit ),
|
||||||
errors,
|
errors,
|
||||||
false,
|
false,
|
||||||
RiuQwtPlotCurve::ERROR_ALONG_X_AXIS );
|
RiuQwtPlotCurve::ERROR_ALONG_X_AXIS );
|
||||||
@@ -486,14 +484,14 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
|||||||
{
|
{
|
||||||
m_qwtPlotCurve->showErrorBars( showErrorBarsInObservedData );
|
m_qwtPlotCurve->showErrorBars( showErrorBarsInObservedData );
|
||||||
m_qwtPlotCurve->setPerPointLabels( perPointLabels );
|
m_qwtPlotCurve->setPerPointLabels( perPointLabels );
|
||||||
m_qwtPlotCurve->setSamplesFromXValuesAndYValues( m_curveData->xPlotValues(),
|
m_qwtPlotCurve->setSamplesFromXValuesAndYValues( this->curveData()->xPlotValues(),
|
||||||
m_curveData->trueDepthPlotValues( displayUnit ),
|
this->curveData()->trueDepthPlotValues( displayUnit ),
|
||||||
errors,
|
errors,
|
||||||
false,
|
false,
|
||||||
RiuQwtPlotCurve::ERROR_ALONG_X_AXIS );
|
RiuQwtPlotCurve::ERROR_ALONG_X_AXIS );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_qwtPlotCurve->setLineSegmentStartStopIndices( m_curveData->polylineStartStopIndices() );
|
m_qwtPlotCurve->setLineSegmentStartStopIndices( this->curveData()->polylineStartStopIndices() );
|
||||||
|
|
||||||
if ( updateParentPlot )
|
if ( updateParentPlot )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -97,6 +97,8 @@
|
|||||||
#include <QTreeView>
|
#include <QTreeView>
|
||||||
#include <QUndoStack>
|
#include <QUndoStack>
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
@@ -1029,6 +1031,8 @@ QMdiSubWindow* RiuMainWindow::findMdiSubWindow( QWidget* viewer )
|
|||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimViewWindow* RiuMainWindow::findViewWindowFromSubWindow( QMdiSubWindow* subWindow )
|
RimViewWindow* RiuMainWindow::findViewWindowFromSubWindow( QMdiSubWindow* subWindow )
|
||||||
|
{
|
||||||
|
if ( subWindow )
|
||||||
{
|
{
|
||||||
std::vector<RimViewWindow*> allViewWindows;
|
std::vector<RimViewWindow*> allViewWindows;
|
||||||
RiaApplication::instance()->project()->descendantsIncludingThisOfType( allViewWindows );
|
RiaApplication::instance()->project()->descendantsIncludingThisOfType( allViewWindows );
|
||||||
@@ -1040,6 +1044,7 @@ RimViewWindow* RiuMainWindow::findViewWindowFromSubWindow( QMdiSubWindow* subWin
|
|||||||
return viewWindow;
|
return viewWindow;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1226,43 +1231,29 @@ void RiuMainWindow::slotViewFromBelow()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuMainWindow::slotSubWindowActivated( QMdiSubWindow* subWindow )
|
void RiuMainWindow::slotSubWindowActivated( QMdiSubWindow* subWindow )
|
||||||
{
|
{
|
||||||
if ( !subWindow ) return;
|
if ( blockSubWindowActivation() ) return;
|
||||||
if ( blockSlotSubWindowActivated() ) return;
|
|
||||||
|
|
||||||
RimProject* proj = RiaApplication::instance()->project();
|
|
||||||
if ( !proj ) return;
|
|
||||||
|
|
||||||
// Find the activated 3D view
|
|
||||||
|
|
||||||
Rim3dView* activatedView = nullptr;
|
|
||||||
|
|
||||||
std::vector<RimCase*> allCases;
|
|
||||||
proj->allCases( allCases );
|
|
||||||
|
|
||||||
for ( RimCase* reservoirCase : allCases )
|
|
||||||
{
|
|
||||||
if ( reservoirCase == nullptr ) continue;
|
|
||||||
|
|
||||||
std::vector<Rim3dView*> views = reservoirCase->views();
|
|
||||||
|
|
||||||
size_t viewIdx;
|
|
||||||
for ( viewIdx = 0; viewIdx < views.size(); viewIdx++ )
|
|
||||||
{
|
|
||||||
Rim3dView* riv = views[viewIdx];
|
|
||||||
|
|
||||||
if ( riv && riv->viewer() && riv->viewer()->layoutWidget() &&
|
|
||||||
riv->viewer()->layoutWidget()->parent() == subWindow )
|
|
||||||
{
|
|
||||||
activatedView = riv;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
Rim3dView* previousActiveReservoirView = RiaApplication::instance()->activeReservoirView();
|
Rim3dView* previousActiveReservoirView = RiaApplication::instance()->activeReservoirView();
|
||||||
|
Rim3dView* activatedView = dynamic_cast<Rim3dView*>( findViewWindowFromSubWindow( subWindow ) );
|
||||||
|
|
||||||
|
if ( !activatedView ) return;
|
||||||
RiaApplication::instance()->setActiveReservoirView( activatedView );
|
RiaApplication::instance()->setActiveReservoirView( activatedView );
|
||||||
|
|
||||||
|
if ( !blockSubWindowProjectTreeSelection() )
|
||||||
|
{
|
||||||
|
selectViewInProjectTree( previousActiveReservoirView, activatedView );
|
||||||
|
}
|
||||||
|
|
||||||
|
slotRefreshViewActions();
|
||||||
|
refreshAnimationActions();
|
||||||
|
refreshDrawStyleActions();
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RiuMainWindow::selectViewInProjectTree( const Rim3dView* previousActiveReservoirView, Rim3dView* activatedView )
|
||||||
|
{
|
||||||
bool is3dViewCurrentlySelected = false;
|
bool is3dViewCurrentlySelected = false;
|
||||||
if ( caf::SelectionManager::instance()->selectedItem() )
|
if ( caf::SelectionManager::instance()->selectedItem() )
|
||||||
{
|
{
|
||||||
@@ -1325,11 +1316,6 @@ void RiuMainWindow::slotSubWindowActivated( QMdiSubWindow* subWindow )
|
|||||||
m_projectTreeView->treeView()->setExpanded( newViewModelIndex, true );
|
m_projectTreeView->treeView()->setExpanded( newViewModelIndex, true );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
slotRefreshViewActions();
|
|
||||||
refreshAnimationActions();
|
|
||||||
refreshDrawStyleActions();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -1457,9 +1443,9 @@ void RiuMainWindow::selectedObjectsChanged()
|
|||||||
// Set focus in MDI area to this window if it exists
|
// Set focus in MDI area to this window if it exists
|
||||||
if ( selectedReservoirView->viewer() )
|
if ( selectedReservoirView->viewer() )
|
||||||
{
|
{
|
||||||
setBlockSlotSubWindowActivated( true );
|
setBlockSubWindowProjectTreeSelection( true );
|
||||||
setActiveViewer( selectedReservoirView->viewer()->layoutWidget() );
|
setActiveViewer( selectedReservoirView->viewer()->layoutWidget() );
|
||||||
setBlockSlotSubWindowActivated( false );
|
setBlockSubWindowProjectTreeSelection( false );
|
||||||
|
|
||||||
isActiveViewChanged = true;
|
isActiveViewChanged = true;
|
||||||
}
|
}
|
||||||
@@ -1976,7 +1962,7 @@ void RiuMainWindow::tileSubWindows()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Perform stable sort of list so we first sort by window position but retain activation order
|
// Perform stable sort of list so we first sort by window position but retain activation order
|
||||||
// for windows with the same position. Needs to be sorted in decreasing order for the workaround below.
|
// for windows with the same position.
|
||||||
windowList.sort( [this, viewLinker]( QMdiSubWindow* lhs, QMdiSubWindow* rhs ) {
|
windowList.sort( [this, viewLinker]( QMdiSubWindow* lhs, QMdiSubWindow* rhs ) {
|
||||||
RimViewWindow* lhsViewWindow = findViewWindowFromSubWindow( lhs );
|
RimViewWindow* lhsViewWindow = findViewWindowFromSubWindow( lhs );
|
||||||
RimViewWindow* rhsViewWindow = findViewWindowFromSubWindow( rhs );
|
RimViewWindow* rhsViewWindow = findViewWindowFromSubWindow( rhs );
|
||||||
@@ -1994,28 +1980,36 @@ void RiuMainWindow::tileSubWindows()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return lhs->frameGeometry().topLeft().rx() > rhs->frameGeometry().topLeft().rx();
|
if ( lhs->frameGeometry().topLeft().ry() == rhs->frameGeometry().topLeft().ry() )
|
||||||
|
{
|
||||||
|
return lhs->frameGeometry().topLeft().rx() < rhs->frameGeometry().topLeft().rx();
|
||||||
|
}
|
||||||
|
return lhs->frameGeometry().topLeft().ry() < rhs->frameGeometry().topLeft().ry();
|
||||||
} );
|
} );
|
||||||
|
|
||||||
// Based on workaround described here
|
// Based on workaround described here
|
||||||
// https://forum.qt.io/topic/50053/qmdiarea-tilesubwindows-always-places-widgets-in-activationhistoryorder-in-subwindowview-mode
|
// https://forum.qt.io/topic/50053/qmdiarea-tilesubwindows-always-places-widgets-in-activationhistoryorder-in-subwindowview-mode
|
||||||
|
|
||||||
bool prevActivationBlock = blockSlotSubWindowActivated();
|
bool prevActivationBlock = blockSubWindowActivation();
|
||||||
// Force activation order so they end up in the order of the loop.
|
|
||||||
m_mdiArea->setActivationOrder( QMdiArea::ActivationHistoryOrder );
|
|
||||||
QMdiSubWindow* a = m_mdiArea->activeSubWindow();
|
QMdiSubWindow* a = m_mdiArea->activeSubWindow();
|
||||||
|
|
||||||
setBlockSlotSubWindowActivated( true );
|
// Force activation order so they end up in the order of the loop.
|
||||||
for ( QMdiSubWindow* subWindow : windowList )
|
m_mdiArea->setActivationOrder( QMdiArea::ActivationHistoryOrder );
|
||||||
|
|
||||||
|
setBlockSubWindowActivation( true );
|
||||||
|
|
||||||
|
// Activate in reverse order
|
||||||
|
for ( auto it = windowList.rbegin(); it != windowList.rend(); ++it )
|
||||||
{
|
{
|
||||||
m_mdiArea->setActiveSubWindow( subWindow );
|
m_mdiArea->setActiveSubWindow( *it );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_mdiArea->tileSubWindows();
|
m_mdiArea->tileSubWindows();
|
||||||
// Set back the original activation order to avoid messing with the standard ordering
|
// Set back the original activation order to avoid messing with the standard ordering
|
||||||
m_mdiArea->setActivationOrder( currentActivationOrder );
|
m_mdiArea->setActivationOrder( currentActivationOrder );
|
||||||
m_mdiArea->setActiveSubWindow( a );
|
m_mdiArea->setActiveSubWindow( a );
|
||||||
setBlockSlotSubWindowActivated( prevActivationBlock );
|
setBlockSubWindowActivation( prevActivationBlock );
|
||||||
|
|
||||||
storeSubWindowTiling( true );
|
storeSubWindowTiling( true );
|
||||||
}
|
}
|
||||||
@@ -2034,6 +2028,7 @@ void RiuMainWindow::storeSubWindowTiling( bool tiled )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuMainWindow::clearWindowTiling()
|
void RiuMainWindow::clearWindowTiling()
|
||||||
{
|
{
|
||||||
|
setBlockSubWindowActivation( true );
|
||||||
QMdiArea::WindowOrder currentActivationOrder = m_mdiArea->activationOrder();
|
QMdiArea::WindowOrder currentActivationOrder = m_mdiArea->activationOrder();
|
||||||
|
|
||||||
for ( QMdiSubWindow* subWindow : m_mdiArea->subWindowList( currentActivationOrder ) )
|
for ( QMdiSubWindow* subWindow : m_mdiArea->subWindowList( currentActivationOrder ) )
|
||||||
@@ -2042,6 +2037,7 @@ void RiuMainWindow::clearWindowTiling()
|
|||||||
subWindow->showNormal();
|
subWindow->showNormal();
|
||||||
}
|
}
|
||||||
storeSubWindowTiling( false );
|
storeSubWindowTiling( false );
|
||||||
|
setBlockSubWindowActivation( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ class QSpinBox;
|
|||||||
class QTimer;
|
class QTimer;
|
||||||
class QUndoView;
|
class QUndoView;
|
||||||
|
|
||||||
|
class Rim3dView;
|
||||||
class RimCase;
|
class RimCase;
|
||||||
class RimViewWindow;
|
class RimViewWindow;
|
||||||
|
|
||||||
@@ -230,9 +231,10 @@ private slots:
|
|||||||
|
|
||||||
// Windows slots
|
// Windows slots
|
||||||
void slotBuildWindowActions();
|
void slotBuildWindowActions();
|
||||||
|
|
||||||
void slotSubWindowActivated( QMdiSubWindow* subWindow );
|
void slotSubWindowActivated( QMdiSubWindow* subWindow );
|
||||||
|
|
||||||
|
void selectViewInProjectTree( const Rim3dView* previousActiveReservoirView, Rim3dView* activatedView );
|
||||||
|
|
||||||
void selectedObjectsChanged();
|
void selectedObjectsChanged();
|
||||||
void customMenuRequested( const QPoint& pos );
|
void customMenuRequested( const QPoint& pos );
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,8 @@ RiuMainWindowBase::RiuMainWindowBase()
|
|||||||
: m_projectTreeView( nullptr )
|
: m_projectTreeView( nullptr )
|
||||||
, m_allowActiveViewChangeFromSelection( true )
|
, m_allowActiveViewChangeFromSelection( true )
|
||||||
, m_showFirstVisibleWindowMaximized( true )
|
, m_showFirstVisibleWindowMaximized( true )
|
||||||
, m_blockSlotSubWindowActivated( false )
|
, m_blockSubWindowActivation( false )
|
||||||
|
, m_blockSubWindowProjectTreeSelection( false )
|
||||||
{
|
{
|
||||||
setDockNestingEnabled( true );
|
setDockNestingEnabled( true );
|
||||||
}
|
}
|
||||||
@@ -216,17 +217,33 @@ void RiuMainWindowBase::enableShowFirstVisibleMdiWindowMaximized( bool enable )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuMainWindowBase::setBlockSlotSubWindowActivated( bool block )
|
void RiuMainWindowBase::setBlockSubWindowActivation( bool block )
|
||||||
{
|
{
|
||||||
m_blockSlotSubWindowActivated = block;
|
m_blockSubWindowActivation = block;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RiuMainWindowBase::blockSlotSubWindowActivated() const
|
bool RiuMainWindowBase::blockSubWindowActivation() const
|
||||||
{
|
{
|
||||||
return m_blockSlotSubWindowActivated;
|
return m_blockSubWindowActivation;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RiuMainWindowBase::setBlockSubWindowProjectTreeSelection( bool block )
|
||||||
|
{
|
||||||
|
m_blockSubWindowProjectTreeSelection = block;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RiuMainWindowBase::blockSubWindowProjectTreeSelection() const
|
||||||
|
{
|
||||||
|
return m_blockSubWindowProjectTreeSelection;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -75,8 +75,11 @@ public:
|
|||||||
virtual void clearWindowTiling() = 0;
|
virtual void clearWindowTiling() = 0;
|
||||||
virtual bool subWindowsAreTiled() const = 0;
|
virtual bool subWindowsAreTiled() const = 0;
|
||||||
|
|
||||||
void setBlockSlotSubWindowActivated( bool block );
|
void setBlockSubWindowActivation( bool block );
|
||||||
bool blockSlotSubWindowActivated() const;
|
bool blockSubWindowActivation() const;
|
||||||
|
|
||||||
|
void setBlockSubWindowProjectTreeSelection( bool block );
|
||||||
|
bool blockSubWindowProjectTreeSelection() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void removeViewerFromMdiArea( QMdiArea* mdiArea, QWidget* viewer );
|
void removeViewerFromMdiArea( QMdiArea* mdiArea, QWidget* viewer );
|
||||||
@@ -94,5 +97,6 @@ private:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_showFirstVisibleWindowMaximized;
|
bool m_showFirstVisibleWindowMaximized;
|
||||||
bool m_blockSlotSubWindowActivated;
|
bool m_blockSubWindowActivation;
|
||||||
|
bool m_blockSubWindowProjectTreeSelection;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ void RiuMdiArea::resizeEvent( QResizeEvent* resizeEvent )
|
|||||||
}
|
}
|
||||||
|
|
||||||
RiuMainWindowBase* mainWindow = dynamic_cast<RiuMainWindowBase*>( window() );
|
RiuMainWindowBase* mainWindow = dynamic_cast<RiuMainWindowBase*>( window() );
|
||||||
mainWindow->setBlockSlotSubWindowActivated( true );
|
mainWindow->setBlockSubWindowActivation( true );
|
||||||
|
|
||||||
// Workaround for Qt bug #51761: https://bugreports.qt.io/browse/QTBUG-51761
|
// Workaround for Qt bug #51761: https://bugreports.qt.io/browse/QTBUG-51761
|
||||||
// Set the first window to be the active window then perform resize event and set back.
|
// Set the first window to be the active window then perform resize event and set back.
|
||||||
@@ -70,7 +70,7 @@ void RiuMdiArea::resizeEvent( QResizeEvent* resizeEvent )
|
|||||||
|
|
||||||
setActiveSubWindow( a );
|
setActiveSubWindow( a );
|
||||||
|
|
||||||
mainWindow->setBlockSlotSubWindowActivated( false );
|
mainWindow->setBlockSubWindowActivation( false );
|
||||||
|
|
||||||
for ( auto subWindow : subWindowList() )
|
for ( auto subWindow : subWindowList() )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -446,7 +446,6 @@ void RiuPlotMainWindow::createDockPanels()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
QMdiSubWindow* RiuPlotMainWindow::findMdiSubWindow( QWidget* viewer )
|
QMdiSubWindow* RiuPlotMainWindow::findMdiSubWindow( QWidget* viewer )
|
||||||
{
|
{
|
||||||
QList<QMdiSubWindow*> subws = m_mdiArea->subWindowList();
|
QList<QMdiSubWindow*> subws = m_mdiArea->subWindowList();
|
||||||
@@ -462,6 +461,19 @@ QMdiSubWindow* RiuPlotMainWindow::findMdiSubWindow( QWidget* viewer )
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimViewWindow* RiuPlotMainWindow::findViewWindowFromSubWindow( QMdiSubWindow* subWindow )
|
||||||
|
{
|
||||||
|
RimProject* proj = RiaApplication::instance()->project();
|
||||||
|
if ( subWindow && proj )
|
||||||
|
{
|
||||||
|
return RiuInterfaceToViewWindow::viewWindowFromWidget( subWindow->widget() );
|
||||||
|
}
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -643,20 +655,16 @@ void RiuPlotMainWindow::setPdmRoot( caf::PdmObject* pdmRoot )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuPlotMainWindow::slotSubWindowActivated( QMdiSubWindow* subWindow )
|
void RiuPlotMainWindow::slotSubWindowActivated( QMdiSubWindow* subWindow )
|
||||||
{
|
{
|
||||||
if ( !subWindow ) return;
|
if ( blockSubWindowActivation() ) return;
|
||||||
if ( blockSlotSubWindowActivated() ) return;
|
|
||||||
|
|
||||||
RimProject* proj = RiaApplication::instance()->project();
|
RimViewWindow* activatedView = findViewWindowFromSubWindow( subWindow );
|
||||||
if ( !proj ) return;
|
|
||||||
|
|
||||||
// Select in Project Tree
|
if ( !activatedView ) return;
|
||||||
|
m_activePlotViewWindow = activatedView;
|
||||||
|
|
||||||
RimViewWindow* viewWindow = RiuInterfaceToViewWindow::viewWindowFromWidget( subWindow->widget() );
|
if ( !blockSubWindowProjectTreeSelection() )
|
||||||
|
|
||||||
if ( viewWindow && viewWindow != m_activePlotViewWindow )
|
|
||||||
{
|
{
|
||||||
selectAsCurrentItem( viewWindow );
|
selectAsCurrentItem( activatedView );
|
||||||
m_activePlotViewWindow = viewWindow;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
updateWellLogPlotToolBar();
|
updateWellLogPlotToolBar();
|
||||||
@@ -752,9 +760,9 @@ void RiuPlotMainWindow::selectedObjectsChanged()
|
|||||||
{
|
{
|
||||||
if ( selectedWindow->viewWidget() )
|
if ( selectedWindow->viewWidget() )
|
||||||
{
|
{
|
||||||
setBlockSlotSubWindowActivated( true );
|
setBlockSubWindowProjectTreeSelection( true );
|
||||||
setActiveViewer( selectedWindow->viewWidget() );
|
setActiveViewer( selectedWindow->viewWidget() );
|
||||||
setBlockSlotSubWindowActivated( false );
|
setBlockSubWindowProjectTreeSelection( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_activePlotViewWindow = selectedWindow;
|
m_activePlotViewWindow = selectedWindow;
|
||||||
@@ -844,26 +852,35 @@ void RiuPlotMainWindow::tileSubWindows()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Perform stable sort of list so we first sort by window position but retain activation order
|
// Perform stable sort of list so we first sort by window position but retain activation order
|
||||||
// for windows with the same position. Needs to be sorted in decreasing order for workaround below.
|
// for windows with the same position.
|
||||||
windowList.sort( []( const QMdiSubWindow* lhs, const QMdiSubWindow* rhs ) {
|
windowList.sort( []( const QMdiSubWindow* lhs, const QMdiSubWindow* rhs ) {
|
||||||
return lhs->frameGeometry().topLeft().rx() > rhs->frameGeometry().topLeft().rx();
|
if ( lhs->frameGeometry().topLeft().ry() == rhs->frameGeometry().topLeft().ry() )
|
||||||
|
{
|
||||||
|
return lhs->frameGeometry().topLeft().rx() < rhs->frameGeometry().topLeft().rx();
|
||||||
|
}
|
||||||
|
return lhs->frameGeometry().topLeft().ry() < rhs->frameGeometry().topLeft().ry();
|
||||||
} );
|
} );
|
||||||
|
|
||||||
// Based on workaround described here
|
// Based on workaround described here
|
||||||
// https://forum.qt.io/topic/50053/qmdiarea-tilesubwindows-always-places-widgets-in-activationhistoryorder-in-subwindowview-mode
|
// https://forum.qt.io/topic/50053/qmdiarea-tilesubwindows-always-places-widgets-in-activationhistoryorder-in-subwindowview-mode
|
||||||
|
|
||||||
QMdiSubWindow* a = m_mdiArea->activeSubWindow();
|
bool prevActivationBlock = blockSubWindowActivation();
|
||||||
// Force activation order so they end up in the order of the loop.
|
// Force activation order so they end up in the order of the loop.
|
||||||
m_mdiArea->setActivationOrder( QMdiArea::ActivationHistoryOrder );
|
m_mdiArea->setActivationOrder( QMdiArea::ActivationHistoryOrder );
|
||||||
for ( QMdiSubWindow* subWindow : windowList )
|
QMdiSubWindow* a = m_mdiArea->activeSubWindow();
|
||||||
|
|
||||||
|
setBlockSubWindowActivation( true );
|
||||||
|
// Activate in reverse order
|
||||||
|
for ( auto it = windowList.rbegin(); it != windowList.rend(); ++it )
|
||||||
{
|
{
|
||||||
m_mdiArea->setActiveSubWindow( subWindow );
|
m_mdiArea->setActiveSubWindow( *it );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_mdiArea->tileSubWindows();
|
m_mdiArea->tileSubWindows();
|
||||||
// Set back the original activation order to avoid messing with the standard ordering
|
// Set back the original activation order to avoid messing with the standard ordering
|
||||||
m_mdiArea->setActivationOrder( currentActivationOrder );
|
m_mdiArea->setActivationOrder( currentActivationOrder );
|
||||||
m_mdiArea->setActiveSubWindow( a );
|
m_mdiArea->setActiveSubWindow( a );
|
||||||
|
setBlockSubWindowActivation( prevActivationBlock );
|
||||||
|
|
||||||
storeSubWindowTiling( true );
|
storeSubWindowTiling( true );
|
||||||
}
|
}
|
||||||
@@ -882,6 +899,7 @@ void RiuPlotMainWindow::storeSubWindowTiling( bool tiled )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuPlotMainWindow::clearWindowTiling()
|
void RiuPlotMainWindow::clearWindowTiling()
|
||||||
{
|
{
|
||||||
|
setBlockSubWindowActivation( true );
|
||||||
QMdiArea::WindowOrder currentActivationOrder = m_mdiArea->activationOrder();
|
QMdiArea::WindowOrder currentActivationOrder = m_mdiArea->activationOrder();
|
||||||
|
|
||||||
for ( QMdiSubWindow* subWindow : m_mdiArea->subWindowList( currentActivationOrder ) )
|
for ( QMdiSubWindow* subWindow : m_mdiArea->subWindowList( currentActivationOrder ) )
|
||||||
@@ -890,6 +908,7 @@ void RiuPlotMainWindow::clearWindowTiling()
|
|||||||
subWindow->showNormal();
|
subWindow->showNormal();
|
||||||
}
|
}
|
||||||
storeSubWindowTiling( false );
|
storeSubWindowTiling( false );
|
||||||
|
setBlockSubWindowActivation( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ public:
|
|||||||
|
|
||||||
bool isAnyMdiSubWindowVisible();
|
bool isAnyMdiSubWindowVisible();
|
||||||
QMdiSubWindow* findMdiSubWindow( QWidget* viewer ) override;
|
QMdiSubWindow* findMdiSubWindow( QWidget* viewer ) override;
|
||||||
|
RimViewWindow* findViewWindowFromSubWindow( QMdiSubWindow* subWindow );
|
||||||
QList<QMdiSubWindow*> subWindowList( QMdiArea::WindowOrder order );
|
QList<QMdiSubWindow*> subWindowList( QMdiArea::WindowOrder order );
|
||||||
|
|
||||||
void setWidthOfMdiWindow( QWidget* mdiWindowWidget, int newWidth );
|
void setWidthOfMdiWindow( QWidget* mdiWindowWidget, int newWidth );
|
||||||
|
|||||||
@@ -315,6 +315,14 @@ void RiuWellLogPlot::keyPressEvent( QKeyEvent* keyEvent )
|
|||||||
m_plotDefinition->handleKeyPressEvent( keyEvent );
|
m_plotDefinition->handleKeyPressEvent( keyEvent );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RiuWellLogPlot::resizeEvent( QResizeEvent* event )
|
||||||
|
{
|
||||||
|
QWidget::resizeEvent( event );
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ protected:
|
|||||||
void changeEvent( QEvent* event ) override;
|
void changeEvent( QEvent* event ) override;
|
||||||
void contextMenuEvent( QContextMenuEvent* ) override;
|
void contextMenuEvent( QContextMenuEvent* ) override;
|
||||||
void keyPressEvent( QKeyEvent* keyEvent ) override;
|
void keyPressEvent( QKeyEvent* keyEvent ) override;
|
||||||
|
void resizeEvent( QResizeEvent* event ) override;
|
||||||
|
|
||||||
QSize sizeHint() const override;
|
QSize sizeHint() const override;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user