mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#396) Create main plot collection and well log plot collection if needed
Reading old project files may give projects without main plot collection and well plot collection. Those are now created in the command feature for adding a new well log plot, if needed.
This commit is contained in:
@@ -36,10 +36,10 @@ RimMainPlotCollection::RimMainPlotCollection()
|
||||
CAF_PDM_InitField(&show, "Show", true, "Show plots", "", "", "");
|
||||
show.uiCapability()->setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&wellLogPlotCollection, "WellLogPlotCollection", "", "", "", "");
|
||||
wellLogPlotCollection.uiCapability()->setUiHidden(true);
|
||||
CAF_PDM_InitFieldNoDefault(&m_wellLogPlotCollection, "WellLogPlotCollection", "", "", "", "");
|
||||
m_wellLogPlotCollection.uiCapability()->setUiHidden(true);
|
||||
|
||||
wellLogPlotCollection = new RimWellLogPlotCollection();
|
||||
m_wellLogPlotCollection = new RimWellLogPlotCollection();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -47,7 +47,7 @@ RimMainPlotCollection::RimMainPlotCollection()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimMainPlotCollection::~RimMainPlotCollection()
|
||||
{
|
||||
if (wellLogPlotCollection()) delete wellLogPlotCollection();
|
||||
if (m_wellLogPlotCollection()) delete m_wellLogPlotCollection();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -64,3 +64,22 @@ caf::PdmFieldHandle* RimMainPlotCollection::objectToggleField()
|
||||
{
|
||||
return &show;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimMainPlotCollection::recreateWellLogPlotCollection()
|
||||
{
|
||||
if (!wellLogPlotCollection())
|
||||
{
|
||||
m_wellLogPlotCollection = new RimWellLogPlotCollection();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellLogPlotCollection* RimMainPlotCollection::wellLogPlotCollection()
|
||||
{
|
||||
return m_wellLogPlotCollection();
|
||||
}
|
||||
|
||||
@@ -37,7 +37,8 @@ public:
|
||||
RimMainPlotCollection();
|
||||
virtual ~RimMainPlotCollection();
|
||||
|
||||
caf::PdmChildField<RimWellLogPlotCollection*> wellLogPlotCollection;
|
||||
RimWellLogPlotCollection* wellLogPlotCollection();
|
||||
void recreateWellLogPlotCollection();
|
||||
|
||||
protected:
|
||||
|
||||
@@ -46,7 +47,8 @@ protected:
|
||||
|
||||
private:
|
||||
virtual caf::PdmFieldHandle* objectToggleField();
|
||||
|
||||
|
||||
private:
|
||||
caf::PdmChildField<RimWellLogPlotCollection*> m_wellLogPlotCollection;
|
||||
caf::PdmField<bool> show;
|
||||
};
|
||||
|
||||
@@ -937,3 +937,14 @@ RimLinkedViews* RimProject::findLinkedViewsGroupForView(RimView* view)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimProject::recreateMainPlotCollection()
|
||||
{
|
||||
if (!mainPlotCollection())
|
||||
{
|
||||
mainPlotCollection = new RimMainPlotCollection();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -92,6 +92,7 @@ public:
|
||||
void actionsBasedOnSelection(QMenu& contextMenu);
|
||||
|
||||
RimLinkedViews* findLinkedViewsGroupForView(RimView* view);
|
||||
void recreateMainPlotCollection();
|
||||
|
||||
protected:
|
||||
// Overridden methods
|
||||
|
||||
Reference in New Issue
Block a user