mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#1038) - pre-proto - Added new well path fracture from context menu in 3D view. Measured depth along well path for fracture is not yet updated.
This commit is contained in:
parent
b6a08700a2
commit
2022e2dd3d
@ -42,6 +42,7 @@ ${CEE_CURRENT_LIST_DIR}RicNewSimWellFractureAtPosFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicNewFractureDefinitionFeature.h
|
||||
|
||||
${CEE_CURRENT_LIST_DIR}RicNewWellPathCollFractureFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicNewWellPathCollFractureAtPosFeature.h
|
||||
|
||||
|
||||
# General delete of any object in a child array field
|
||||
@ -86,8 +87,8 @@ ${CEE_CURRENT_LIST_DIR}RicNewSimWellFractureFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicNewSimWellFractureAtPosFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicNewFractureDefinitionFeature.cpp
|
||||
|
||||
#${CEE_CURRENT_LIST_DIR}RicNewWellPathCollFractureFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicNewWellPathCollFractureFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicNewWellPathCollFractureAtPosFeature.cpp
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,113 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicNewWellPathCollFractureAtPosFeature.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RimCase.h"
|
||||
#include "RimFracture.h"
|
||||
#include "RimFractureCollection.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include "cvfAssert.h"
|
||||
|
||||
#include "QAction.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimView.h"
|
||||
#include "cvfVector3.h"
|
||||
#include "cvfRenderState_FF.h"
|
||||
#include "RiuViewer.h"
|
||||
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicNewWellPathCollFractureAtPosFeature, "RicNewWellPathCollFractureAtPosFeature");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewWellPathCollFractureAtPosFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
RimView* activeView = RiaApplication::instance()->activeReservoirView();
|
||||
if (!activeView) return;
|
||||
|
||||
std::vector<RimWellPath*> collection;
|
||||
caf::SelectionManager::instance()->objectsByType(&collection);
|
||||
if (collection.size() != 1) return;
|
||||
|
||||
RimWellPath* wellPath = collection[0];
|
||||
|
||||
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>(wellPath);
|
||||
if (!objHandle) return;
|
||||
|
||||
RimWellPathCollection* wellPathColl = nullptr;
|
||||
objHandle->firstAncestorOrThisOfType(wellPathColl);
|
||||
CVF_ASSERT(wellPathColl);
|
||||
|
||||
RimFractureCollection* fractureCollection = wellPathColl->fractureCollection();
|
||||
|
||||
RimFracture* fracture = new RimFracture();
|
||||
fractureCollection->fractures.push_back(fracture);
|
||||
|
||||
fracture->name = "New Well Path Fracture";
|
||||
fracture->welltype = RimFracture::FRACTURE_WELL_PATH;
|
||||
fracture->wellpath = wellPath;
|
||||
//TODO set all relevant defaults...
|
||||
|
||||
|
||||
cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords();
|
||||
fracture->positionAtWellpath = domainCoord;
|
||||
|
||||
|
||||
|
||||
fractureCollection->updateConnectedEditors();
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewWellPathCollFractureAtPosFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
// actionToSetup->setIcon(QIcon(":/CrossSection16x16.png"));
|
||||
actionToSetup->setText("New Fracture");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewWellPathCollFractureAtPosFeature::isCommandEnabled()
|
||||
{
|
||||
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
|
||||
if (!pdmUiItem) return false;
|
||||
|
||||
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>(pdmUiItem);
|
||||
if (!objHandle) return false;
|
||||
|
||||
RimWellPathCollection* wellPathColl = nullptr;
|
||||
objHandle->firstAncestorOrThisOfType(wellPathColl);
|
||||
|
||||
if (wellPathColl)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicNewWellPathCollFractureAtPosFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
protected:
|
||||
|
||||
virtual void onActionTriggered(bool isChecked) override;
|
||||
virtual void setupActionLook(QAction* actionToSetup) override;
|
||||
virtual bool isCommandEnabled() override;
|
||||
|
||||
|
||||
};
|
@ -32,6 +32,7 @@
|
||||
|
||||
#include "QToolBox"
|
||||
#include "QList"
|
||||
#include "cvfVector3.h"
|
||||
|
||||
|
||||
namespace caf
|
||||
@ -59,8 +60,9 @@ RimFracture::RimFracture(void)
|
||||
CAF_PDM_InitField(&name, "UserDescription", QString("Fracture Name"), "Name", "", "", "");
|
||||
CAF_PDM_InitField(&welltype,"Type", caf::AppEnum<FractureWellEnum>(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( &measuredDepth, "MeasuredDepth", 650.0f, "Measured Depth Location (if along well path)", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&wellpath, "WellPath", "Well path for measured deph", "", "", "");
|
||||
CAF_PDM_InitField( &positionAtWellpath, "PositionAtWellpath", cvf::Vec3d::ZERO, "Fracture Position at Well Path", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&i, "I", 1, "Fracture location cell I", "", "", "");
|
||||
CAF_PDM_InitField(&j, "J", 1, "Fracture location cell J", "", "", "");
|
||||
@ -139,6 +141,7 @@ void RimFracture::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiO
|
||||
{
|
||||
geometryGroup->add(&wellpath);
|
||||
geometryGroup->add(&measuredDepth);
|
||||
geometryGroup->add(&positionAtWellpath);
|
||||
}
|
||||
|
||||
else if (welltype == FRACTURE_SIMULATION_WELL)
|
||||
|
@ -22,6 +22,8 @@
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmPtrField.h"
|
||||
#include "RimView.h"
|
||||
#include "cvfVector3.h"
|
||||
|
||||
class RimFractureDefinition;
|
||||
class RimWellPath;
|
||||
@ -51,6 +53,7 @@ public:
|
||||
|
||||
caf::PdmPtrField<RimWellPath*> wellpath;
|
||||
caf::PdmField<float> measuredDepth;
|
||||
caf::PdmField<cvf::Vec3d> positionAtWellpath;
|
||||
|
||||
caf::PdmField<int> i;
|
||||
caf::PdmField<int> j;
|
||||
|
@ -35,7 +35,7 @@ RimFractureDefinitionCollection::RimFractureDefinitionCollection(void)
|
||||
|
||||
CAF_PDM_InitField(&isActive, "Active", true, "Active", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&fractureDefinitions, "Fracture Definitions", "", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&fractureDefinitions, "FractureDefinitions", "", "", "", "");
|
||||
fractureDefinitions.uiCapability()->setUiHidden(true);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "RimEclipseCaseCollection.h"
|
||||
#include "RimFormationNamesCollection.h"
|
||||
#include "RimFractureDefinitionCollection.h"
|
||||
//#include "RimFractureCollection.h"
|
||||
|
||||
#include "RimGeoMechModels.h"
|
||||
#include "RimSummaryCaseCollection.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
@ -42,11 +42,9 @@ RimOilField::RimOilField(void)
|
||||
CAF_PDM_InitFieldNoDefault(&wellPathCollection, "WellPathCollection", "Well Paths", ":/WellCollection.png", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&fractureDefinitionCollection, "FractureDefinitionCollection", "Defenition of fractures", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&summaryCaseCollection,"SummaryCaseCollection","Summary Cases",":/GridModels.png","","");
|
||||
// CAF_PDM_InitFieldNoDefault(&fractureCollection, "FractureCollection", "Fractures", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&formationNamesCollection,"FormationNamesCollection","Formations","","","");
|
||||
|
||||
fractureDefinitionCollection = new RimFractureDefinitionCollection();
|
||||
// fractureCollection = new RimFractureCollection();
|
||||
analysisModels = new RimEclipseCaseCollection();
|
||||
wellPathCollection = new RimWellPathCollection();
|
||||
summaryCaseCollection = new RimSummaryCaseCollection();
|
||||
@ -59,7 +57,6 @@ RimOilField::~RimOilField(void)
|
||||
{
|
||||
if (wellPathCollection()) delete wellPathCollection();
|
||||
if (fractureDefinitionCollection()) delete fractureDefinitionCollection();
|
||||
// if (fractureCollection()) delete fractureCollection();
|
||||
if (geoMechModels()) delete geoMechModels();
|
||||
if (analysisModels()) delete analysisModels();
|
||||
if (summaryCaseCollection()) delete summaryCaseCollection();
|
||||
|
@ -29,7 +29,6 @@ class RimEclipseCaseCollection;
|
||||
class RimGeoMechModels;
|
||||
class RimWellPathCollection;
|
||||
class RimFractureDefinitionCollection;
|
||||
//class RimFractureCollection;
|
||||
class RimSummaryCaseCollection;
|
||||
class RimFormationNamesCollection;
|
||||
|
||||
@ -49,7 +48,6 @@ public:
|
||||
caf::PdmChildField<RimGeoMechModels*> geoMechModels;
|
||||
caf::PdmChildField<RimWellPathCollection*> wellPathCollection;
|
||||
caf::PdmChildField<RimFractureDefinitionCollection*> fractureDefinitionCollection;
|
||||
// caf::PdmChildField<RimFractureCollection*> fractureCollection;
|
||||
caf::PdmChildField<RimSummaryCaseCollection*> summaryCaseCollection;
|
||||
caf::PdmChildField<RimFormationNamesCollection*> formationNamesCollection;
|
||||
|
||||
|
@ -298,6 +298,7 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
|
||||
commandIds << "RicNewWellLogFileCurveFeature";
|
||||
commandIds << "RicNewWellLogCurveExtractionFeature";
|
||||
commandIds << "RicNewWellPathIntersectionFeature";
|
||||
commandIds << "RicNewWellPathCollFractureAtPosFeature";
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user