mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Added collection class for well log plots
This commit is contained in:
parent
75a34e605f
commit
af9bbfdede
@ -19,9 +19,11 @@
|
||||
|
||||
#include "RicNewWellLogPlotFeature.h"
|
||||
|
||||
#include "RimProject.h"
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimWellLogPlotCollection.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
@ -33,7 +35,7 @@ CAF_CMD_SOURCE_INIT(RicNewWellLogPlotFeature, "RicNewWellLogPlotFeature");
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewWellLogPlotFeature::isCommandEnabled()
|
||||
{
|
||||
return selectedMainPlotCollection() != NULL;
|
||||
return wellLogPlotCollection() != NULL;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -41,10 +43,10 @@ bool RicNewWellLogPlotFeature::isCommandEnabled()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewWellLogPlotFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
RimMainPlotCollection* mainPlotCollection = selectedMainPlotCollection();
|
||||
if (mainPlotCollection)
|
||||
RimWellLogPlotCollection* wellLogPlotColl = wellLogPlotCollection();
|
||||
if (wellLogPlotColl)
|
||||
{
|
||||
mainPlotCollection->addWellLogPlot();
|
||||
wellLogPlotColl->addWellLogPlot();
|
||||
}
|
||||
}
|
||||
|
||||
@ -59,9 +61,10 @@ void RicNewWellLogPlotFeature::setupActionLook(QAction* actionToSetup)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimMainPlotCollection* RicNewWellLogPlotFeature::selectedMainPlotCollection()
|
||||
RimWellLogPlotCollection* RicNewWellLogPlotFeature::wellLogPlotCollection()
|
||||
{
|
||||
std::vector<RimMainPlotCollection*> selection;
|
||||
caf::SelectionManager::instance()->objectsByType(&selection);
|
||||
return selection.size() > 0 ? selection[0] : NULL;
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
RimMainPlotCollection* mainPlotCollection = project ? project->mainPlotCollection() : NULL;
|
||||
|
||||
return mainPlotCollection ? mainPlotCollection->wellLogPlotCollection() : NULL;
|
||||
}
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
class RimMainPlotCollection;
|
||||
class RimWellLogPlotCollection;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@ -37,6 +37,5 @@ protected:
|
||||
virtual void setupActionLook( QAction* actionToSetup );
|
||||
|
||||
private:
|
||||
|
||||
RimMainPlotCollection* selectedMainPlotCollection();
|
||||
RimWellLogPlotCollection* wellLogPlotCollection();
|
||||
};
|
||||
|
@ -62,6 +62,7 @@ ${CEE_CURRENT_LIST_DIR}RimTreeViewStateSerializer.h
|
||||
${CEE_CURRENT_LIST_DIR}RimManagedViewConfig.h
|
||||
${CEE_CURRENT_LIST_DIR}RimManagedViewCollection.h
|
||||
${CEE_CURRENT_LIST_DIR}RimMainPlotCollection.h
|
||||
${CEE_CURRENT_LIST_DIR}RimWellLogPlotCollection.h
|
||||
${CEE_CURRENT_LIST_DIR}RimWellLogPlot.h
|
||||
${CEE_CURRENT_LIST_DIR}RimWellLogPlotTrace.h
|
||||
${CEE_CURRENT_LIST_DIR}RimWellLogPlotCurve.h
|
||||
@ -125,6 +126,7 @@ ${CEE_CURRENT_LIST_DIR}RimTreeViewStateSerializer.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimManagedViewConfig.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimManagedViewCollection.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimMainPlotCollection.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimWellLogPlotCollection.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimWellLogPlot.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimWellLogPlotTrace.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimWellLogPlotCurve.cpp
|
||||
|
@ -18,7 +18,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimWellLogPlot.h"
|
||||
#include "RimWellLogPlotCollection.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
@ -36,8 +36,10 @@ RimMainPlotCollection::RimMainPlotCollection()
|
||||
CAF_PDM_InitField(&show, "Show", true, "Show plots", "", "", "");
|
||||
show.uiCapability()->setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&wellLogPlots, "WellLogPlots", "", "", "", "");
|
||||
wellLogPlots.uiCapability()->setUiHidden(true);
|
||||
CAF_PDM_InitFieldNoDefault(&wellLogPlotCollection, "WellLogPlotCollection", "", "", "", "");
|
||||
wellLogPlotCollection.uiCapability()->setUiHidden(true);
|
||||
|
||||
wellLogPlotCollection = new RimWellLogPlotCollection();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -45,6 +47,7 @@ RimMainPlotCollection::RimMainPlotCollection()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimMainPlotCollection::~RimMainPlotCollection()
|
||||
{
|
||||
if (wellLogPlotCollection()) delete wellLogPlotCollection();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -61,15 +64,3 @@ caf::PdmFieldHandle* RimMainPlotCollection::objectToggleField()
|
||||
{
|
||||
return &show;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimMainPlotCollection::addWellLogPlot()
|
||||
{
|
||||
RimWellLogPlot* view = new RimWellLogPlot();
|
||||
wellLogPlots.push_back(view);
|
||||
|
||||
RiuMainWindow::instance()->projectTreeView()->setExpanded(this, true);
|
||||
updateConnectedEditors();
|
||||
}
|
||||
|
@ -21,9 +21,9 @@
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmChildArrayField.h"
|
||||
#include "cafPdmChildField.h"
|
||||
|
||||
class RimWellLogPlot;
|
||||
class RimWellLogPlotCollection;
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
@ -37,7 +37,7 @@ public:
|
||||
RimMainPlotCollection();
|
||||
virtual ~RimMainPlotCollection();
|
||||
|
||||
void addWellLogPlot();
|
||||
caf::PdmChildField<RimWellLogPlotCollection*> wellLogPlotCollection;
|
||||
|
||||
protected:
|
||||
|
||||
@ -49,5 +49,4 @@ private:
|
||||
|
||||
private:
|
||||
caf::PdmField<bool> show;
|
||||
caf::PdmChildArrayField<RimWellLogPlot*> wellLogPlots;
|
||||
};
|
||||
|
@ -565,7 +565,11 @@ void RimProject::actionsBasedOnSelection(QMenu& contextMenu)
|
||||
std::vector<caf::PdmUiItem*> uiItems;
|
||||
caf::SelectionManager::instance()->selectedItems(uiItems);
|
||||
|
||||
if (uiItems.size() > 1)
|
||||
if (uiItems.size() == 0)
|
||||
{
|
||||
commandIds << "RicNewWellLogPlotFeature";
|
||||
}
|
||||
else if (uiItems.size() > 1)
|
||||
{
|
||||
commandIds << "RicCopyReferencesToClipboardFeature";
|
||||
}
|
||||
@ -718,10 +722,6 @@ void RimProject::actionsBasedOnSelection(QMenu& contextMenu)
|
||||
{
|
||||
commandIds << "RicDeleteItemFeature";
|
||||
}
|
||||
else if (dynamic_cast<RimMainPlotCollection*>(uiItem))
|
||||
{
|
||||
commandIds << "RicNewWellLogPlotFeature";
|
||||
}
|
||||
|
||||
if (dynamic_cast<RimManagedViewCollection*>(uiItem))
|
||||
{
|
||||
|
@ -59,10 +59,11 @@ public:
|
||||
RimProject(void);
|
||||
virtual ~RimProject(void);
|
||||
|
||||
caf::PdmChildArrayField<RimOilField*> oilFields;
|
||||
caf::PdmChildField<RimScriptCollection*> scriptCollection;
|
||||
caf::PdmChildField<RimWellPathImport*> wellPathImport;
|
||||
caf::PdmChildArrayField<RimCommandObject*> commandObjects;
|
||||
caf::PdmChildArrayField<RimOilField*> oilFields;
|
||||
caf::PdmChildField<RimScriptCollection*> scriptCollection;
|
||||
caf::PdmChildField<RimWellPathImport*> wellPathImport;
|
||||
caf::PdmChildField<RimMainPlotCollection*> mainPlotCollection;
|
||||
caf::PdmChildArrayField<RimCommandObject*> commandObjects;
|
||||
caf::PdmField<QString> treeViewState;
|
||||
caf::PdmField<QString> currentModelIndexPath;
|
||||
|
||||
@ -104,6 +105,4 @@ private:
|
||||
|
||||
caf::PdmChildArrayField<RimEclipseCase*> casesObsolete; // obsolete
|
||||
caf::PdmChildArrayField<RimIdenticalGridCaseGroup*> caseGroupsObsolete; // obsolete
|
||||
|
||||
caf::PdmChildField<RimMainPlotCollection*> mainPlotCollection;
|
||||
};
|
||||
|
@ -0,0 +1,75 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2015- Statoil ASA
|
||||
// Copyright (C) 2015- Ceetron Solutions AS
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RimWellLogPlotCollection.h"
|
||||
#include "RimWellLogPlot.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
#include "cafPdmUiTreeView.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimWellLogPlotCollection, "WellLogPlotCollection");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellLogPlotCollection::RimWellLogPlotCollection()
|
||||
{
|
||||
CAF_PDM_InitObject("Well Log Plots", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&show, "Show", true, "Show plots", "", "", "");
|
||||
show.uiCapability()->setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&wellLogPlots, "WellLogPlots", "", "", "", "");
|
||||
wellLogPlots.uiCapability()->setUiHidden(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellLogPlotCollection::~RimWellLogPlotCollection()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogPlotCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* RimWellLogPlotCollection::objectToggleField()
|
||||
{
|
||||
return &show;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogPlotCollection::addWellLogPlot()
|
||||
{
|
||||
RimWellLogPlot* view = new RimWellLogPlot();
|
||||
wellLogPlots.push_back(view);
|
||||
|
||||
RiuMainWindow::instance()->projectTreeView()->setExpanded(this, true);
|
||||
updateConnectedEditors();
|
||||
}
|
53
ApplicationCode/ProjectDataModel/RimWellLogPlotCollection.h
Normal file
53
ApplicationCode/ProjectDataModel/RimWellLogPlotCollection.h
Normal file
@ -0,0 +1,53 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2015- Statoil ASA
|
||||
// Copyright (C) 2015- Ceetron Solutions AS
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmChildArrayField.h"
|
||||
|
||||
class RimWellLogPlot;
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimWellLogPlotCollection : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
public:
|
||||
RimWellLogPlotCollection();
|
||||
virtual ~RimWellLogPlotCollection();
|
||||
|
||||
void addWellLogPlot();
|
||||
|
||||
protected:
|
||||
|
||||
// Overridden PDM methods
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||
|
||||
private:
|
||||
virtual caf::PdmFieldHandle* objectToggleField();
|
||||
|
||||
private:
|
||||
caf::PdmField<bool> show;
|
||||
caf::PdmChildArrayField<RimWellLogPlot*> wellLogPlots;
|
||||
};
|
Loading…
Reference in New Issue
Block a user