Tried to improve readability by renaming in the plot classes.

This commit is contained in:
Jacob Støren 2015-10-27 14:44:53 +01:00
parent 4a12eecd0c
commit 0a45354bd9
19 changed files with 222 additions and 225 deletions

View File

@ -114,14 +114,14 @@ void RicDeleteItemExec::redo()
parentObj->firstAnchestorOrThisOfType(wellLogPlot); parentObj->firstAnchestorOrThisOfType(wellLogPlot);
if (wellLogPlot) if (wellLogPlot)
{ {
wellLogPlot->updateAvailableDepthRange(); wellLogPlot->calculateAvailableDepthRange();
} }
RimWellLogPlotTrack* wellLogPlotTrack; RimWellLogPlotTrack* wellLogPlotTrack;
parentObj->firstAnchestorOrThisOfType(wellLogPlotTrack); parentObj->firstAnchestorOrThisOfType(wellLogPlotTrack);
if (wellLogPlotTrack) if (wellLogPlotTrack)
{ {
wellLogPlotTrack->updateAxisRangesAndReplot(); wellLogPlotTrack->allignDepthZoomToPlotAndZoomAllX();
} }
RimWellLogPlotCollection* wellLogPlotCollection = NULL; RimWellLogPlotCollection* wellLogPlotCollection = NULL;

View File

@ -109,8 +109,8 @@ void RicAddWellLogToPlotFeature::onActionTriggered(bool isChecked)
} }
} }
plot->updateAvailableDepthRange(); plot->calculateAvailableDepthRange();
plot->setVisibleDepthRangeFromContents(); plot->zoomAllDepth();
plotTrack->viewer()->replot(); plotTrack->viewer()->replot();
RiaApplication::instance()->project()->updateConnectedEditors(); RiaApplication::instance()->project()->updateConnectedEditors();

View File

@ -67,7 +67,7 @@ void RicDeleteWellLogPlotTrackFeature::onActionTriggered(bool isChecked)
if (wellLogPlot && wellLogPlot->trackCount() > 1) if (wellLogPlot && wellLogPlot->trackCount() > 1)
{ {
wellLogPlot->removeTrack(track); wellLogPlot->removeTrack(track);
wellLogPlot->updateAvailableDepthRange(); wellLogPlot->calculateAvailableDepthRange();
wellLogPlot->uiCapability()->updateConnectedEditors(); wellLogPlot->uiCapability()->updateConnectedEditors();
caf::SelectionManager::instance()->removeObjectFromAllSelections(track); caf::SelectionManager::instance()->removeObjectFromAllSelections(track);

View File

@ -47,7 +47,7 @@ void RicWellLogPlotTrackFeatureImpl::moveCurvesToWellLogPlotTrack(RimWellLogPlot
wellLogPlotTrack->insertCurve(curves[cIdx], cIdx); wellLogPlotTrack->insertCurve(curves[cIdx], cIdx);
} }
wellLogPlotTrack->updateAxisRangesAndReplot(); wellLogPlotTrack->allignDepthZoomToPlotAndZoomAllX();
wellLogPlotTrack->updateConnectedEditors(); wellLogPlotTrack->updateConnectedEditors();
} }
@ -59,7 +59,7 @@ void RicWellLogPlotTrackFeatureImpl::moveCurvesToWellLogPlotTrack(RimWellLogPlot
CVF_ASSERT(wellLogPlotTrack && insertAfterCurve); CVF_ASSERT(wellLogPlotTrack && insertAfterCurve);
wellLogPlotTrack->moveCurves(insertAfterCurve, curves); wellLogPlotTrack->moveCurves(insertAfterCurve, curves);
wellLogPlotTrack->updateAxisRangesAndReplot(); wellLogPlotTrack->allignDepthZoomToPlotAndZoomAllX();
wellLogPlotTrack->updateConnectedEditors(); wellLogPlotTrack->updateConnectedEditors();
} }

View File

@ -179,7 +179,7 @@ void RimWellLogExtractionCurve::updatePlotData()
{ {
RimWellLogPlotCurve::updatePlotConfiguration(); RimWellLogPlotCurve::updatePlotConfiguration();
if (isCurveVisibile()) if (isCurveVisible())
{ {
// Make sure we have set correct case data into the result definitions. // Make sure we have set correct case data into the result definitions.
@ -255,10 +255,10 @@ void RimWellLogExtractionCurve::updatePlotData()
} }
} }
m_plotCurve->setCurveData(m_curveData.p()); m_qwtPlotCurve->setCurveData(m_curveData.p());
updateTrackAndPlotFromCurveData(); updateTrackAndPlotFromCurveData();
if (m_plot) m_plot->replot(); if (m_ownerQwtTrack) m_ownerQwtTrack->replot();
} }
} }

View File

