WIP - added project data model files for well log plots

Added command feature for adding new well log plots (right-click "Plots"
in the project tree view). Will create dummy Qwt widget added as an MDI
window.
TODO: Complete the relations between the entities, and add
properties/property editors. Create more advanced viewer widget for
plotting of multiple traces with multiple curves. Harmonize MDI stuff
with 3D viewers.
This commit is contained in:
Pål Hagen
2015-08-27 16:13:49 +02:00
parent b7d04375c8
commit 4e6bb1ded3
19 changed files with 637 additions and 29 deletions

View File

@@ -61,6 +61,10 @@ ${CEE_CURRENT_LIST_DIR}RimCase.h
${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}RimWellLogPlot.h
${CEE_CURRENT_LIST_DIR}RimWellLogPlotTrace.h
${CEE_CURRENT_LIST_DIR}RimWellLogPlotCurve.h
)
set (SOURCE_GROUP_SOURCE_FILES
@@ -120,7 +124,10 @@ ${CEE_CURRENT_LIST_DIR}RimCase.cpp
${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}RimWellLogPlot.cpp
${CEE_CURRENT_LIST_DIR}RimWellLogPlotTrace.cpp
${CEE_CURRENT_LIST_DIR}RimWellLogPlotCurve.cpp
)
list(APPEND CODE_HEADER_FILES

View File

@@ -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 "RimMainPlotCollection.h"
#include "RimWellLogPlot.h"
#include "RiuMainWindow.h"
#include "cafPdmUiTreeView.h"
CAF_PDM_SOURCE_INIT(RimMainPlotCollection, "MainPlotCollection");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimMainPlotCollection::RimMainPlotCollection()
{
CAF_PDM_InitObject("Plots", "", "", "");
CAF_PDM_InitField(&show, "Show", true, "Show plots", "", "", "");
show.uiCapability()->setUiHidden(true);
CAF_PDM_InitFieldNoDefault(&wellLogPlots, "WellLogPlots", "", "", "", "");
wellLogPlots.uiCapability()->setUiHidden(true);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimMainPlotCollection::~RimMainPlotCollection()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimMainPlotCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmFieldHandle* RimMainPlotCollection::objectToggleField()
{
return &show;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimMainPlotCollection::addWellLogPlot()
{
RimWellLogPlot* view = new RimWellLogPlot();
wellLogPlots.push_back(view);
RiuMainWindow::instance()->projectTreeView()->setExpanded(this, true);
updateConnectedEditors();
}

View 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 RimMainPlotCollection : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RimMainPlotCollection();
virtual ~RimMainPlotCollection();
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;
};

View File

@@ -47,6 +47,7 @@
#include "RimWellPath.h"
#include "RimWellPathCollection.h"
#include "RimWellPathImport.h"
#include "RimMainPlotCollection.h"
#include "RiuMainWindow.h"
@@ -86,6 +87,9 @@ RimProject::RimProject(void)
wellPathImport.uiCapability()->setUiHidden(true);
wellPathImport.uiCapability()->setUiChildrenHidden(true);
CAF_PDM_InitFieldNoDefault(&mainPlotCollection, "MainPlotCollection", "Plots", ":/Default.png", "", "");
mainPlotCollection.uiCapability()->setUiHidden(true);
CAF_PDM_InitFieldNoDefault(&commandObjects, "CommandObjects", "CommandObjects", "", "", "");
//wellPathImport.uiCapability()->setUiHidden(true);
@@ -107,6 +111,8 @@ RimProject::RimProject(void)
scriptCollection->uiCapability()->setUiName("Scripts");
scriptCollection->uiCapability()->setUiIcon(QIcon(":/Default.png"));
mainPlotCollection = new RimMainPlotCollection();
// For now, create a default first oilfield that contains the rest of the project
oilFields.push_back(new RimOilField);
@@ -124,6 +130,7 @@ RimProject::~RimProject(void)
oilFields.deleteAllChildObjects();
if (scriptCollection()) delete scriptCollection();
if (mainPlotCollection()) delete mainPlotCollection();
}
//--------------------------------------------------------------------------------------------------
@@ -711,7 +718,11 @@ void RimProject::actionsBasedOnSelection(QMenu& contextMenu)
{
commandIds << "RicDeleteItemFeature";
}
else if (dynamic_cast<RimMainPlotCollection*>(uiItem))
{
commandIds << "RicNewWellLogPlotFeature";
}
if (dynamic_cast<RimManagedViewCollection*>(uiItem))
{
RimManagedViewCollection* viewCollection = dynamic_cast<RimManagedViewCollection*>(uiItem);
@@ -841,6 +852,8 @@ void RimProject::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QS
}
uiTreeOrdering.add(scriptCollection());
if (mainPlotCollection) uiTreeOrdering.add(mainPlotCollection());
uiTreeOrdering.setForgetRemainingFields(true);
}

