mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2448 Summary plot: Retain auto zoom for axes you haven't modified the range for.
This commit is contained in:
@@ -83,6 +83,7 @@ RimSummaryAxisProperties::RimSummaryAxisProperties()
|
|||||||
|
|
||||||
numberOfDecimals.uiCapability()->setUiEditorTypeName(caf::PdmUiSliderEditor::uiEditorTypeName());
|
numberOfDecimals.uiCapability()->setUiEditorTypeName(caf::PdmUiSliderEditor::uiEditorTypeName());
|
||||||
|
|
||||||
|
CAF_PDM_InitField(&m_isAutoZoom, "AutoZoom", true, "Set Range Automatically", "", "", "");
|
||||||
CAF_PDM_InitField(&isLogarithmicScaleEnabled, "LogarithmicScale", false, "Logarithmic Scale", "", "", "");
|
CAF_PDM_InitField(&isLogarithmicScaleEnabled, "LogarithmicScale", false, "Logarithmic Scale", "", "", "");
|
||||||
|
|
||||||
updateOptionSensitivity();
|
updateOptionSensitivity();
|
||||||
@@ -251,6 +252,22 @@ bool RimSummaryAxisProperties::showUnitText() const
|
|||||||
return m_displayUnitText();
|
return m_displayUnitText();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RimSummaryAxisProperties::isAutoZoom() const
|
||||||
|
{
|
||||||
|
return m_isAutoZoom();
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimSummaryAxisProperties::setAutoZoom(bool enableAutoZoom)
|
||||||
|
{
|
||||||
|
m_isAutoZoom = enableAutoZoom;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -278,13 +295,13 @@ void RimSummaryAxisProperties::fieldChangedByUi(const caf::PdmFieldHandle* chang
|
|||||||
{
|
{
|
||||||
if (visibleRangeMin > visibleRangeMax) visibleRangeMax = oldValue.toDouble();
|
if (visibleRangeMin > visibleRangeMax) visibleRangeMax = oldValue.toDouble();
|
||||||
|
|
||||||
rimSummaryPlot->disableAutoZoom();
|
m_isAutoZoom = false;
|
||||||
}
|
}
|
||||||
else if (changedField == &visibleRangeMin)
|
else if (changedField == &visibleRangeMin)
|
||||||
{
|
{
|
||||||
if (visibleRangeMin > visibleRangeMax) visibleRangeMin = oldValue.toDouble();
|
if (visibleRangeMin > visibleRangeMax) visibleRangeMin = oldValue.toDouble();
|
||||||
|
|
||||||
rimSummaryPlot->disableAutoZoom();
|
m_isAutoZoom = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (changedField == &isLogarithmicScaleEnabled)
|
if (changedField == &isLogarithmicScaleEnabled)
|
||||||
|
@@ -61,6 +61,8 @@ public:
|
|||||||
bool showDescription() const;
|
bool showDescription() const;
|
||||||
bool showAcronym() const;
|
bool showAcronym() const;
|
||||||
bool showUnitText() const;
|
bool showUnitText() const;
|
||||||
|
bool isAutoZoom() const;
|
||||||
|
void setAutoZoom(bool enableAutoZoom);
|
||||||
|
|
||||||
caf::PdmField<QString> customTitle;
|
caf::PdmField<QString> customTitle;
|
||||||
caf::PdmField<int> titleFontSize;
|
caf::PdmField<int> titleFontSize;
|
||||||
@@ -98,6 +100,7 @@ private:
|
|||||||
caf::PdmField<bool> m_displayShortName;
|
caf::PdmField<bool> m_displayShortName;
|
||||||
caf::PdmField<bool> m_displayLongName;
|
caf::PdmField<bool> m_displayLongName;
|
||||||
caf::PdmField<bool> m_displayUnitText;
|
caf::PdmField<bool> m_displayUnitText;
|
||||||
|
caf::PdmField<bool> m_isAutoZoom;
|
||||||
|
|
||||||
caf::PdmField<QString> m_name;
|
caf::PdmField<QString> m_name;
|
||||||
QwtPlot::Axis m_axis;
|
QwtPlot::Axis m_axis;
|
||||||
|
@@ -120,9 +120,9 @@ RimSummaryPlot::RimSummaryPlot()
|
|||||||
m_timeAxisProperties.uiCapability()->setUiTreeHidden(true);
|
m_timeAxisProperties.uiCapability()->setUiTreeHidden(true);
|
||||||
m_timeAxisProperties = new RimSummaryTimeAxisProperties;
|
m_timeAxisProperties = new RimSummaryTimeAxisProperties;
|
||||||
|
|
||||||
CAF_PDM_InitField(&m_isAutoZoom, "AutoZoom", true, "Auto Zoom", "", "", "");
|
CAF_PDM_InitField(&m_isAutoZoom_OBSOLETE, "AutoZoom", true, "Auto Zoom", "", "", "");
|
||||||
m_isAutoZoom.uiCapability()->setUiHidden(true);
|
m_isAutoZoom_OBSOLETE.uiCapability()->setUiHidden(true);
|
||||||
|
m_isAutoZoom_OBSOLETE.xmlCapability()->setIOWritable(false);
|
||||||
setAsPlotMdiWindow();
|
setAsPlotMdiWindow();
|
||||||
|
|
||||||
m_isCrossPlot = false;
|
m_isCrossPlot = false;
|
||||||
@@ -153,8 +153,6 @@ void RimSummaryPlot::updateAxes()
|
|||||||
updateAxis(RiaDefines::PLOT_AXIS_LEFT);
|
updateAxis(RiaDefines::PLOT_AXIS_LEFT);
|
||||||
updateAxis(RiaDefines::PLOT_AXIS_RIGHT);
|
updateAxis(RiaDefines::PLOT_AXIS_RIGHT);
|
||||||
|
|
||||||
updateZoomInQwt();
|
|
||||||
|
|
||||||
if (m_isCrossPlot)
|
if (m_isCrossPlot)
|
||||||
{
|
{
|
||||||
updateBottomXAxis();
|
updateBottomXAxis();
|
||||||
@@ -163,6 +161,8 @@ void RimSummaryPlot::updateAxes()
|
|||||||
{
|
{
|
||||||
updateTimeAxis();
|
updateTimeAxis();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateZoomInQwt();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -619,43 +619,79 @@ void RimSummaryPlot::updateAxis(RiaDefines::PlotAxis plotAxis)
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimSummaryPlot::updateZoomForAxis(RiaDefines::PlotAxis plotAxis)
|
void RimSummaryPlot::updateZoomForAxis(RiaDefines::PlotAxis plotAxis)
|
||||||
{
|
{
|
||||||
RimSummaryAxisProperties* yAxisProps = yAxisPropertiesLeftOrRight(plotAxis);
|
if (plotAxis == RiaDefines::PLOT_AXIS_BOTTOM)
|
||||||
|
|
||||||
if (yAxisProps->isLogarithmicScaleEnabled)
|
|
||||||
{
|
{
|
||||||
std::vector<double> yValues;
|
if (m_isCrossPlot)
|
||||||
std::vector<QwtPlotCurve*> plotCurves;
|
|
||||||
|
|
||||||
for (RimSummaryCurve* c : visibleSummaryCurvesForAxis(plotAxis))
|
|
||||||
{
|
{
|
||||||
std::vector<double> curveValues = c->valuesY();
|
if (m_bottomAxisProperties->isAutoZoom())
|
||||||
yValues.insert(yValues.end(), curveValues.begin(), curveValues.end());
|
{
|
||||||
plotCurves.push_back(c->qwtPlotCurve());
|
m_qwtPlot->setAxisAutoScale(QwtPlot::xBottom, true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_qwtPlot->setAxisScale(QwtPlot::xBottom, m_bottomAxisProperties->visibleRangeMin(), m_bottomAxisProperties->visibleRangeMax());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
for (RimGridTimeHistoryCurve* c : visibleTimeHistoryCurvesForAxis(plotAxis))
|
|
||||||
{
|
{
|
||||||
std::vector<double> curveValues = c->yValues();
|
if (m_timeAxisProperties->isAutoZoom())
|
||||||
yValues.insert(yValues.end(), curveValues.begin(), curveValues.end());
|
{
|
||||||
plotCurves.push_back(c->qwtPlotCurve());
|
m_qwtPlot->setAxisAutoScale(QwtPlot::xBottom, true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_qwtPlot->setAxisScale(QwtPlot::xBottom, m_timeAxisProperties->visibleRangeMin(), m_timeAxisProperties->visibleRangeMax());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (RimAsciiDataCurve* c : visibleAsciiDataCurvesForAxis(plotAxis))
|
|
||||||
{
|
|
||||||
std::vector<double> curveValues = c->yValues();
|
|
||||||
yValues.insert(yValues.end(), curveValues.begin(), curveValues.end());
|
|
||||||
plotCurves.push_back(c->qwtPlotCurve());
|
|
||||||
}
|
|
||||||
|
|
||||||
double min, max;
|
|
||||||
RimSummaryPlotYAxisRangeCalculator calc(plotCurves, yValues);
|
|
||||||
calc.computeYRange(&min, &max);
|
|
||||||
|
|
||||||
m_qwtPlot->setAxisScale(yAxisProps->qwtPlotAxisType(), min, max);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_qwtPlot->setAxisAutoScale(yAxisProps->qwtPlotAxisType(), true);
|
RimSummaryAxisProperties* yAxisProps = yAxisPropertiesLeftOrRight(plotAxis);
|
||||||
|
|
||||||
|
if (yAxisProps->isAutoZoom())
|
||||||
|
{
|
||||||
|
if (yAxisProps->isLogarithmicScaleEnabled)
|
||||||
|
{
|
||||||
|
std::vector<double> yValues;
|
||||||
|
std::vector<QwtPlotCurve*> plotCurves;
|
||||||
|
|
||||||
|
for (RimSummaryCurve* c : visibleSummaryCurvesForAxis(plotAxis))
|
||||||
|
{
|
||||||
|
std::vector<double> curveValues = c->valuesY();
|
||||||
|
yValues.insert(yValues.end(), curveValues.begin(), curveValues.end());
|
||||||
|
plotCurves.push_back(c->qwtPlotCurve());
|
||||||
|
}
|
||||||
|
|
||||||
|
for (RimGridTimeHistoryCurve* c : visibleTimeHistoryCurvesForAxis(plotAxis))
|
||||||
|
{
|
||||||
|
std::vector<double> curveValues = c->yValues();
|
||||||
|
yValues.insert(yValues.end(), curveValues.begin(), curveValues.end());
|
||||||
|
plotCurves.push_back(c->qwtPlotCurve());
|
||||||
|
}
|
||||||
|
|
||||||
|
for (RimAsciiDataCurve* c : visibleAsciiDataCurvesForAxis(plotAxis))
|
||||||
|
{
|
||||||
|
std::vector<double> curveValues = c->yValues();
|
||||||
|
yValues.insert(yValues.end(), curveValues.begin(), curveValues.end());
|
||||||
|
plotCurves.push_back(c->qwtPlotCurve());
|
||||||
|
}
|
||||||
|
|
||||||
|
double min, max;
|
||||||
|
RimSummaryPlotYAxisRangeCalculator calc(plotCurves, yValues);
|
||||||
|
calc.computeYRange(&min, &max);
|
||||||
|
|
||||||
|
m_qwtPlot->setAxisScale(yAxisProps->qwtPlotAxisType(), min, max);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_qwtPlot->setAxisAutoScale(yAxisProps->qwtPlotAxisType(), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_qwtPlot->setAxisScale(yAxisProps->qwtPlotAxisType(), yAxisProps->visibleRangeMin(), yAxisProps->visibleRangeMax());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -895,53 +931,15 @@ void RimSummaryPlot::updateCaseNameHasChanged()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RimSummaryPlot::setZoomWindow(const QwtInterval& leftAxis, const QwtInterval& rightAxis, const QwtInterval& timeAxis)
|
|
||||||
{
|
|
||||||
m_leftYAxisProperties->visibleRangeMax = leftAxis.maxValue();
|
|
||||||
m_leftYAxisProperties->visibleRangeMin = leftAxis.minValue();
|
|
||||||
m_leftYAxisProperties->updateConnectedEditors();
|
|
||||||
|
|
||||||
m_rightYAxisProperties->visibleRangeMax = rightAxis.maxValue();
|
|
||||||
m_rightYAxisProperties->visibleRangeMin = rightAxis.minValue();
|
|
||||||
m_rightYAxisProperties->updateConnectedEditors();
|
|
||||||
|
|
||||||
if (m_isCrossPlot)
|
|
||||||
{
|
|
||||||
m_bottomAxisProperties->visibleRangeMax = timeAxis.maxValue();
|
|
||||||
m_bottomAxisProperties->visibleRangeMin = timeAxis.minValue();
|
|
||||||
m_bottomAxisProperties->updateConnectedEditors();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_timeAxisProperties->setVisibleRangeMin(timeAxis.minValue());
|
|
||||||
m_timeAxisProperties->setVisibleRangeMax(timeAxis.maxValue());
|
|
||||||
m_timeAxisProperties->updateConnectedEditors();
|
|
||||||
}
|
|
||||||
|
|
||||||
disableAutoZoom();
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimSummaryPlot::zoomAll()
|
void RimSummaryPlot::zoomAll()
|
||||||
{
|
{
|
||||||
if (m_qwtPlot)
|
setAutoZoomForAllAxes(true);
|
||||||
{
|
updateZoomInQwt();
|
||||||
m_qwtPlot->setAxisAutoScale(QwtPlot::xBottom, true);
|
updateAxisRangesFromQwt();
|
||||||
|
|
||||||
updateZoomForAxis(RiaDefines::PLOT_AXIS_LEFT);
|
|
||||||
updateZoomForAxis(RiaDefines::PLOT_AXIS_RIGHT);
|
|
||||||
|
|
||||||
m_qwtPlot->replot();
|
|
||||||
}
|
|
||||||
|
|
||||||
updateZoomWindowFromQwt();
|
|
||||||
|
|
||||||
m_isAutoZoom = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -1260,42 +1258,15 @@ void RimSummaryPlot::onLoadDataAndUpdate()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimSummaryPlot::updateZoomInQwt()
|
void RimSummaryPlot::updateZoomInQwt()
|
||||||
{
|
{
|
||||||
if (!m_qwtPlot) return;
|
if (m_qwtPlot)
|
||||||
|
|
||||||
if (m_isAutoZoom)
|
|
||||||
{
|
{
|
||||||
zoomAll();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
setZoomIntervalsInQwtPlot();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
updateZoomForAxis(RiaDefines::PLOT_AXIS_BOTTOM);
|
||||||
///
|
updateZoomForAxis(RiaDefines::PLOT_AXIS_LEFT);
|
||||||
//--------------------------------------------------------------------------------------------------
|
updateZoomForAxis(RiaDefines::PLOT_AXIS_RIGHT);
|
||||||
void RimSummaryPlot::setZoomIntervalsInQwtPlot()
|
|
||||||
{
|
|
||||||
QwtInterval left, right, time;
|
|
||||||
|
|
||||||
left.setMinValue(m_leftYAxisProperties->visibleRangeMin());
|
m_qwtPlot->replot();
|
||||||
left.setMaxValue(m_leftYAxisProperties->visibleRangeMax());
|
|
||||||
right.setMinValue(m_rightYAxisProperties->visibleRangeMin());
|
|
||||||
right.setMaxValue(m_rightYAxisProperties->visibleRangeMax());
|
|
||||||
|
|
||||||
if (m_isCrossPlot)
|
|
||||||
{
|
|
||||||
time.setMinValue(m_bottomAxisProperties->visibleRangeMin());
|
|
||||||
time.setMaxValue(m_bottomAxisProperties->visibleRangeMax());
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
time.setMinValue(m_timeAxisProperties->visibleRangeMin());
|
|
||||||
time.setMaxValue(m_timeAxisProperties->visibleRangeMax());
|
|
||||||
}
|
|
||||||
|
|
||||||
m_qwtPlot->setZoomWindow(left, right, time);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -1303,20 +1274,59 @@ void RimSummaryPlot::setZoomIntervalsInQwtPlot()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimSummaryPlot::updateZoomWindowFromQwt()
|
void RimSummaryPlot::updateZoomWindowFromQwt()
|
||||||
{
|
{
|
||||||
if (!m_qwtPlot) return;
|
updateAxisRangesFromQwt();
|
||||||
|
setAutoZoomForAllAxes(false);
|
||||||
QwtInterval left, right, time;
|
|
||||||
m_qwtPlot->currentVisibleWindow(&left, &right, &time);
|
|
||||||
|
|
||||||
setZoomWindow(left, right, time);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimSummaryPlot::disableAutoZoom()
|
void RimSummaryPlot::updateAxisRangesFromQwt()
|
||||||
{
|
{
|
||||||
m_isAutoZoom = false;
|
if (!m_qwtPlot) return;
|
||||||
|
|
||||||
|
QwtInterval leftAxis, rightAxis, timeAxis;
|
||||||
|
m_qwtPlot->currentVisibleWindow(&leftAxis, &rightAxis, &timeAxis);
|
||||||
|
|
||||||
|
m_leftYAxisProperties->visibleRangeMax = leftAxis.maxValue();
|
||||||
|
m_leftYAxisProperties->visibleRangeMin = leftAxis.minValue();
|
||||||
|
m_leftYAxisProperties->updateConnectedEditors();
|
||||||
|
|
||||||
|
m_rightYAxisProperties->visibleRangeMax = rightAxis.maxValue();
|
||||||
|
m_rightYAxisProperties->visibleRangeMin = rightAxis.minValue();
|
||||||
|
m_rightYAxisProperties->updateConnectedEditors();
|
||||||
|
|
||||||
|
if (m_isCrossPlot)
|
||||||
|
{
|
||||||
|
m_bottomAxisProperties->visibleRangeMax = timeAxis.maxValue();
|
||||||
|
m_bottomAxisProperties->visibleRangeMin = timeAxis.minValue();
|
||||||
|
m_bottomAxisProperties->updateConnectedEditors();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_timeAxisProperties->setVisibleRangeMin(timeAxis.minValue());
|
||||||
|
m_timeAxisProperties->setVisibleRangeMax(timeAxis.maxValue());
|
||||||
|
m_timeAxisProperties->updateConnectedEditors();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimSummaryPlot::setAutoZoomForAllAxes(bool enableAutoZoom)
|
||||||
|
{
|
||||||
|
m_leftYAxisProperties->setAutoZoom(enableAutoZoom);
|
||||||
|
m_rightYAxisProperties->setAutoZoom(enableAutoZoom);
|
||||||
|
|
||||||
|
if (m_isCrossPlot)
|
||||||
|
{
|
||||||
|
m_bottomAxisProperties->setAutoZoom(enableAutoZoom);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_timeAxisProperties->setAutoZoom(enableAutoZoom);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -1458,6 +1468,11 @@ void RimSummaryPlot::initAfterRead()
|
|||||||
m_summaryCurveCollection->addCurve(curve);
|
m_summaryCurveCollection->addCurve(curve);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!m_isAutoZoom_OBSOLETE())
|
||||||
|
{
|
||||||
|
setAutoZoomForAllAxes(false);
|
||||||
|
}
|
||||||
|
|
||||||
RimProject* proj = nullptr;
|
RimProject* proj = nullptr;
|
||||||
this->firstAncestorOrThisOfType(proj);
|
this->firstAncestorOrThisOfType(proj);
|
||||||
if (proj)
|
if (proj)
|
||||||
|
@@ -89,13 +89,9 @@ public:
|
|||||||
|
|
||||||
void updateAxes();
|
void updateAxes();
|
||||||
virtual void zoomAll() override;
|
virtual void zoomAll() override;
|
||||||
void setZoomWindow(const QwtInterval& leftAxis,
|
|
||||||
const QwtInterval& rightAxis,
|
|
||||||
const QwtInterval& timeAxis);
|
|
||||||
|
|
||||||
void updateZoomInQwt();
|
void updateZoomInQwt();
|
||||||
void updateZoomWindowFromQwt();
|
void updateZoomWindowFromQwt();
|
||||||
void disableAutoZoom();
|
|
||||||
|
|
||||||
bool isLogarithmicScaleEnabled(RiaDefines::PlotAxis plotAxis) const;
|
bool isLogarithmicScaleEnabled(RiaDefines::PlotAxis plotAxis) const;
|
||||||
|
|
||||||
@@ -154,11 +150,14 @@ private:
|
|||||||
|
|
||||||
RimSummaryAxisProperties* yAxisPropertiesLeftOrRight(RiaDefines::PlotAxis leftOrRightPlotAxis) const;
|
RimSummaryAxisProperties* yAxisPropertiesLeftOrRight(RiaDefines::PlotAxis leftOrRightPlotAxis) const;
|
||||||
void updateAxis(RiaDefines::PlotAxis plotAxis);
|
void updateAxis(RiaDefines::PlotAxis plotAxis);
|
||||||
|
|
||||||
void updateZoomForAxis(RiaDefines::PlotAxis plotAxis);
|
void updateZoomForAxis(RiaDefines::PlotAxis plotAxis);
|
||||||
|
|
||||||
void updateTimeAxis();
|
void updateTimeAxis();
|
||||||
void updateBottomXAxis();
|
void updateBottomXAxis();
|
||||||
void setZoomIntervalsInQwtPlot();
|
|
||||||
|
void updateAxisRangesFromQwt();
|
||||||
|
void setAutoZoomForAllAxes(bool enableAutoZoom);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<bool> m_showPlotTitle;
|
caf::PdmField<bool> m_showPlotTitle;
|
||||||
@@ -174,7 +173,6 @@ private:
|
|||||||
|
|
||||||
caf::PdmChildArrayField<RimAsciiDataCurve*> m_asciiDataCurves;
|
caf::PdmChildArrayField<RimAsciiDataCurve*> m_asciiDataCurves;
|
||||||
|
|
||||||
caf::PdmField<bool> m_isAutoZoom;
|
|
||||||
caf::PdmChildField<RimSummaryAxisProperties*> m_leftYAxisProperties;
|
caf::PdmChildField<RimSummaryAxisProperties*> m_leftYAxisProperties;
|
||||||
caf::PdmChildField<RimSummaryAxisProperties*> m_rightYAxisProperties;
|
caf::PdmChildField<RimSummaryAxisProperties*> m_rightYAxisProperties;
|
||||||
|
|
||||||
@@ -191,4 +189,6 @@ private:
|
|||||||
// Obsolete fields
|
// Obsolete fields
|
||||||
caf::PdmChildArrayField<RimSummaryCurve*> m_summaryCurves_OBSOLETE;
|
caf::PdmChildArrayField<RimSummaryCurve*> m_summaryCurves_OBSOLETE;
|
||||||
caf::PdmChildArrayField<RimSummaryCurveFilter_OBSOLETE*> m_curveFilters_OBSOLETE;
|
caf::PdmChildArrayField<RimSummaryCurveFilter_OBSOLETE*> m_curveFilters_OBSOLETE;
|
||||||
|
caf::PdmField<bool> m_isAutoZoom_OBSOLETE;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@@ -82,6 +82,7 @@ RimSummaryTimeAxisProperties::RimSummaryTimeAxisProperties()
|
|||||||
CAF_PDM_InitField(&titleFontSize, "FontSize", 11, "Font Size", "", "", "");
|
CAF_PDM_InitField(&titleFontSize, "FontSize", 11, "Font Size", "", "", "");
|
||||||
CAF_PDM_InitField(&valuesFontSize, "ValuesFontSize", 11, "Font Size", "", "", "");
|
CAF_PDM_InitField(&valuesFontSize, "ValuesFontSize", 11, "Font Size", "", "", "");
|
||||||
|
|
||||||
|
CAF_PDM_InitField(&m_isAutoZoom, "AutoZoom", true, "Set Range Automatically", "", "", "");
|
||||||
CAF_PDM_InitFieldNoDefault(&m_timeMode, "TimeMode", "Time Mode", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&m_timeMode, "TimeMode", "Time Mode", "", "", "");
|
||||||
CAF_PDM_InitFieldNoDefault(&m_timeUnit, "TimeUnit", "Time Unit", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&m_timeUnit, "TimeUnit", "Time Unit", "", "", "");
|
||||||
|
|
||||||
@@ -158,6 +159,22 @@ void RimSummaryTimeAxisProperties::setVisibleRangeMax(double value)
|
|||||||
auto s = m_visibleDateRangeMax().toString();
|
auto s = m_visibleDateRangeMax().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RimSummaryTimeAxisProperties::isAutoZoom() const
|
||||||
|
{
|
||||||
|
return m_isAutoZoom;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimSummaryTimeAxisProperties::setAutoZoom(bool enableAutoZoom)
|
||||||
|
{
|
||||||
|
m_isAutoZoom = enableAutoZoom;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -362,7 +379,7 @@ void RimSummaryTimeAxisProperties::fieldChangedByUi(const caf::PdmFieldHandle* c
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateTimeVisibleRange();
|
updateTimeVisibleRange();
|
||||||
rimSummaryPlot->disableAutoZoom();
|
m_isAutoZoom = false;
|
||||||
}
|
}
|
||||||
else if (changedField == &m_visibleDateRangeMin)
|
else if (changedField == &m_visibleDateRangeMin)
|
||||||
{
|
{
|
||||||
@@ -373,12 +390,12 @@ void RimSummaryTimeAxisProperties::fieldChangedByUi(const caf::PdmFieldHandle* c
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateTimeVisibleRange();
|
updateTimeVisibleRange();
|
||||||
rimSummaryPlot->disableAutoZoom();
|
m_isAutoZoom = false;
|
||||||
}
|
}
|
||||||
else if (changedField == &m_visibleTimeRangeMin || changedField == &m_visibleTimeRangeMax)
|
else if (changedField == &m_visibleTimeRangeMin || changedField == &m_visibleTimeRangeMax)
|
||||||
{
|
{
|
||||||
updateDateVisibleRange();
|
updateDateVisibleRange();
|
||||||
rimSummaryPlot->disableAutoZoom();
|
m_isAutoZoom = false;
|
||||||
}
|
}
|
||||||
else if (changedField == &m_timeMode)
|
else if (changedField == &m_timeMode)
|
||||||
{
|
{
|
||||||
|
@@ -78,6 +78,9 @@ public:
|
|||||||
void setVisibleRangeMin(double value);
|
void setVisibleRangeMin(double value);
|
||||||
void setVisibleRangeMax(double value);
|
void setVisibleRangeMax(double value);
|
||||||
|
|
||||||
|
bool isAutoZoom() const;
|
||||||
|
void setAutoZoom(bool enableAutoZoom);
|
||||||
|
|
||||||
bool isActive() const;
|
bool isActive() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -100,4 +103,5 @@ private:
|
|||||||
caf::PdmField<QDateTime> m_visibleDateRangeMax;
|
caf::PdmField<QDateTime> m_visibleDateRangeMax;
|
||||||
caf::PdmField<double> m_visibleTimeRangeMin;
|
caf::PdmField<double> m_visibleTimeRangeMin;
|
||||||
caf::PdmField<double> m_visibleTimeRangeMax;
|
caf::PdmField<double> m_visibleTimeRangeMax;
|
||||||
|
caf::PdmField<bool> m_isAutoZoom;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user