Start of geomech support

Possible GUI-tree layout
This commit is contained in:
Jacob Støren
2015-04-20 09:02:33 +02:00
parent a5fba8f3f4
commit 27f6bd9eb5
20 changed files with 492 additions and 3 deletions

View File

@@ -51,6 +51,9 @@ ${CEE_CURRENT_LIST_DIR}RimTernaryLegendConfig.h
${CEE_CURRENT_LIST_DIR}RimFaultResultSlot.h
${CEE_CURRENT_LIST_DIR}RimNoCommonAreaNNC.h
${CEE_CURRENT_LIST_DIR}RimNoCommonAreaNncCollection.h
${CEE_CURRENT_LIST_DIR}RimGeoMechModels.h
${CEE_CURRENT_LIST_DIR}RimGeoMechCase.h
${CEE_CURRENT_LIST_DIR}RimGeoMechView.h
)
set (SOURCE_GROUP_SOURCE_FILES
@@ -100,6 +103,9 @@ ${CEE_CURRENT_LIST_DIR}RimTernaryLegendConfig.cpp
${CEE_CURRENT_LIST_DIR}RimFaultResultSlot.cpp
${CEE_CURRENT_LIST_DIR}RimNoCommonAreaNNC.cpp
${CEE_CURRENT_LIST_DIR}RimNoCommonAreaNncCollection.cpp
${CEE_CURRENT_LIST_DIR}RimGeoMechModels.cpp
${CEE_CURRENT_LIST_DIR}RimGeoMechCase.cpp
${CEE_CURRENT_LIST_DIR}RimGeoMechView.cpp
)
list(APPEND CODE_HEADER_FILES

View File

@@ -245,3 +245,11 @@ caf::PdmFieldHandle* Rim3dOverlayInfoConfig::objectToggleField()
{
return &active;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim3dOverlayInfoConfig::setReservoirView(RimReservoirView* ownerReservoirView)
{
m_reservoirView = ownerReservoirView;
}

View File

@@ -41,7 +41,7 @@ public:
void update3DInfo();
void setReservoirView(RimReservoirView* ownerReservoirView) {m_reservoirView = ownerReservoirView; }
void setReservoirView(RimReservoirView* ownerReservoirView);
void setPosition(cvf::Vec2ui position);
caf::PdmField<bool> active;

View File

@@ -0,0 +1,66 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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 "RimGeoMechCase.h"
#include "RimGeoMechView.h"
CAF_PDM_SOURCE_INIT(RimGeoMechCase, "ResInsightGeoMechCase");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGeoMechCase::RimGeoMechCase(void)
{
CAF_PDM_InitObject("Geomechanical Case", ":/GeoMechCase48x48.png", "", "");
CAF_PDM_InitField(&caseUserDescription, "CaseUserDescription", QString(), "Case name", "", "" ,"");
CAF_PDM_InitField(&caseFileName, "CaseFileName", QString(), "Case file name", "", "", "");
caseFileName.setUiReadOnly(true);
CAF_PDM_InitFieldNoDefault(&geoMechViews, "GeoMechViews", "", "", "", "");
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGeoMechCase::~RimGeoMechCase(void)
{
geoMechViews.deleteAllChildObjects();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGeoMechView* RimGeoMechCase::createAndAddReservoirView()
{
RimGeoMechView* gmv = new RimGeoMechView();
size_t i = geoMechViews().size();
gmv->name = QString("View %1").arg(i + 1);
geoMechViews.push_back(gmv);
return gmv;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmFieldHandle* RimGeoMechCase::userDescriptionField()
{
return &caseUserDescription;
}

View File

@@ -0,0 +1,50 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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 "cafPdmField.h"
#include "cafPdmObject.h"
#include "cafPdmPointer.h"
class RimGeoMechView;
//==================================================================================================
///
///
//==================================================================================================
class RimGeoMechCase : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RimGeoMechCase(void);
virtual ~RimGeoMechCase(void);
RimGeoMechView* createAndAddReservoirView();
virtual caf::PdmFieldHandle* userDescriptionField();
// Fields:
caf::PdmField<QString> caseUserDescription;
caf::PdmPointersField<RimGeoMechView*> geoMechViews;
private:
caf::PdmField<QString> caseFileName;
};

View File

@@ -0,0 +1,44 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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 "RimGeoMechModels.h"
#include "RimGeoMechCase.h"
CAF_PDM_SOURCE_INIT(RimGeoMechModels, "ResInsightGeoMechModels");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGeoMechModels::RimGeoMechModels(void)
{
CAF_PDM_InitObject("Geomechanical Models", ":/GeoMechCases48x48.png", "", "");
CAF_PDM_InitFieldNoDefault(&cases, "Cases", "", "", "", "");
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGeoMechModels::~RimGeoMechModels(void)
{
cases.deleteAllChildObjects();
}

View File

@@ -0,0 +1,43 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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 "cafPdmField.h"
#include "cafPdmObject.h"
#include "cafPdmPointer.h"
class RimGeoMechCase;
//==================================================================================================
///
///
//==================================================================================================
class RimGeoMechModels : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RimGeoMechModels(void);
virtual ~RimGeoMechModels(void);
caf::PdmPointersField<RimGeoMechCase*> cases;
private:
};

View File

@@ -0,0 +1,104 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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 "RimGeoMechView.h"
#include "RimReservoirView.h"
#include "Rim3dOverlayInfoConfig.h"
#include "RiaApplication.h"
#include "RiaPreferences.h"
#include "RimResultSlot.h"
namespace caf {
template<>
void caf::AppEnum< RimGeoMechView::MeshModeType >::setUp()
{
addItem(RimGeoMechView::FULL_MESH, "FULL_MESH", "All");
addItem(RimGeoMechView::FAULTS_MESH, "FAULTS_MESH", "Faults only");
addItem(RimGeoMechView::NO_MESH, "NO_MESH", "None");
setDefault(RimGeoMechView::FULL_MESH);
}
template<>
void caf::AppEnum< RimGeoMechView::SurfaceModeType >::setUp()
{
addItem(RimGeoMechView::SURFACE, "SURFACE", "All");
addItem(RimGeoMechView::FAULTS, "FAULTS", "Faults only");
addItem(RimGeoMechView::NO_SURFACE, "NO_SURFACE", "None");
setDefault(RimGeoMechView::SURFACE);
}
} // End namespace caf
CAF_PDM_SOURCE_INIT(RimGeoMechView, "GeoMechView");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGeoMechView::RimGeoMechView(void)
{
RiaApplication* app = RiaApplication::instance();
RiaPreferences* preferences = app->preferences();
CVF_ASSERT(preferences);
CAF_PDM_InitObject("Geomechanical View", ":/ReservoirView.png", "", "");
CAF_PDM_InitFieldNoDefault(&cellResult, "GridCellResult", "Cell Result", ":/CellResult.png", "", "");
cellResult = new RimResultSlot();
CAF_PDM_InitFieldNoDefault(&overlayInfoConfig, "OverlayInfoConfig", "Info Box", "", "", "");
overlayInfoConfig = new Rim3dOverlayInfoConfig();
CAF_PDM_InitField(&name, "UserDescription", QString("View"), "Name", "", "", "");
double defaultScaleFactor = 1.0;
if (preferences) defaultScaleFactor = preferences->defaultScaleFactorZ;
CAF_PDM_InitField(&scaleZ, "GridZScale", defaultScaleFactor, "Z Scale", "", "Scales the scene in the Z direction", "");
caf::AppEnum<RimGeoMechView::MeshModeType> defaultMeshType = NO_MESH;
if (preferences->defaultGridLines) defaultMeshType = FULL_MESH;
CAF_PDM_InitField(&meshMode, "MeshMode", defaultMeshType, "Grid lines", "", "", "");
CAF_PDM_InitFieldNoDefault(&surfaceMode, "SurfaceMode", "Grid surface", "", "", "");
cvf::Color3f defBackgColor = preferences->defaultViewerBackgroundColor();
CAF_PDM_InitField(&backgroundColor, "ViewBackgroundColor", defBackgColor, "Background", "", "", "");
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGeoMechView::~RimGeoMechView(void)
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmFieldHandle* RimGeoMechView::userDescriptionField()
{
return &name;
}

View File

@@ -0,0 +1,73 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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 "cafPdmField.h"
#include "cafPdmObject.h"
#include "cafPdmPointer.h"
#include "cafAppEnum.h"
#include "cafPdmFieldCvfColor.h"
class RimResultSlot;
class Rim3dOverlayInfoConfig;
//==================================================================================================
///
///
//==================================================================================================
class RimGeoMechView : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RimGeoMechView(void);
virtual ~RimGeoMechView(void);
enum MeshModeType
{
FULL_MESH,
FAULTS_MESH,
NO_MESH
};
enum SurfaceModeType
{
SURFACE,
FAULTS,
NO_SURFACE
};
caf::PdmField<RimResultSlot*> cellResult;
caf::PdmField<Rim3dOverlayInfoConfig*> overlayInfoConfig;
// Fields:
caf::PdmField<QString> name;
caf::PdmField<double> scaleZ;
caf::PdmField< caf::AppEnum< MeshModeType > > meshMode;
caf::PdmField< caf::AppEnum< SurfaceModeType > > surfaceMode;
caf::PdmField< cvf::Color3f > backgroundColor;
protected:
virtual caf::PdmFieldHandle* userDescriptionField();
private:
};

View File

@@ -22,6 +22,7 @@
#include "RimAnalysisModels.h"
#include "RimWellPathCollection.h"
#include "RimGeoMechModels.h"
CAF_PDM_SOURCE_INIT(RimOilField, "ResInsightOilField");
//--------------------------------------------------------------------------------------------------
@@ -32,6 +33,7 @@ RimOilField::RimOilField(void)
CAF_PDM_InitObject("Oil Field", "", "", "");
CAF_PDM_InitFieldNoDefault(&analysisModels, "AnalysisModels", "Grid Models", ":/GridModels.png", "", "");
CAF_PDM_InitFieldNoDefault(&geoMechModels, "GeoMechModels", "Geo Mech Models", ":/GridModels.png", "", "");
CAF_PDM_InitFieldNoDefault(&wellPathCollection, "WellPathCollection", "Well Paths", ":/WellCollection.png", "", "");
analysisModels = new RimAnalysisModels();
@@ -43,6 +45,7 @@ RimOilField::RimOilField(void)
RimOilField::~RimOilField(void)
{
if (wellPathCollection()) delete wellPathCollection();
if (geoMechModels()) delete geoMechModels();
if (analysisModels()) delete analysisModels();
}

View File

@@ -26,6 +26,7 @@
class RimWellPathCollection;
class RimAnalysisModels;
class RimGeoMechModels;
//==================================================================================================
///
@@ -40,5 +41,6 @@ public:
virtual ~RimOilField(void);
caf::PdmField<RimAnalysisModels*> analysisModels;
caf::PdmField<RimGeoMechModels*> geoMechModels;
caf::PdmField<RimWellPathCollection*> wellPathCollection;
};