mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add deleteAllCurves method, and rename removeCurve to takeOutCurve in order to minimize wrong use.
This commit is contained in:
parent
f14eb44efd
commit
07264140cb
@ -46,7 +46,7 @@ void RicWellLogPlotTrackFeatureImpl::moveCurvesToWellLogPlotTrack(RimWellLogTrac
|
|||||||
curve->firstAncestorOrThisOfType(wellLogPlotTrack);
|
curve->firstAncestorOrThisOfType(wellLogPlotTrack);
|
||||||
if (wellLogPlotTrack)
|
if (wellLogPlotTrack)
|
||||||
{
|
{
|
||||||
wellLogPlotTrack->removeCurve(curve);
|
wellLogPlotTrack->takeOutCurve(curve);
|
||||||
wellLogPlotTrack->updateConnectedEditors();
|
wellLogPlotTrack->updateConnectedEditors();
|
||||||
srcTracks.insert(wellLogPlotTrack);
|
srcTracks.insert(wellLogPlotTrack);
|
||||||
RimWellLogPlot* plot;
|
RimWellLogPlot* plot;
|
||||||
|
@ -521,10 +521,7 @@ void RimWellRftPlot::updateCurvesInPlot(const std::set<RiaRftPltCurveDefinition>
|
|||||||
RimWellLogTrack* const plotTrack = m_wellLogPlot->trackByIndex(0);
|
RimWellLogTrack* const plotTrack = m_wellLogPlot->trackByIndex(0);
|
||||||
|
|
||||||
// Delete curves
|
// Delete curves
|
||||||
for (RimWellLogCurve* const curve : curvesToDelete)
|
plotTrack->deleteAllCurves();
|
||||||
{
|
|
||||||
plotTrack->removeCurve(curve);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add new curves
|
// Add new curves
|
||||||
for (const RiaRftPltCurveDefinition& curveDefToAdd : curveDefsToAdd)
|
for (const RiaRftPltCurveDefinition& curveDefToAdd : curveDefsToAdd)
|
||||||
@ -796,10 +793,8 @@ void RimWellRftPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
|
|||||||
if (changedField == &m_wellPathNameOrSimWellName || changedField == &m_branchIndex)
|
if (changedField == &m_wellPathNameOrSimWellName || changedField == &m_branchIndex)
|
||||||
{
|
{
|
||||||
RimWellLogTrack* const plotTrack = m_wellLogPlot->trackByIndex(0);
|
RimWellLogTrack* const plotTrack = m_wellLogPlot->trackByIndex(0);
|
||||||
for (RimWellLogCurve* const curve : plotTrack->curvesVector())
|
plotTrack->deleteAllCurves();
|
||||||
{
|
|
||||||
plotTrack->removeCurve(curve);
|
|
||||||
}
|
|
||||||
m_timeStepsToAddresses.clear();
|
m_timeStepsToAddresses.clear();
|
||||||
updateEditorsFromCurves();
|
updateEditorsFromCurves();
|
||||||
updateFormationsOnPlot();
|
updateFormationsOnPlot();
|
||||||
|
@ -391,7 +391,7 @@ void RimWellLogTrack::insertCurve(RimWellLogCurve* curve, size_t index)
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimWellLogTrack::removeCurve(RimWellLogCurve* curve)
|
void RimWellLogTrack::takeOutCurve(RimWellLogCurve* curve)
|
||||||
{
|
{
|
||||||
size_t index = curves.index(curve);
|
size_t index = curves.index(curve);
|
||||||
if ( index < curves.size())
|
if ( index < curves.size())
|
||||||
@ -401,6 +401,14 @@ void RimWellLogTrack::removeCurve(RimWellLogCurve* curve)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimWellLogTrack::deleteAllCurves()
|
||||||
|
{
|
||||||
|
curves.deleteAllChildObjects();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -73,7 +73,9 @@ public:
|
|||||||
bool isVisible();
|
bool isVisible();
|
||||||
void addCurve(RimWellLogCurve* curve);
|
void addCurve(RimWellLogCurve* curve);
|
||||||
void insertCurve(RimWellLogCurve* curve, size_t index);
|
void insertCurve(RimWellLogCurve* curve, size_t index);
|
||||||
void removeCurve(RimWellLogCurve* curve);
|
void takeOutCurve(RimWellLogCurve* curve);
|
||||||
|
void deleteAllCurves();
|
||||||
|
|
||||||
size_t curveIndex(RimWellLogCurve* curve);
|
size_t curveIndex(RimWellLogCurve* curve);
|
||||||
size_t curveCount() { return curves.size(); }
|
size_t curveCount() { return curves.size(); }
|
||||||
void setXAxisTitle(const QString& text);
|
void setXAxisTitle(const QString& text);
|
||||||
|
Loading…
Reference in New Issue
Block a user