(#592) Fixed autoscale for track move delete toggle

Also avoid to always do updateConnectedEditors on project when deleting a curve
This commit is contained in:
Jacob Støren
2015-10-29 10:29:48 +01:00
parent 669bacb2a5
commit 21b1e6c6e6
7 changed files with 73 additions and 54 deletions

View File

@@ -291,18 +291,20 @@ void RimWellLogPlot::calculateAvailableDepthRange()
double minTrackDepth = HUGE_VAL;
double maxTrackDepth = -HUGE_VAL;
m_tracks[tIdx]->availableDepthRange(&minTrackDepth, &maxTrackDepth);
if (minTrackDepth < minDepth)
if (m_tracks[tIdx]->isVisible())
{
minDepth = minTrackDepth;
}
m_tracks[tIdx]->availableDepthRange(&minTrackDepth, &maxTrackDepth);
if (maxTrackDepth > maxDepth)
{
maxDepth = maxTrackDepth;
if (minTrackDepth < minDepth)
{
minDepth = minTrackDepth;
}
if (maxTrackDepth > maxDepth)
{
maxDepth = maxTrackDepth;
}
}
}
m_minAvailableDepth = minDepth;

View File

@@ -80,7 +80,18 @@ void RimWellLogPlotTrack::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
{
if (changedField == &m_show)
{
if (m_wellLogTrackPlotWidget) m_wellLogTrackPlotWidget->setVisible(m_show());
if (m_wellLogTrackPlotWidget)
{
m_wellLogTrackPlotWidget->setVisible(m_show());
}
RimWellLogPlot* wellLogPlot;
this->firstAnchestorOrThisOfType(wellLogPlot);
if (wellLogPlot)
{
wellLogPlot->calculateAvailableDepthRange();
wellLogPlot->zoomAllDepth();
}
}
else if (changedField == &m_visibleXRangeMin || changedField == &m_visibleXRangeMax)
{
@@ -353,3 +364,11 @@ size_t RimWellLogPlotTrack::curveIndex(RimWellLogPlotCurve* curve)
{
return curves.index(curve);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellLogPlotTrack::isVisible()
{
return m_show;
}

View File

@@ -44,7 +44,7 @@ public:
virtual ~RimWellLogPlotTrack();
void setDescription(const QString& description);
bool isVisible();
void addCurve(RimWellLogPlotCurve* curve);
void insertCurve(RimWellLogPlotCurve* curve, size_t index);
void removeCurve(RimWellLogPlotCurve* curve);
@@ -59,6 +59,7 @@ public:
void availableDepthRange(double* minimumDepth, double* maximumDepth);
void zoomAllXAndZoomAllDepthOnOwnerPlot();
void alignDepthZoomToPlotAndZoomAllX();
void zoomAllXAxis();
RiuWellLogTrackPlot* viewer();
@@ -73,7 +74,6 @@ protected:
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
private:
void zoomAllXAxis();
private:
caf::PdmField<bool> m_show;
caf::PdmField<QString> m_userName;