@ -69,7 +69,7 @@ void RimWellLogFileCurve::updatePlotData()
{ {
RimWellLogPlotCurve::updatePlotConfiguration(); RimWellLogPlotCurve::updatePlotConfiguration();
if (isCurveVisibile()) if (isCurveVisible())
{ {
m_curveData = new RigWellLogCurveData; m_curveData = new RigWellLogCurveData;
@ -92,16 +92,16 @@ void RimWellLogFileCurve::updatePlotData()
if (m_autoName) if (m_autoName)
{ {
m_plotCurve->setTitle(createCurveName()); m_qwtPlotCurve->setTitle(createCurveName());
} }
} }
} }
m_plotCurve->setCurveData(m_curveData.p()); m_qwtPlotCurve->setCurveData(m_curveData.p());
updateTrackAndPlotFromCurveData(); updateTrackAndPlotFromCurveData();
if (m_plot) m_plot->replot(); if (m_ownerQwtTrack) m_ownerQwtTrack->replot();
} }
} }
@ -137,7 +137,7 @@ void RimWellLogFileCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
this->updatePlotData(); this->updatePlotData();
} }
if (m_plot) m_plot->replot(); if (m_ownerQwtTrack) m_ownerQwtTrack->replot();
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -66,17 +66,17 @@ RimWellLogPlot::RimWellLogPlot()
caf::AppEnum< RimWellLogPlot::DepthTypeEnum > depthType = MEASURED_DEPTH; caf::AppEnum< RimWellLogPlot::DepthTypeEnum > depthType = MEASURED_DEPTH;
CAF_PDM_InitField(&m_depthType, "DepthType", depthType, "Depth type", "", "", ""); CAF_PDM_InitField(&m_depthType, "DepthType", depthType, "Depth type", "", "", "");
CAF_PDM_InitField(&m_minimumVisibleDepth, "MinimumDepth", 0.0, "Min", "", "", ""); CAF_PDM_InitField(&m_minVisibleDepth, "MinimumDepth", 0.0, "Min", "", "", "");
CAF_PDM_InitField(&m_maximumVisibleDepth, "MaximumDepth", 1000.0, "Max", "", "", ""); CAF_PDM_InitField(&m_maxVisibleDepth, "MaximumDepth", 1000.0, "Max", "", "", "");
CAF_PDM_InitFieldNoDefault(&tracks, "Tracks", "", "", "", ""); CAF_PDM_InitFieldNoDefault(&m_tracks, "Tracks", "", "", "", "");
tracks.uiCapability()->setUiHidden(true); m_tracks.uiCapability()->setUiHidden(true);
CAF_PDM_InitFieldNoDefault(&windowGeometry, "WindowGeometry", "", "", "", ""); CAF_PDM_InitFieldNoDefault(&windowGeometry, "WindowGeometry", "", "", "", "");
windowGeometry.uiCapability()->setUiHidden(true); windowGeometry.uiCapability()->setUiHidden(true);
m_depthRangeMinimum = HUGE_VAL; m_minAvailableDepth = HUGE_VAL;
m_depthRangeMaximum = -HUGE_VAL; m_maxAvailableDepth = -HUGE_VAL;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -142,9 +142,9 @@ void RimWellLogPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
uiCapability()->updateUiIconFromToggleField(); uiCapability()->updateUiIconFromToggleField();
} }
else if (changedField == &m_minimumVisibleDepth || changedField == &m_maximumVisibleDepth) else if (changedField == &m_minVisibleDepth || changedField == &m_maxVisibleDepth)
{ {
updateAxisRanges(); updateDepthZoomInQwt();
} }
else if (changedField == &m_userName) else if (changedField == &m_userName)
{ {
@ -169,7 +169,7 @@ caf::PdmFieldHandle* RimWellLogPlot::objectToggleField()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogPlot::addTrack(RimWellLogPlotTrack* track) void RimWellLogPlot::addTrack(RimWellLogPlotTrack* track)
{ {
tracks.push_back(track); m_tracks.push_back(track);
if (m_viewer) if (m_viewer)
{ {
track->recreateViewer(); track->recreateViewer();
@ -184,7 +184,7 @@ void RimWellLogPlot::addTrack(RimWellLogPlotTrack* track)
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogPlot::insertTrack(RimWellLogPlotTrack* track, size_t index) void RimWellLogPlot::insertTrack(RimWellLogPlotTrack* track, size_t index)
{ {
tracks.insert(index, track); m_tracks.insert(index, track);
if (m_viewer) if (m_viewer)
{ {
@ -203,7 +203,7 @@ void RimWellLogPlot::removeTrack(RimWellLogPlotTrack* track)
if (track) if (track)
{ {
if (m_viewer) m_viewer->removeTrackPlot(track->viewer()); if (m_viewer) m_viewer->removeTrackPlot(track->viewer());
tracks.removeChildObject(track); m_tracks.removeChildObject(track);
} }
} }
@ -226,7 +226,7 @@ void RimWellLogPlot::moveTracks(RimWellLogPlotTrack* insertAfterTrack, const std
} }
} }
size_t index = tracks.index(insertAfterTrack) + 1; size_t index = m_tracks.index(insertAfterTrack) + 1;
for (size_t tIdx = 0; tIdx < tracksToMove.size(); tIdx++) for (size_t tIdx = 0; tIdx < tracksToMove.size(); tIdx++)
{ {
@ -247,12 +247,12 @@ RiuWellLogPlot* RimWellLogPlot::viewer()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogPlot::zoomDepth(double zoomFactor, double zoomCenter) void RimWellLogPlot::setDepthZoomByFactorAndCenter(double zoomFactor, double zoomCenter)
{ {
double newMinimum = zoomCenter - (zoomCenter - m_minimumVisibleDepth)*zoomFactor; double newMinimum = zoomCenter - (zoomCenter - m_minVisibleDepth)*zoomFactor;
double newMaximum = zoomCenter + (m_maximumVisibleDepth - zoomCenter)*zoomFactor; double newMaximum = zoomCenter + (m_maxVisibleDepth - zoomCenter)*zoomFactor;
setVisibleDepthRange(newMinimum, newMaximum); setDepthZoomMinMax(newMinimum, newMaximum);
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -260,38 +260,38 @@ void RimWellLogPlot::zoomDepth(double zoomFactor, double zoomCenter)
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogPlot::panDepth(double panFactor) void RimWellLogPlot::panDepth(double panFactor)
{ {
double delta = panFactor*(m_maximumVisibleDepth - m_minimumVisibleDepth); double delta = panFactor*(m_maxVisibleDepth - m_minVisibleDepth);
setVisibleDepthRange(m_minimumVisibleDepth + delta, m_maximumVisibleDepth + delta); setDepthZoomMinMax(m_minVisibleDepth + delta, m_maxVisibleDepth + delta);
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogPlot::setVisibleDepthRange(double minimumDepth, double maximumDepth) void RimWellLogPlot::setDepthZoomMinMax(double minimumDepth, double maximumDepth)
{ {
m_minimumVisibleDepth = minimumDepth; m_minVisibleDepth = minimumDepth;
m_maximumVisibleDepth = maximumDepth; m_maxVisibleDepth = maximumDepth;
m_minimumVisibleDepth.uiCapability()->updateConnectedEditors(); m_minVisibleDepth.uiCapability()->updateConnectedEditors();
m_maximumVisibleDepth.uiCapability()->updateConnectedEditors(); m_maxVisibleDepth.uiCapability()->updateConnectedEditors();
updateAxisRanges(); updateDepthZoomInQwt();
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogPlot::updateAvailableDepthRange() void RimWellLogPlot::calculateAvailableDepthRange()
{ {
double minDepth = HUGE_VAL; double minDepth = HUGE_VAL;
double maxDepth = -HUGE_VAL; double maxDepth = -HUGE_VAL;
for (size_t tIdx = 0; tIdx < tracks.size(); tIdx++) for (size_t tIdx = 0; tIdx < m_tracks.size(); tIdx++)
{ {
double minTrackDepth = HUGE_VAL; double minTrackDepth = HUGE_VAL;
double maxTrackDepth = -HUGE_VAL; double maxTrackDepth = -HUGE_VAL;
if (tracks[tIdx]->availableDepthRange(&minTrackDepth, &maxTrackDepth)) if (m_tracks[tIdx]->availableDepthRange(&minTrackDepth, &maxTrackDepth))
{ {
if (minTrackDepth < minDepth) if (minTrackDepth < minDepth)
{ {
@ -305,8 +305,8 @@ void RimWellLogPlot::updateAvailableDepthRange()
} }
} }
m_depthRangeMinimum = minDepth; m_minAvailableDepth = minDepth;
m_depthRangeMaximum = maxDepth; m_maxAvailableDepth = maxDepth;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -316,8 +316,8 @@ void RimWellLogPlot::availableDepthRange(double* minimumDepth, double* maximumDe
{ {
if (hasAvailableDepthRange()) if (hasAvailableDepthRange())
{ {
*minimumDepth = m_depthRangeMinimum; *minimumDepth = m_minAvailableDepth;
*maximumDepth = m_depthRangeMaximum; *maximumDepth = m_maxAvailableDepth;
} }
else else
{ {
@ -332,16 +332,16 @@ void RimWellLogPlot::availableDepthRange(double* minimumDepth, double* maximumDe
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RimWellLogPlot::hasAvailableDepthRange() const bool RimWellLogPlot::hasAvailableDepthRange() const
{ {
return m_depthRangeMinimum < HUGE_VAL && m_depthRangeMaximum > -HUGE_VAL; return m_minAvailableDepth < HUGE_VAL && m_maxAvailableDepth > -HUGE_VAL;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogPlot::visibleDepthRange(double* minimumDepth, double* maximumDepth) const void RimWellLogPlot::depthZoomMinMax(double* minimumDepth, double* maximumDepth) const
{ {
*minimumDepth = m_minimumVisibleDepth; *minimumDepth = m_minVisibleDepth;
*maximumDepth = m_maximumVisibleDepth; *maximumDepth = m_maxVisibleDepth;
} }
@ -366,8 +366,8 @@ void RimWellLogPlot::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
uiOrdering.add(&m_depthType); uiOrdering.add(&m_depthType);
caf::PdmUiGroup* gridGroup = uiOrdering.addNewGroup("Visible Depth Range"); caf::PdmUiGroup* gridGroup = uiOrdering.addNewGroup("Visible Depth Range");
gridGroup->add(&m_minimumVisibleDepth); gridGroup->add(&m_minVisibleDepth);
gridGroup->add(&m_maximumVisibleDepth); gridGroup->add(&m_maxVisibleDepth);
} }
@ -387,13 +387,13 @@ void RimWellLogPlot::updateTracks()
{ {
if (m_showWindow) if (m_showWindow)
{ {
for (size_t tIdx = 0; tIdx < tracks.size(); ++tIdx) for (size_t tIdx = 0; tIdx < m_tracks.size(); ++tIdx)
{ {
tracks[tIdx]->loadDataAndUpdate(); m_tracks[tIdx]->loadDataAndUpdate();
} }
updateAvailableDepthRange(); calculateAvailableDepthRange();
updateAxisRanges(); updateDepthZoomInQwt();
} }
} }
@ -402,23 +402,23 @@ void RimWellLogPlot::updateTracks()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogPlot::updateTrackNames() void RimWellLogPlot::updateTrackNames()
{ {
for (size_t tIdx = 0; tIdx < tracks.size(); tIdx++) for (size_t tIdx = 0; tIdx < m_tracks.size(); tIdx++)
{ {
tracks[tIdx]->setDescription(QString("Track %1").arg(tIdx + 1)); m_tracks[tIdx]->setDescription(QString("Track %1").arg(tIdx + 1));
} }
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogPlot::updateAxisRanges() void RimWellLogPlot::updateDepthZoomInQwt()
{ {
if (m_viewer) if (m_viewer)
{ {
double minDepth = m_minimumVisibleDepth < HUGE_VAL ? m_minimumVisibleDepth : RI_LOGPLOT_MINDEPTH_DEFAULT; double minDepth = m_minVisibleDepth < HUGE_VAL ? m_minVisibleDepth : RI_LOGPLOT_MINDEPTH_DEFAULT;
double maxDepth = m_maximumVisibleDepth > -HUGE_VAL ? m_maximumVisibleDepth : RI_LOGPLOT_MAXDEPTH_DEFAULT; double maxDepth = m_maxVisibleDepth > -HUGE_VAL ? m_maxVisibleDepth : RI_LOGPLOT_MAXDEPTH_DEFAULT;
m_viewer->setDepthRangeAndReplot(minDepth, maxDepth); m_viewer->setDepthZoomAndReplot(minDepth, maxDepth);
} }
} }
@ -426,15 +426,15 @@ void RimWellLogPlot::updateAxisRanges()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogPlot::setVisibleDepthRangeFromContents() void RimWellLogPlot::zoomAllDepth()
{ {
if (hasAvailableDepthRange()) if (hasAvailableDepthRange())
{ {
setVisibleDepthRange(m_depthRangeMinimum, m_depthRangeMaximum); setDepthZoomMinMax(m_minAvailableDepth, m_maxAvailableDepth);
} }
else else
{ {
setVisibleDepthRange(RI_LOGPLOT_MINDEPTH_DEFAULT, RI_LOGPLOT_MAXDEPTH_DEFAULT); setDepthZoomMinMax(RI_LOGPLOT_MINDEPTH_DEFAULT, RI_LOGPLOT_MAXDEPTH_DEFAULT);
} }
} }
@ -445,10 +445,10 @@ void RimWellLogPlot::recreateTrackPlots()
{ {
CVF_ASSERT(m_viewer); CVF_ASSERT(m_viewer);
for (size_t tIdx = 0; tIdx < tracks.size(); ++tIdx) for (size_t tIdx = 0; tIdx < m_tracks.size(); ++tIdx)
{ {
tracks[tIdx]->recreateViewer(); m_tracks[tIdx]->recreateViewer();
m_viewer->addTrackPlot(tracks[tIdx]->viewer()); m_viewer->addTrackPlot(m_tracks[tIdx]->viewer());
} }
} }
@ -457,9 +457,9 @@ void RimWellLogPlot::recreateTrackPlots()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogPlot::detachAllCurves() void RimWellLogPlot::detachAllCurves()
{ {
for (size_t tIdx = 0; tIdx < tracks.size(); ++tIdx) for (size_t tIdx = 0; tIdx < m_tracks.size(); ++tIdx)
{ {
tracks[tIdx]->detachAllCurves(); m_tracks[tIdx]->detachAllCurves();
} }
} }

View File

@ -49,72 +49,66 @@ public:
RimWellLogPlot(); RimWellLogPlot();
virtual ~RimWellLogPlot(); virtual ~RimWellLogPlot();
void setDescription(const QString& description); void setDescription(const QString& description);
void updateViewerWidgetWindowTitle();
void addTrack(RimWellLogPlotTrack* track); DepthTypeEnum depthType() const;
void insertTrack(RimWellLogPlotTrack* track, size_t index); QString depthPlotTitle() const;
size_t trackCount() { return tracks.size();}
void removeTrack(RimWellLogPlotTrack* track);
void moveTracks(RimWellLogPlotTrack* insertAfterTrack, const std::vector<RimWellLogPlotTrack*>& tracksToMove);
void loadDataAndUpdate(); caf::PdmField< std::vector<int> > windowGeometry;
void updateTracks();
void updateTrackNames();
RiuWellLogPlot* viewer(); void addTrack(RimWellLogPlotTrack* track);
void insertTrack(RimWellLogPlotTrack* track, size_t index);
size_t trackCount() { return m_tracks.size();}
void removeTrack(RimWellLogPlotTrack* track);
void moveTracks(RimWellLogPlotTrack* insertAfterTrack, const std::vector<RimWellLogPlotTrack*>& tracksToMove);
void zoomDepth(double zoomFactor, double zoomCenter); void loadDataAndUpdate();
void panDepth(double panFactor); void updateTracks();
void setVisibleDepthRange(double minimumDepth, double maximumDepth); void updateTrackNames();
void updateAvailableDepthRange(); RiuWellLogPlot* viewer();
void availableDepthRange(double* minimumDepth, double* maximumDepth) const;
bool hasAvailableDepthRange() const;
void visibleDepthRange(double* minimumDepth, double* maximumDepth) const; void zoomAllDepth();
void updateAxisRanges(); void setDepthZoomByFactorAndCenter(double zoomFactor, double zoomCenter);
void setVisibleDepthRangeFromContents(); void panDepth(double panFactor);
void setDepthZoomMinMax(double minimumDepth, double maximumDepth);
DepthTypeEnum depthType() const; void depthZoomMinMax(double* minimumDepth, double* maximumDepth) const;
QString depthPlotTitle() const;
virtual caf::PdmFieldHandle* userDescriptionField() { return &m_userName; }
caf::PdmField< std::vector<int> > windowGeometry;
void calculateAvailableDepthRange();
void availableDepthRange(double* minimumDepth, double* maximumDepth) const;
bool hasAvailableDepthRange() const;
protected: protected:
// Overridden PDM methods // Overridden PDM methods
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue); virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
virtual void setupBeforeSave(); virtual void setupBeforeSave();
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering); virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
virtual caf::PdmFieldHandle* objectToggleField();
virtual caf::PdmFieldHandle* userDescriptionField() { return &m_userName; }
private: private:
void updateViewerWidget(); void updateViewerWidget();
void recreateTrackPlots(); void updateViewerWidgetWindowTitle();
void detachAllCurves(); void updateDepthZoomInQwt();
void handleViewerDeletion(); void recreateTrackPlots();
void detachAllCurves();
virtual caf::PdmFieldHandle* objectToggleField(); void handleViewerDeletion();
private: private:
QPointer<RiuWellLogPlot> m_viewer;
caf::PdmField<bool> m_showWindow;
caf::PdmChildArrayField<RimWellLogPlotTrack*> tracks;
caf::PdmField<bool> m_showWindow;
caf::PdmField<QString> m_userName; caf::PdmField<QString> m_userName;
caf::PdmField< caf::AppEnum< DepthTypeEnum > > m_depthType; caf::PdmField< caf::AppEnum< DepthTypeEnum > > m_depthType;
caf::PdmField<double> m_minimumVisibleDepth; caf::PdmChildArrayField<RimWellLogPlotTrack*> m_tracks;
caf::PdmField<double> m_maximumVisibleDepth;
double m_depthRangeMinimum; caf::PdmField<double> m_minVisibleDepth;
double m_depthRangeMaximum; caf::PdmField<double> m_maxVisibleDepth;
double m_minAvailableDepth;
double m_maxAvailableDepth;
friend class RiuWellLogPlot; friend class RiuWellLogPlot;
QPointer<RiuWellLogPlot> m_viewer;
}; };

View File

@ -49,11 +49,11 @@ RimWellLogPlotCurve::RimWellLogPlotCurve()
CAF_PDM_InitField(&m_curveColor, "Color", cvf::Color3f(cvf::Color3::BLACK), "Color", "", "", ""); CAF_PDM_InitField(&m_curveColor, "Color", cvf::Color3f(cvf::Color3::BLACK), "Color", "", "", "");
m_plotCurve = new RiuWellLogPlotCurve; m_qwtPlotCurve = new RiuWellLogPlotCurve;
m_plotCurve->setXAxis(QwtPlot::xTop); m_qwtPlotCurve->setXAxis(QwtPlot::xTop);
m_plotCurve->setYAxis(QwtPlot::yLeft); m_qwtPlotCurve->setYAxis(QwtPlot::yLeft);
m_plot = NULL; m_ownerQwtTrack = NULL;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -61,10 +61,10 @@ RimWellLogPlotCurve::RimWellLogPlotCurve()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RimWellLogPlotCurve::~RimWellLogPlotCurve() RimWellLogPlotCurve::~RimWellLogPlotCurve()
{ {
m_plotCurve->detach(); m_qwtPlotCurve->detach();
if (m_plot) m_plot->replot(); if (m_ownerQwtTrack) m_ownerQwtTrack->replot();
delete m_plotCurve; delete m_qwtPlotCurve;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -83,7 +83,7 @@ void RimWellLogPlotCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
} }
else if (&m_curveColor == changedField) else if (&m_curveColor == changedField)
{ {
m_plotCurve->setPen(QPen(QColor(m_curveColor.value().rByte(), m_curveColor.value().gByte(), m_curveColor.value().bByte()))); m_qwtPlotCurve->setPen(QPen(QColor(m_curveColor.value().rByte(), m_curveColor.value().gByte(), m_curveColor.value().bByte())));
} }
else if (changedField == &m_autoName) else if (changedField == &m_autoName)
{ {
@ -97,7 +97,7 @@ void RimWellLogPlotCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
updatePlotTitle(); updatePlotTitle();
} }
if (m_plot) m_plot->replot(); if (m_ownerQwtTrack) m_ownerQwtTrack->replot();
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -113,13 +113,13 @@ caf::PdmFieldHandle* RimWellLogPlotCurve::objectToggleField()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogPlotCurve::updateCurveVisibility() void RimWellLogPlotCurve::updateCurveVisibility()
{ {
if (m_showCurve() && m_plot) if (m_showCurve() && m_ownerQwtTrack)
{ {
m_plotCurve->attach(m_plot); m_qwtPlotCurve->attach(m_ownerQwtTrack);
} }
else else
{ {
m_plotCurve->detach(); m_qwtPlotCurve->detach();
} }
} }
@ -132,20 +132,20 @@ void RimWellLogPlotCurve::updatePlotConfiguration()
this->updateCurveName(); this->updateCurveName();
this->updatePlotTitle(); this->updatePlotTitle();
m_plotCurve->setPen(QPen(QColor(m_curveColor.value().rByte(), m_curveColor.value().gByte(), m_curveColor.value().bByte()))); m_qwtPlotCurve->setPen(QPen(QColor(m_curveColor.value().rByte(), m_curveColor.value().gByte(), m_curveColor.value().bByte())));
// Todo: Rest of the curve setup controlled from this class // Todo: Rest of the curve setup controlled from this class
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogPlotCurve::setPlot(RiuWellLogTrackPlot* plot) void RimWellLogPlotCurve::setQwtTrack(RiuWellLogTrackPlot* plot)
{ {
m_plot = plot; m_ownerQwtTrack = plot;
if (m_showCurve) if (m_showCurve)
{ {
m_plotCurve->attach(m_plot); m_qwtPlotCurve->attach(m_ownerQwtTrack);
m_plot->replot(); m_ownerQwtTrack->replot();
} }
} }
@ -163,15 +163,15 @@ caf::PdmFieldHandle* RimWellLogPlotCurve::userDescriptionField()
bool RimWellLogPlotCurve::depthRange(double* minimumDepth, double* maximumDepth) const bool RimWellLogPlotCurve::depthRange(double* minimumDepth, double* maximumDepth) const
{ {
CVF_ASSERT(minimumDepth && maximumDepth); CVF_ASSERT(minimumDepth && maximumDepth);
CVF_ASSERT(m_plotCurve); CVF_ASSERT(m_qwtPlotCurve);
if (m_plotCurve->data()->size() < 1) if (m_qwtPlotCurve->data()->size() < 1)
{ {
return false; return false;
} }
*minimumDepth = m_plotCurve->minYValue(); *minimumDepth = m_qwtPlotCurve->minYValue();
*maximumDepth = m_plotCurve->maxYValue(); *maximumDepth = m_qwtPlotCurve->maxYValue();
return true; return true;
} }
@ -182,15 +182,15 @@ bool RimWellLogPlotCurve::depthRange(double* minimumDepth, double* maximumDepth)
bool RimWellLogPlotCurve::valueRange(double* minimumValue, double* maximumValue) const bool RimWellLogPlotCurve::valueRange(double* minimumValue, double* maximumValue) const
{ {
CVF_ASSERT(minimumValue && maximumValue); CVF_ASSERT(minimumValue && maximumValue);
CVF_ASSERT(m_plotCurve); CVF_ASSERT(m_qwtPlotCurve);
if (m_plotCurve->data()->size() < 1) if (m_qwtPlotCurve->data()->size() < 1)
{ {
return false; return false;
} }
*minimumValue = m_plotCurve->minXValue(); *minimumValue = m_qwtPlotCurve->minXValue();
*maximumValue = m_plotCurve->maxXValue(); *maximumValue = m_qwtPlotCurve->maxXValue();
return true; return true;
} }
@ -206,9 +206,9 @@ void RimWellLogPlotCurve::setColor(const cvf::Color3f& color)
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogPlotCurve::detachCurve() void RimWellLogPlotCurve::detachQwtCurve()
{ {
m_plotCurve->detach(); m_qwtPlotCurve->detach();
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -216,7 +216,7 @@ void RimWellLogPlotCurve::detachCurve()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
QwtPlotCurve* RimWellLogPlotCurve::plotCurve() const QwtPlotCurve* RimWellLogPlotCurve::plotCurve() const
{ {
return m_plotCurve; return m_qwtPlotCurve;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -224,13 +224,13 @@ QwtPlotCurve* RimWellLogPlotCurve::plotCurve() const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogPlotCurve::updatePlotTitle() void RimWellLogPlotCurve::updatePlotTitle()
{ {
m_plotCurve->setTitle(m_curveName); m_qwtPlotCurve->setTitle(m_curveName);
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RimWellLogPlotCurve::isCurveVisibile() bool RimWellLogPlotCurve::isCurveVisible()
{ {
return m_showCurve; return m_showCurve;
} }
@ -253,11 +253,11 @@ void RimWellLogPlotCurve::updateTrackAndPlotFromCurveData()
if (wellLogPlot) if (wellLogPlot)
{ {
bool setDepthRange = !wellLogPlot->hasAvailableDepthRange(); bool setDepthRange = !wellLogPlot->hasAvailableDepthRange();
wellLogPlot->updateAvailableDepthRange(); wellLogPlot->calculateAvailableDepthRange();
if (setDepthRange) if (setDepthRange)
{ {
wellLogPlot->setVisibleDepthRangeFromContents(); wellLogPlot->zoomAllDepth();
} }
} }
@ -265,7 +265,7 @@ void RimWellLogPlotCurve::updateTrackAndPlotFromCurveData()
firstAnchestorOrThisOfType(plotTrack); firstAnchestorOrThisOfType(plotTrack);
if (plotTrack) if (plotTrack)
{ {
plotTrack->updateAxisRangesAndReplot(); plotTrack->allignDepthZoomToPlotAndZoomAllX();
} }
} }

View File

@ -44,35 +44,35 @@ public:
RimWellLogPlotCurve(); RimWellLogPlotCurve();
virtual ~RimWellLogPlotCurve(); virtual ~RimWellLogPlotCurve();
void setColor(const cvf::Color3f& color); void setColor(const cvf::Color3f& color);
bool depthRange(double* minimumDepth, double* maximumDepth) const; bool depthRange(double* minimumDepth, double* maximumDepth) const;
bool valueRange(double* minimumValue, double* maximumValue) const; bool valueRange(double* minimumValue, double* maximumValue) const;
void setPlot(RiuWellLogTrackPlot* plot); void setQwtTrack(RiuWellLogTrackPlot* plot);
void detachCurve(); void detachQwtCurve();
bool isCurveVisibile(); bool isCurveVisible();
QwtPlotCurve* plotCurve() const; QwtPlotCurve* plotCurve() const;
const RigWellLogCurveData* curveData() const; const RigWellLogCurveData* curveData() const;
QString name() const { return m_curveName; } QString name() const { return m_curveName; }
void updateCurveName(); void updateCurveName();
void updatePlotTitle(); void updatePlotTitle();
virtual QString wellName() const = 0; virtual QString wellName() const = 0;
virtual QString wellLogChannelName() const = 0; virtual QString wellLogChannelName() const = 0;
virtual QString wellDate() const { return ""; }; virtual QString wellDate() const { return ""; };
virtual void updatePlotData() = 0; virtual void updatePlotData() = 0;
protected: protected:
virtual QString createCurveName() = 0; virtual QString createCurveName() = 0;
void updatePlotConfiguration(); void updatePlotConfiguration();
void updateCurveVisibility(); void updateCurveVisibility();
void updateTrackAndPlotFromCurveData(); void updateTrackAndPlotFromCurveData();
void updateOptionSensitivity(); void updateOptionSensitivity();
// Overridden PDM methods // Overridden PDM methods
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue); virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
@ -81,14 +81,14 @@ protected:
virtual void initAfterRead(); virtual void initAfterRead();
RiuWellLogTrackPlot* m_plot; RiuWellLogTrackPlot* m_ownerQwtTrack;
RiuWellLogPlotCurve* m_plotCurve; RiuWellLogPlotCurve* m_qwtPlotCurve;
cvf::ref<RigWellLogCurveData> m_curveData; cvf::ref<RigWellLogCurveData> m_curveData;
caf::PdmField<bool> m_showCurve; caf::PdmField<bool> m_showCurve;
caf::PdmField<QString> m_curveName; caf::PdmField<QString> m_curveName;
caf::PdmField<QString> m_customCurveName; caf::PdmField<QString> m_customCurveName;
caf::PdmField<bool> m_autoName; caf::PdmField<bool> m_autoName;
caf::PdmField<cvf::Color3f> m_curveColor; caf::PdmField<cvf::Color3f> m_curveColor;
}; };

View File

@ -114,7 +114,7 @@ void RimWellLogPlotTrack::addCurve(RimWellLogPlotCurve* curve)
if (m_wellLogTrackPlotWidget) if (m_wellLogTrackPlotWidget)
{ {
curve->setPlot(m_wellLogTrackPlotWidget); curve->setQwtTrack(m_wellLogTrackPlotWidget);
} }
} }
@ -127,7 +127,7 @@ void RimWellLogPlotTrack::insertCurve(RimWellLogPlotCurve* curve, size_t index)
if (m_wellLogTrackPlotWidget) if (m_wellLogTrackPlotWidget)
{ {
curve->setPlot(m_wellLogTrackPlotWidget); curve->setQwtTrack(m_wellLogTrackPlotWidget);
} }
} }
@ -139,7 +139,7 @@ void RimWellLogPlotTrack::removeCurve(RimWellLogPlotCurve* curve)
size_t index = curves.index(curve); size_t index = curves.index(curve);
if ( index < curves.size()) if ( index < curves.size())
{ {
curves[index]->detachCurve(); curves[index]->detachQwtCurve();
curves.removeChildObject(curve); curves.removeChildObject(curve);
} }
} }
@ -255,7 +255,7 @@ void RimWellLogPlotTrack::recreateViewer()
for (size_t cIdx = 0; cIdx < curves.size(); ++cIdx) for (size_t cIdx = 0; cIdx < curves.size(); ++cIdx)
{ {
curves[cIdx]->setPlot(this->m_wellLogTrackPlotWidget); curves[cIdx]->setQwtTrack(this->m_wellLogTrackPlotWidget);
} }
} }
} }
@ -267,14 +267,14 @@ void RimWellLogPlotTrack::detachAllCurves()
{ {
for (size_t cIdx = 0; cIdx < curves.size(); ++cIdx) for (size_t cIdx = 0; cIdx < curves.size(); ++cIdx)
{ {
curves[cIdx]->detachCurve(); curves[cIdx]->detachQwtCurve();
} }
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogPlotTrack::updateAxisRangesAndReplot() void RimWellLogPlotTrack::allignDepthZoomToPlotAndZoomAllX()
{ {
if (m_wellLogTrackPlotWidget) if (m_wellLogTrackPlotWidget)
{ {
@ -283,13 +283,12 @@ void RimWellLogPlotTrack::updateAxisRangesAndReplot()
if (wellLogPlot) if (wellLogPlot)
{ {
double minimumDepth, maximumDepth; double minimumDepth, maximumDepth;
wellLogPlot->visibleDepthRange(&minimumDepth, &maximumDepth); wellLogPlot->depthZoomMinMax(&minimumDepth, &maximumDepth);
m_wellLogTrackPlotWidget->setDepthRange(minimumDepth, maximumDepth); m_wellLogTrackPlotWidget->setDepthZoom(minimumDepth, maximumDepth);
} }
updateXAxisRangeFromCurves(); zoomAllXAxis();
m_wellLogTrackPlotWidget->setXRange(m_visibleXRangeMin, m_visibleXRangeMax);
m_wellLogTrackPlotWidget->replot(); m_wellLogTrackPlotWidget->replot();
} }
@ -298,7 +297,7 @@ void RimWellLogPlotTrack::updateAxisRangesAndReplot()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogPlotTrack::updateXAxisRangeFromCurves() void RimWellLogPlotTrack::zoomAllXAxis()
{ {
double minValue = HUGE_VAL; double minValue = HUGE_VAL;
double maxValue = -HUGE_VAL; double maxValue = -HUGE_VAL;
@ -331,6 +330,8 @@ void RimWellLogPlotTrack::updateXAxisRangeFromCurves()
m_visibleXRangeMin = minValue; m_visibleXRangeMin = minValue;
m_visibleXRangeMax = maxValue; m_visibleXRangeMax = maxValue;
if (m_wellLogTrackPlotWidget) m_wellLogTrackPlotWidget->setXRange(m_visibleXRangeMin, m_visibleXRangeMax);
updateConnectedEditors(); updateConnectedEditors();
} }

View File

@ -57,7 +57,7 @@ public:
void loadDataAndUpdate(); void loadDataAndUpdate();
bool availableDepthRange(double* minimumDepth, double* maximumDepth); bool availableDepthRange(double* minimumDepth, double* maximumDepth);
void updateAxisRangesAndReplot(); void allignDepthZoomToPlotAndZoomAllX();
RiuWellLogTrackPlot* viewer(); RiuWellLogTrackPlot* viewer();
@ -72,7 +72,7 @@ protected:
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering); virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
private: private:
void updateXAxisRangeFromCurves(); void zoomAllXAxis();
private: private:
caf::PdmField<bool> m_show; caf::PdmField<bool> m_show;

View File

@ -269,7 +269,7 @@ void RigWellLogCurveData::computePolyLineStartStopIndices(const std::vector< std
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RigWellLogCurveData::depthRange(double* minimumDepth, double* maximumDepth) const bool RigWellLogCurveData::calculateMDRange(double* minimumDepth, double* maximumDepth) const
{ {
CVF_ASSERT(minimumDepth && maximumDepth); CVF_ASSERT(minimumDepth && maximumDepth);

View File

@ -35,39 +35,41 @@ public:
RigWellLogCurveData(); RigWellLogCurveData();
virtual ~RigWellLogCurveData(); virtual ~RigWellLogCurveData();
void setValuesAndMD(const std::vector<double>& xValues, const std::vector<double>& measuredDepths); void setValuesAndMD(const std::vector<double>& xValues,
void setValuesWithTVD(const std::vector<double>& xValues, const std::vector<double>& measuredDepths, const std::vector<double>& measuredDepths);
const std::vector<double>& tvDepths ); void setValuesWithTVD(const std::vector<double>& xValues,
bool depthRange(double* minimumDepth, double* maximumDepth) const; const std::vector<double>& measuredDepths,
const std::vector<double>& tvDepths );
const std::vector<double>& xValues() const; const std::vector<double>& xValues() const;
const std::vector<double>& measuredDepths() const; const std::vector<double>& measuredDepths() const;
bool calculateMDRange(double* minMD, double* maxMD) const;
std::vector<double> xPlotValues() const; std::vector<double> xPlotValues() const;
std::vector<double> depthPlotValues() const; std::vector<double> depthPlotValues() const;
std::vector< std::pair<size_t, size_t> > polylineStartStopIndices() const; std::vector< std::pair<size_t, size_t> > polylineStartStopIndices() const;
private: private:
void calculateIntervalsOfContinousValidValues(); void calculateIntervalsOfContinousValidValues();
static void calculateIntervalsOfValidValues(const std::vector<double>& values, static void calculateIntervalsOfValidValues(const std::vector<double>& values,
std::vector< std::pair<size_t, size_t> >* intervals); std::vector< std::pair<size_t, size_t> >* intervals);
static void splitIntervalAtEmptySpace(const std::vector<double>& depthValues, static void splitIntervalAtEmptySpace(const std::vector<double>& depthValues,
size_t startIdx, size_t stopIdx, size_t startIdx, size_t stopIdx,
std::vector< std::pair<size_t, size_t> >* intervals); std::vector< std::pair<size_t, size_t> >* intervals);
static void getValuesByIntervals(const std::vector<double>& values, static void getValuesByIntervals(const std::vector<double>& values,
const std::vector< std::pair<size_t, size_t> >& intervals, const std::vector< std::pair<size_t, size_t> >& intervals,
std::vector<double>* filteredValues); std::vector<double>* filteredValues);
static void computePolyLineStartStopIndices(const std::vector< std::pair<size_t, size_t> >& intervals, static void computePolyLineStartStopIndices(const std::vector< std::pair<size_t, size_t> >& intervals,
std::vector< std::pair<size_t, size_t> >* filteredIntervals); std::vector< std::pair<size_t, size_t> >* filteredIntervals);
private: private:
std::vector<double> m_xValues; std::vector<double> m_xValues;
std::vector<double> m_measuredDepths; std::vector<double> m_measuredDepths;
std::vector<double> m_tvDepths; std::vector<double> m_tvDepths;
std::vector< std::pair<size_t, size_t> > m_intervalsOfContinousValidValues; std::vector< std::pair<size_t, size_t> > m_intervalsOfContinousValidValues;
friend class RigWellLogCurveDataTestInterface; friend class RigWellLogCurveDataTestInterface;
}; };

View File

@ -285,7 +285,7 @@ bool RigWellLogFile::exportToLasFile(const RimWellLogPlotCurve* curve, const QSt
double minDepth = 0.0; double minDepth = 0.0;
double maxDepth = 0.0; double maxDepth = 0.0;
curveData->depthRange(&minDepth, &maxDepth); curveData->calculateMDRange(&minDepth, &maxDepth);
lasFile.setStartDepth(minDepth); lasFile.setStartDepth(minDepth);
lasFile.setStopDepth(maxDepth); lasFile.setStopDepth(maxDepth);

View File

@ -132,11 +132,11 @@ void RiuWellLogPlot::modifyWidthOfContainingMdiWindow(int widthChange)
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiuWellLogPlot::setDepthRangeAndReplot(double minDepth, double maxDepth) void RiuWellLogPlot::setDepthZoomAndReplot(double minDepth, double maxDepth)
{ {
for (int tpIdx = 0; tpIdx < m_trackPlots.count(); tpIdx++) for (int tpIdx = 0; tpIdx < m_trackPlots.count(); tpIdx++)
{ {
m_trackPlots[tpIdx]->setDepthRange(minDepth, maxDepth); m_trackPlots[tpIdx]->setDepthZoom(minDepth, maxDepth);
m_trackPlots[tpIdx]->replot(); m_trackPlots[tpIdx]->replot();
} }
@ -168,10 +168,10 @@ void RiuWellLogPlot::slotSetMinDepth(int value)
{ {
double minimumDepth; double minimumDepth;
double maximumDepth; double maximumDepth;
m_plotDefinition->visibleDepthRange(&minimumDepth, &maximumDepth); m_plotDefinition->depthZoomMinMax(&minimumDepth, &maximumDepth);
double delta = value - minimumDepth; double delta = value - minimumDepth;
m_plotDefinition->setVisibleDepthRange(minimumDepth + delta, maximumDepth + delta); m_plotDefinition->setDepthZoomMinMax(minimumDepth + delta, maximumDepth + delta);
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -49,7 +49,7 @@ public:
void insertTrackPlot(RiuWellLogTrackPlot* trackPlot, size_t index); void insertTrackPlot(RiuWellLogTrackPlot* trackPlot, size_t index);
void removeTrackPlot(RiuWellLogTrackPlot* trackPlot); void removeTrackPlot(RiuWellLogTrackPlot* trackPlot);
void setDepthRangeAndReplot(double minDepth, double maxDepth); void setDepthZoomAndReplot(double minDepth, double maxDepth);
private: private:
void updateScrollBar(double minDepth, double maxDepth); void updateScrollBar(double minDepth, double maxDepth);

View File

@ -132,7 +132,7 @@ void RiuWellLogTrackPlot::setDefaults()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiuWellLogTrackPlot::setDepthRange(double minDepth, double maxDepth) void RiuWellLogTrackPlot::setDepthZoom(double minDepth, double maxDepth)
{ {
// Note: Y-axis is inverted // Note: Y-axis is inverted
setAxisScale(QwtPlot::yLeft, maxDepth, minDepth); setAxisScale(QwtPlot::yLeft, maxDepth, minDepth);
@ -185,11 +185,11 @@ bool RiuWellLogTrackPlot::eventFilter(QObject* watched, QEvent* event)
if (wheelEvent->delta() > 0) if (wheelEvent->delta() > 0)
{ {
plotDefinition->zoomDepth(RIU_SCROLLWHEEL_ZOOMFACTOR, zoomCenter); plotDefinition->setDepthZoomByFactorAndCenter(RIU_SCROLLWHEEL_ZOOMFACTOR, zoomCenter);
} }
else else
{ {
plotDefinition->zoomDepth(1.0/RIU_SCROLLWHEEL_ZOOMFACTOR, zoomCenter); plotDefinition->setDepthZoomByFactorAndCenter(1.0/RIU_SCROLLWHEEL_ZOOMFACTOR, zoomCenter);
} }
} }
else else

View File

@ -40,7 +40,7 @@ public:
RiuWellLogTrackPlot(RimWellLogPlotTrack* plotTrackDefinition, QWidget* parent = NULL); RiuWellLogTrackPlot(RimWellLogPlotTrack* plotTrackDefinition, QWidget* parent = NULL);
virtual ~RiuWellLogTrackPlot(); virtual ~RiuWellLogTrackPlot();
void setDepthRange(double minDepth, double maxDepth); void setDepthZoom(double minDepth, double maxDepth);
void setDepthTitle(const QString& title); void setDepthTitle(const QString& title);
void setXRange(double min, double max); void setXRange(double min, double max);