mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#7128 VFP Plot: fix delete functionality.
This commit is contained in:
parent
4414b61efd
commit
ba372f7fbe
@ -135,6 +135,8 @@ RimVfpPlot::RimVfpPlot()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimVfpPlot::~RimVfpPlot()
|
||||
{
|
||||
removeMdiWindowFromMdiArea();
|
||||
deleteViewWidget();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -60,7 +60,15 @@ void RimVfpPlotCollection::addPlot( RimVfpPlot* newPlot )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimVfpPlot*> RimVfpPlotCollection::plots()
|
||||
void RimVfpPlotCollection::insertPlot( RimVfpPlot* vfpPlot, size_t index )
|
||||
{
|
||||
m_vfpPlots.insert( index, vfpPlot );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimVfpPlot*> RimVfpPlotCollection::plots() const
|
||||
{
|
||||
return m_vfpPlots.childObjects();
|
||||
}
|
||||
@ -72,3 +80,20 @@ void RimVfpPlotCollection::deleteAllChildObjects()
|
||||
{
|
||||
m_vfpPlots.deleteAllChildObjects();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RimVfpPlotCollection::plotCount() const
|
||||
{
|
||||
return m_vfpPlots.size();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimVfpPlotCollection::removePlot( RimVfpPlot* vfpPlot )
|
||||
{
|
||||
m_vfpPlots.removeChildObject( vfpPlot );
|
||||
updateAllRequiredEditors();
|
||||
}
|
||||
|
@ -17,16 +17,17 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma once
|
||||
|
||||
#include "RimAbstractPlotCollection.h"
|
||||
#include "RimVfpPlot.h"
|
||||
|
||||
#include "cafPdmChildArrayField.h"
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
class RimVfpPlot;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimVfpPlotCollection : public caf::PdmObject
|
||||
class RimVfpPlotCollection : public caf::PdmObject, public RimTypedPlotCollection<RimVfpPlot>
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
@ -35,9 +36,13 @@ public:
|
||||
~RimVfpPlotCollection() override;
|
||||
|
||||
void addPlot( RimVfpPlot* newPlot );
|
||||
std::vector<RimVfpPlot*> plots();
|
||||
std::vector<RimVfpPlot*> plots() const;
|
||||
void deleteAllChildObjects();
|
||||
|
||||
size_t plotCount() const final;
|
||||
void insertPlot( RimVfpPlot* vfpPlot, size_t index ) final;
|
||||
void removePlot( RimVfpPlot* vfpPlot ) final;
|
||||
|
||||
private:
|
||||
caf::PdmChildArrayField<RimVfpPlot*> m_vfpPlots;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user