mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3136 Fix RFT/PLT plots and refactor the way Mdi windows are resized when adding/removing plot tracks.
This commit is contained in:
@@ -104,6 +104,22 @@ RimWellLogPlot::~RimWellLogPlot()
|
||||
deleteViewWidget();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QWidget* RimWellLogPlot::createPlotWidget()
|
||||
{
|
||||
return createViewWidget(nullptr);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QWidget* RimWellLogPlot::viewWidget()
|
||||
{
|
||||
return m_viewer;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -220,14 +236,6 @@ QImage RimWellLogPlot::snapshotWindowContent()
|
||||
return image;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogPlot::updateViewWidgetAfterCreation()
|
||||
{
|
||||
recreateTrackPlots();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -269,46 +277,6 @@ void RimWellLogPlot::removeTrack(RimWellLogTrack* track)
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogPlot::removeTrackByIndex(size_t index)
|
||||
{
|
||||
CVF_ASSERT(index < m_tracks.size());
|
||||
|
||||
RimWellLogTrack* track = m_tracks[index];
|
||||
this->removeTrack(track);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogPlot::moveTracks(RimWellLogTrack* insertAfterTrack, const std::vector<RimWellLogTrack*>& tracksToMove)
|
||||
{
|
||||
for (size_t tIdx = 0; tIdx < tracksToMove.size(); tIdx++)
|
||||
{
|
||||
RimWellLogTrack* track = tracksToMove[tIdx];
|
||||
|
||||
RimWellLogPlot* wellLogPlot;
|
||||
track->firstAncestorOrThisOfType(wellLogPlot);
|
||||
if (wellLogPlot)
|
||||
{
|
||||
wellLogPlot->removeTrack(track);
|
||||
wellLogPlot->updateTrackNames();
|
||||
wellLogPlot->updateConnectedEditors();
|
||||
}
|
||||
}
|
||||
|
||||
size_t index = m_tracks.index(insertAfterTrack) + 1;
|
||||
|
||||
for (size_t tIdx = 0; tIdx < tracksToMove.size(); tIdx++)
|
||||
{
|
||||
insertTrack(tracksToMove[tIdx], index + tIdx);
|
||||
}
|
||||
|
||||
updateTrackNames();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -422,14 +390,6 @@ void RimWellLogPlot::zoomAll()
|
||||
updateTracks(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QWidget* RimWellLogPlot::viewWidget()
|
||||
{
|
||||
return m_viewer;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -769,6 +729,7 @@ QString RimWellLogPlot::description() const
|
||||
QWidget* RimWellLogPlot::createViewWidget(QWidget* mainWindowParent)
|
||||
{
|
||||
m_viewer = new RiuWellLogPlot(this, mainWindowParent);
|
||||
recreateTrackPlots();
|
||||
return m_viewer;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user