mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#592) Plots and tracks are now autoscaled on curve drag, drop, delete, toggled
This commit is contained in:
@@ -121,7 +121,7 @@ void RicDeleteItemExec::redo()
|
||||
parentObj->firstAnchestorOrThisOfType(wellLogPlotTrack);
|
||||
if (wellLogPlotTrack)
|
||||
{
|
||||
wellLogPlotTrack->alignDepthZoomToPlotAndZoomAllX();
|
||||
wellLogPlotTrack->zoomAllXAndZoomAllDepthOnOwnerPlot();
|
||||
}
|
||||
|
||||
RimWellLogPlotCollection* wellLogPlotCollection = NULL;
|
||||
|
||||
@@ -30,38 +30,53 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicWellLogPlotTrackFeatureImpl::moveCurvesToWellLogPlotTrack(RimWellLogPlotTrack* wellLogPlotTrack, const std::vector<RimWellLogPlotCurve*>& curves)
|
||||
void RicWellLogPlotTrackFeatureImpl::moveCurvesToWellLogPlotTrack(RimWellLogPlotTrack* destTrack,
|
||||
const std::vector<RimWellLogPlotCurve*>& curves,
|
||||
RimWellLogPlotCurve* insertAfterCurve)
|
||||
{
|
||||
CVF_ASSERT(wellLogPlotTrack);
|
||||
CVF_ASSERT(destTrack );
|
||||
|
||||
std::set<RimWellLogPlotTrack*> srcTracks;
|
||||
std::set<RimWellLogPlot*> srcPlots;
|
||||
|
||||
for (size_t cIdx = 0; cIdx < curves.size(); cIdx++)
|
||||
{
|
||||
RimWellLogPlotTrack* oldPlotTrack;
|
||||
curves[cIdx]->firstAnchestorOrThisOfType(oldPlotTrack);
|
||||
if (oldPlotTrack)
|
||||
RimWellLogPlotCurve* curve = curves[cIdx];
|
||||
|
||||
RimWellLogPlotTrack* wellLogPlotTrack;
|
||||
curve->firstAnchestorOrThisOfType(wellLogPlotTrack);
|
||||
if (wellLogPlotTrack)
|
||||
{
|
||||
oldPlotTrack->removeCurve(curves[cIdx]);
|
||||
oldPlotTrack->updateConnectedEditors();
|
||||
wellLogPlotTrack->removeCurve(curve);
|
||||
wellLogPlotTrack->updateConnectedEditors();
|
||||
srcTracks.insert(wellLogPlotTrack);
|
||||
RimWellLogPlot* plot;
|
||||
wellLogPlotTrack->firstAnchestorOrThisOfType(plot);
|
||||
if (plot) srcPlots.insert(plot);
|
||||
}
|
||||
|
||||
wellLogPlotTrack->insertCurve(curves[cIdx], cIdx);
|
||||
}
|
||||
wellLogPlotTrack->loadDataAndUpdate();
|
||||
wellLogPlotTrack->alignDepthZoomToPlotAndZoomAllX();
|
||||
wellLogPlotTrack->updateConnectedEditors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicWellLogPlotTrackFeatureImpl::moveCurvesToWellLogPlotTrack(RimWellLogPlotTrack* wellLogPlotTrack, const std::vector<RimWellLogPlotCurve*>& curves, RimWellLogPlotCurve* insertAfterCurve)
|
||||
{
|
||||
CVF_ASSERT(wellLogPlotTrack && insertAfterCurve);
|
||||
size_t insertionStartIndex = 0;
|
||||
if (insertAfterCurve) insertionStartIndex = destTrack->curveIndex(insertAfterCurve) + 1;
|
||||
|
||||
wellLogPlotTrack->moveCurves(insertAfterCurve, curves);
|
||||
wellLogPlotTrack->loadDataAndUpdate();
|
||||
wellLogPlotTrack->alignDepthZoomToPlotAndZoomAllX();
|
||||
wellLogPlotTrack->updateConnectedEditors();
|
||||
for (size_t cIdx = 0; cIdx < curves.size(); cIdx++)
|
||||
{
|
||||
destTrack->insertCurve(curves[cIdx], insertionStartIndex + cIdx);
|
||||
}
|
||||
|
||||
for (std::set<RimWellLogPlot*>::iterator pIt = srcPlots.begin(); pIt != srcPlots.end(); ++pIt)
|
||||
{
|
||||
(*pIt)->calculateAvailableDepthRange();
|
||||
}
|
||||
|
||||
for (std::set<RimWellLogPlotTrack*>::iterator tIt = srcTracks.begin(); tIt != srcTracks.end(); ++tIt)
|
||||
{
|
||||
(*tIt)->zoomAllXAndZoomAllDepthOnOwnerPlot();
|
||||
}
|
||||
|
||||
destTrack->loadDataAndUpdate();
|
||||
destTrack->zoomAllXAndZoomAllDepthOnOwnerPlot();
|
||||
destTrack->updateConnectedEditors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -32,8 +32,7 @@ class RicWellLogPlotTrackFeatureImpl
|
||||
{
|
||||
public:
|
||||
|
||||
static void moveCurvesToWellLogPlotTrack(RimWellLogPlotTrack* wellLogPlotTrack, const std::vector<RimWellLogPlotCurve*>& curves);
|
||||
static void moveCurvesToWellLogPlotTrack(RimWellLogPlotTrack* wellLogPlotTrack, const std::vector<RimWellLogPlotCurve*>& curves, RimWellLogPlotCurve* insertAfterCurve);
|
||||
static void moveCurvesToWellLogPlotTrack(RimWellLogPlotTrack* dstTrack, const std::vector<RimWellLogPlotCurve*>& curves, RimWellLogPlotCurve* insertAfterCurve);
|
||||
static void moveTracksToWellLogPlot(RimWellLogPlot* wellLogPlot, const std::vector<RimWellLogPlotTrack*>& tracks);
|
||||
static void moveTracks(RimWellLogPlotTrack* insertAfterTrack, const std::vector<RimWellLogPlotTrack*>& tracks);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user