View File

@@ -36,6 +36,7 @@ class RimIdenticalGridCaseGroup;
class RimOilField;
class RimScriptCollection;
class RimWellPathImport;
class RimMainPlotCollection;
namespace caf
{
@@ -104,4 +105,5 @@ private:
caf::PdmChildArrayField<RimEclipseCase*> casesObsolete; // obsolete
caf::PdmChildArrayField<RimIdenticalGridCaseGroup*> caseGroupsObsolete; // obsolete
caf::PdmChildField<RimMainPlotCollection*> mainPlotCollection;
};

View File

@@ -0,0 +1,89 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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 "RimWellLogPlot.h"
#include "RiuWellLogPlot.h"
#include "RiuMainWindow.h"
CAF_PDM_SOURCE_INIT(RimWellLogPlot, "WellLogPlot");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellLogPlot::RimWellLogPlot()
{
CAF_PDM_InitObject("Well Log Plot", ":/WellCollection.png", "", "");
m_viewer = NULL;
CAF_PDM_InitField(&showWindow, "ShowWindow", true, "Show well log plot", "", "", "");
showWindow.uiCapability()->setUiHidden(true);
updateViewerWidget();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellLogPlot::~RimWellLogPlot()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPlot::updateViewerWidget()
{
if (showWindow())
{
bool isViewerCreated = false;
if (!m_viewer)
{
m_viewer = new RiuWellLogPlot(RiuMainWindow::instance());
RiuMainWindow::instance()->addWellLogViewer(m_viewer);
isViewerCreated = true;
}
RiuMainWindow::instance()->setActiveWellLogViewer(m_viewer);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
{
if (changedField == &showWindow)
{
if (newValue == true)
{
updateViewerWidget();
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmFieldHandle* RimWellLogPlot::objectToggleField()
{
return &showWindow;
}

View File

@@ -0,0 +1,57 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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 <QPointer>
class RiuWellLogPlot;
//==================================================================================================
///
///
//==================================================================================================
class RimWellLogPlot : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RimWellLogPlot();
virtual ~RimWellLogPlot();
caf::PdmField<bool> showWindow;
protected:
// Overridden PDM methods
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
private:
void updateViewerWidget();
virtual caf::PdmFieldHandle* objectToggleField();
// TODO: Add traces
private:
QPointer<RiuWellLogPlot> m_viewer;
};

View File

@@ -17,20 +17,40 @@
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimWellLogViewer.h"
#include "RimWellLogPlotCurve.h"
CAF_PDM_SOURCE_INIT(RimWellLogViewer, "WellLogViewer");
CAF_PDM_SOURCE_INIT(RimWellLogPlotCurve, "WellLogPlotCurve");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellLogViewer::RimWellLogViewer(void)
RimWellLogPlotCurve::RimWellLogPlotCurve()
{
CAF_PDM_InitObject("Curve", "", "", "");
CAF_PDM_InitField(&show, "Show", true, "Show curve", "", "", "");
show.uiCapability()->setUiHidden(true);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellLogPlotCurve::~RimWellLogPlotCurve()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellLogViewer::~RimWellLogViewer(void)
void RimWellLogPlotCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmFieldHandle* RimWellLogPlotCurve::objectToggleField()
{
return &show;
}

View File

@@ -0,0 +1,48 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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"
//==================================================================================================
///
///
//==================================================================================================
class RimWellLogPlotCurve : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RimWellLogPlotCurve();
virtual ~RimWellLogPlotCurve();
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;
// TODO: Add curves
};

View File

@@ -0,0 +1,56 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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 "RimWellLogPlotTrace.h"
CAF_PDM_SOURCE_INIT(RimWellLogPlotTrace, "WellLogPlotTrace");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellLogPlotTrace::RimWellLogPlotTrace()
{
CAF_PDM_InitObject("Trace", "", "", "");
CAF_PDM_InitField(&show, "Show", true, "Show trace", "", "", "");
show.uiCapability()->setUiHidden(true);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellLogPlotTrace::~RimWellLogPlotTrace()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPlotTrace::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmFieldHandle* RimWellLogPlotTrace::objectToggleField()
{
return &show;
}

View File

@@ -20,16 +20,27 @@
#pragma once
#include "cafPdmObject.h"
#include "cafPdmField.h"
//==================================================================================================
///
///
//==================================================================================================
class RimWellLogViewer : public caf::PdmObject
class RimWellLogPlotTrace : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RimWellLogViewer(void);
virtual ~RimWellLogViewer(void);
RimWellLogPlotTrace();
virtual ~RimWellLogPlotTrace();
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;
};