diff --git a/ApplicationCode/ProjectDataModel/CMakeLists_files.cmake b/ApplicationCode/ProjectDataModel/CMakeLists_files.cmake index c001111241..b83d9968a3 100644 --- a/ApplicationCode/ProjectDataModel/CMakeLists_files.cmake +++ b/ApplicationCode/ProjectDataModel/CMakeLists_files.cmake @@ -85,6 +85,8 @@ ${CEE_CURRENT_LIST_DIR}RimEclipseInputCaseOpm.h ${CEE_CURRENT_LIST_DIR}RimIntersectionBox.h ${CEE_CURRENT_LIST_DIR}RimMultiSnapshotDefinition.h ${CEE_CURRENT_LIST_DIR}RimFractureDefinition.h +${CEE_CURRENT_LIST_DIR}RimFracture.h +${CEE_CURRENT_LIST_DIR}RimFractureCollection.h ) set (SOURCE_GROUP_SOURCE_FILES @@ -168,6 +170,8 @@ ${CEE_CURRENT_LIST_DIR}RimEclipseInputCaseOpm.cpp ${CEE_CURRENT_LIST_DIR}RimIntersectionBox.cpp ${CEE_CURRENT_LIST_DIR}RimMultiSnapshotDefinition.cpp ${CEE_CURRENT_LIST_DIR}RimFractureDefinition.cpp +${CEE_CURRENT_LIST_DIR}RimFracture.cpp +${CEE_CURRENT_LIST_DIR}RimFractureCollection.cpp ) list(APPEND CODE_HEADER_FILES diff --git a/ApplicationCode/ProjectDataModel/RimFracture.cpp b/ApplicationCode/ProjectDataModel/RimFracture.cpp new file mode 100644 index 0000000000..5280e23889 --- /dev/null +++ b/ApplicationCode/ProjectDataModel/RimFracture.cpp @@ -0,0 +1,97 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2016- Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimFracture.h" + +#include "RimFractureDefinition.h" +#include "RimWellPath.h" + +#include "cafPdmObject.h" + + +namespace caf +{ + template<> + void caf::AppEnum< RimFracture::FractureWellEnum>::setUp() + { + addItem(RimFracture::FRACTURE_SIMULATION_WELL, "SIMULATION_WELL", "Simulation Well"); + addItem(RimFracture::FRACTURE_WELL_PATH, "WELL_PATH", "Well Path"); + + setDefault(RimFracture::FRACTURE_SIMULATION_WELL); + } +} + + +CAF_PDM_SOURCE_INIT(RimFracture, "Fracture"); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimFracture::RimFracture(void) +{ + CAF_PDM_InitObject("Fracture", "", "", ""); + + CAF_PDM_InitField(&name, "UserDescription", QString("Fracture Name"), "Name", "", "", ""); + CAF_PDM_InitField(&welltype,"Type", caf::AppEnum(FRACTURE_SIMULATION_WELL), "Type", "", "", ""); + + CAF_PDM_InitField( &measuredDepth, "MeasuredDepth", 650.0f, "Measured Depth Location (if along well path)", "", "", ""); + CAF_PDM_InitFieldNoDefault(&wellpath, "WellPath", "Well path for measured deph", "", "", ""); + + CAF_PDM_InitField(&i, "I", 1, "Fracture location cell I", "", "", ""); + CAF_PDM_InitField(&i, "J", 1, "Fracture location cell J", "", "", ""); + CAF_PDM_InitField(&i, "K", 1, "Fracture location cell K", "", "", ""); + + CAF_PDM_InitFieldNoDefault(&fractureDefinition, "FractureDef", "FractureDef", "", "", ""); + +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimFracture::~RimFracture() +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimFracture::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) +{ + uiOrdering.add(&name); + + caf::PdmUiGroup* geometryGroup = uiOrdering.addNewGroup("Fractures"); + geometryGroup->add(&fractureDefinition); + geometryGroup->add(&welltype); + + if (welltype == FRACTURE_WELL_PATH) + { + geometryGroup->add(&wellpath); + geometryGroup->add(&measuredDepth); + } + + else if (welltype == FRACTURE_SIMULATION_WELL) + { + geometryGroup->add(&i); + geometryGroup->add(&j); + geometryGroup->add(&k); + + } + + uiOrdering.setForgetRemainingFields(true); + +} diff --git a/ApplicationCode/ProjectDataModel/RimFracture.h b/ApplicationCode/ProjectDataModel/RimFracture.h new file mode 100644 index 0000000000..010afe09de --- /dev/null +++ b/ApplicationCode/ProjectDataModel/RimFracture.h @@ -0,0 +1,64 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2016- Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafAppEnum.h" +#include "cafPdmField.h" +#include "cafPdmObject.h" +#include "cafPdmPtrField.h" + +class RimFractureDefinition; +class RimWellPath; + +//================================================================================================== +/// +/// +//================================================================================================== +class RimFracture : public caf::PdmObject +{ + CAF_PDM_HEADER_INIT; + +public: + enum FractureWellEnum + { + FRACTURE_WELL_PATH, + FRACTURE_SIMULATION_WELL + }; + +public: + RimFracture(void); + virtual ~RimFracture(void); + + caf::PdmField name; + caf::PdmPtrField fractureDefinition; + caf::PdmField< caf::AppEnum< FractureWellEnum > > welltype; + + caf::PdmPtrField wellpath; + caf::PdmField measuredDepth; + + caf::PdmField i; + caf::PdmField j; + caf::PdmField k; + +protected: + virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering); + + + +}; diff --git a/ApplicationCode/ProjectDataModel/RimFractureCollection.cpp b/ApplicationCode/ProjectDataModel/RimFractureCollection.cpp new file mode 100644 index 0000000000..58983e922c --- /dev/null +++ b/ApplicationCode/ProjectDataModel/RimFractureCollection.cpp @@ -0,0 +1,69 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2016- Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimFractureCollection.h" + +#include "RimFracture.h" +#include "cafPdmObject.h" + + + + +CAF_PDM_SOURCE_INIT(RimFractureCollection, "FractureCollection"); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimFractureCollection::RimFractureCollection(void) +{ + CAF_PDM_InitObject("Fracture collection", "", "", ""); + + CAF_PDM_InitField(&isActive, "Active", true, "Active", "", "", ""); + + CAF_PDM_InitFieldNoDefault(&fractures, "Fractures", "", "", "", ""); + +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimFractureCollection::~RimFractureCollection() +{ + fractures.deleteAllChildObjects(); + +} + + +//TODO: Trenger vi en sånn for å legge til fractures??? +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +// void RimIntersectionCollection::appendIntersection(RimIntersection* intersection) +// { +// m_intersections.push_back(intersection); +// +// updateConnectedEditors(); +// RiuMainWindow::instance()->selectAsCurrentItem(intersection); +// +// RimView* rimView = NULL; +// firstAncestorOrThisOfType(rimView); +// if (rimView) +// { +// rimView->scheduleCreateDisplayModelAndRedraw(); +// } +// } diff --git a/ApplicationCode/ProjectDataModel/RimFractureCollection.h b/ApplicationCode/ProjectDataModel/RimFractureCollection.h new file mode 100644 index 0000000000..a830bbfa19 --- /dev/null +++ b/ApplicationCode/ProjectDataModel/RimFractureCollection.h @@ -0,0 +1,42 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2016- Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafPdmField.h" +#include "cafPdmObject.h" +#include "cafPdmChildArrayField.h" + +class RimFracture; + +//================================================================================================== +/// +/// +//================================================================================================== +class RimFractureCollection : public caf::PdmObject +{ + CAF_PDM_HEADER_INIT; + +public: + RimFractureCollection(void); + virtual ~RimFractureCollection(void); + + caf::PdmChildArrayField fractures; + caf::PdmField isActive; + +}; diff --git a/ApplicationCode/ProjectDataModel/RimFractureDefinition.cpp b/ApplicationCode/ProjectDataModel/RimFractureDefinition.cpp index 826dd49bae..ce2adabbe2 100644 --- a/ApplicationCode/ProjectDataModel/RimFractureDefinition.cpp +++ b/ApplicationCode/ProjectDataModel/RimFractureDefinition.cpp @@ -46,7 +46,6 @@ RimFractureDefinition::RimFractureDefinition(void) { CAF_PDM_InitObject("Fracture definition", "", "", ""); - //TODO New defaults??? CAF_PDM_InitField(&halfLength, "HalfLength", 650.0f, "Fracture Halflength X_f", "", "", ""); CAF_PDM_InitField(&height, "Height", 75.0f, "Fracture Height", "", "", ""); CAF_PDM_InitField(&orientation, "Orientation", caf::AppEnum(TRANSVERSE_WELL_PATH), "Fracture orientation", "", "", ""); diff --git a/ApplicationCode/ProjectDataModel/RimOilField.cpp b/ApplicationCode/ProjectDataModel/RimOilField.cpp index 50f843eef8..307fab7cca 100644 --- a/ApplicationCode/ProjectDataModel/RimOilField.cpp +++ b/ApplicationCode/ProjectDataModel/RimOilField.cpp @@ -21,11 +21,13 @@ #include "RimOilField.h" #include "RimEclipseCaseCollection.h" -#include "RimWellPathCollection.h" -#include "RimGeoMechModels.h" -#include "RimSummaryCaseCollection.h" #include "RimFormationNamesCollection.h" #include "RimFractureDefinition.h" +#include "RimFractureCollection.h" +#include "RimGeoMechModels.h" +#include "RimSummaryCaseCollection.h" +#include "RimWellPathCollection.h" + CAF_PDM_SOURCE_INIT(RimOilField, "ResInsightOilField"); //-------------------------------------------------------------------------------------------------- @@ -38,11 +40,13 @@ RimOilField::RimOilField(void) 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", "", ""); - CAF_PDM_InitFieldNoDefault(&fractureDefinition, "FractureDefenition", "Defenition of fractures", "", "", ""); + CAF_PDM_InitFieldNoDefault(&fractureDefinition, "FractureDefinition", "Defenition of fractures", "", "", ""); CAF_PDM_InitFieldNoDefault(&summaryCaseCollection,"SummaryCaseCollection","Summary Cases",":/GridModels.png","",""); + CAF_PDM_InitFieldNoDefault(&fractureCollection, "FractureCollection", "Fractures", "", "", ""); CAF_PDM_InitFieldNoDefault(&formationNamesCollection,"FormationNamesCollection","Formations","","",""); fractureDefinition = new RimFractureDefinition(); + fractureCollection = new RimFractureCollection(); analysisModels = new RimEclipseCaseCollection(); wellPathCollection = new RimWellPathCollection(); summaryCaseCollection = new RimSummaryCaseCollection(); @@ -55,6 +59,7 @@ RimOilField::~RimOilField(void) { if (wellPathCollection()) delete wellPathCollection(); if (fractureDefinition()) delete fractureDefinition(); + if (fractureCollection()) delete fractureCollection(); if (geoMechModels()) delete geoMechModels(); if (analysisModels()) delete analysisModels(); if (summaryCaseCollection()) delete summaryCaseCollection(); diff --git a/ApplicationCode/ProjectDataModel/RimOilField.h b/ApplicationCode/ProjectDataModel/RimOilField.h index d226d922af..e81b77a262 100644 --- a/ApplicationCode/ProjectDataModel/RimOilField.h +++ b/ApplicationCode/ProjectDataModel/RimOilField.h @@ -29,6 +29,7 @@ class RimEclipseCaseCollection; class RimGeoMechModels; class RimWellPathCollection; class RimFractureDefinition; +class RimFractureCollection; class RimSummaryCaseCollection; class RimFormationNamesCollection; @@ -48,6 +49,7 @@ public: caf::PdmChildField geoMechModels; caf::PdmChildField wellPathCollection; caf::PdmChildField fractureDefinition; + caf::PdmChildField fractureCollection; caf::PdmChildField summaryCaseCollection; caf::PdmChildField formationNamesCollection; diff --git a/ApplicationCode/ProjectDataModel/RimProject.cpp b/ApplicationCode/ProjectDataModel/RimProject.cpp index 3449325126..51693bc985 100644 --- a/ApplicationCode/ProjectDataModel/RimProject.cpp +++ b/ApplicationCode/ProjectDataModel/RimProject.cpp @@ -34,6 +34,7 @@ #include "RimEclipseCaseCollection.h" #include "RimFormationNamesCollection.h" #include "RimFractureDefinition.h" +#include "RimFractureCollection.h" #include "RimGeoMechCase.h" #include "RimGeoMechModels.h" #include "RimGridSummaryCase.h" @@ -827,6 +828,7 @@ void RimProject::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QS if (oilField->geoMechModels()) uiTreeOrdering.add(oilField->geoMechModels()); if (oilField->wellPathCollection()) uiTreeOrdering.add(oilField->wellPathCollection()); if (oilField->fractureDefinition()) uiTreeOrdering.add(oilField->fractureDefinition()); + if (oilField->fractureCollection()) uiTreeOrdering.add(oilField->fractureCollection()); if (oilField->formationNamesCollection()) uiTreeOrdering.add(oilField->formationNamesCollection()); } diff --git a/ApplicationCode/ProjectDataModel/RimProject.h b/ApplicationCode/ProjectDataModel/RimProject.h index 6f586e7358..b0b534c3df 100644 --- a/ApplicationCode/ProjectDataModel/RimProject.h +++ b/ApplicationCode/ProjectDataModel/RimProject.h @@ -34,6 +34,7 @@ class RimCase; class RimCommandObject; class RimEclipseCase; class RimFractureDefinition; +class RimFractureCollection; class RimIdenticalGridCaseGroup; class RimMainPlotCollection; class RimMultiSnapshotDefinition; @@ -74,8 +75,10 @@ public: caf::PdmChildArrayField commandObjects; caf::PdmChildArrayField multiSnapshotDefinitions; + caf::PdmChildArrayField fractureDefinition; - + caf::PdmChildArrayField fractureCollection; + caf::PdmField mainWindowTreeViewState; caf::PdmField mainWindowCurrentModelIndexPath;