#6132 Fracture Model: Add menu item to create fracture model at depth in 3D View.

This commit is contained in:
Kristian Bendiksen 2020-09-11 14:26:28 +02:00
parent b511f92ee2
commit fd91eaf2be
6 changed files with 116 additions and 2 deletions

View File

@ -13,6 +13,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicNewStimPlanFractureTemplateFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureAtPosFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureAtPosFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicNewFractureModelFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicNewFractureModelFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureModelAtPosFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesOptionItemUi.h ${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesOptionItemUi.h
@ -35,6 +36,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicNewStimPlanFractureTemplateFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureAtPosFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureAtPosFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewFractureModelFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicNewFractureModelFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureModelAtPosFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesOptionItemUi.cpp ${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesOptionItemUi.cpp

View File

@ -47,7 +47,8 @@ CAF_CMD_SOURCE_INIT( RicNewFractureModelFeature, "RicNewFractureModelFeature" );
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RimFractureModel* RicNewFractureModelFeature::addFractureModel( RimWellPath* wellPath, RimFractureModel* RicNewFractureModelFeature::addFractureModel( RimWellPath* wellPath,
RimWellPathCollection* wellPathCollection ) RimWellPathCollection* wellPathCollection,
double measuredDepth )
{ {
CVF_ASSERT( wellPath ); CVF_ASSERT( wellPath );
@ -82,6 +83,11 @@ RimFractureModel* RicNewFractureModelFeature::addFractureModel( RimWellPath*
project->updateAllRequiredEditors(); project->updateAllRequiredEditors();
} }
if ( measuredDepth > 0.0 )
{
fractureModel->setMD( measuredDepth );
}
Riu3DMainWindowTools::selectAsCurrentItem( fractureModel ); Riu3DMainWindowTools::selectAsCurrentItem( fractureModel );
return fractureModel; return fractureModel;
} }

View File

@ -33,7 +33,8 @@ class RicNewFractureModelFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
public: public:
static RimFractureModel* addFractureModel( RimWellPath* wellPath, RimWellPathCollection* wellPathCollection ); static RimFractureModel*
addFractureModel( RimWellPath* wellPath, RimWellPathCollection* wellPathCollection, double measuredDepth = -1.0 );
protected: protected:
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;

View File

@ -0,0 +1,68 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2020- Equinor 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 "RicNewWellPathFractureModelAtPosFeature.h"
#include "RicNewFractureModelFeature.h"
#include "RimTools.h"
#include "RimWellPath.h"
#include "RimWellPathCollection.h"
#include "Riu3dSelectionManager.h"
#include <QAction>
CAF_CMD_SOURCE_INIT( RicNewWellPathFractureModelAtPosFeature, "RicNewWellPathFractureModelAtPosFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewWellPathFractureModelAtPosFeature::onActionTriggered( bool isChecked )
{
Riu3dSelectionManager* riuSelManager = Riu3dSelectionManager::instance();
RiuSelectionItem* selItem = riuSelManager->selectedItem( Riu3dSelectionManager::RUI_TEMPORARY );
RiuWellPathSelectionItem* wellPathItem = dynamic_cast<RiuWellPathSelectionItem*>( selItem );
if ( !wellPathItem ) return;
RimWellPath* wellPath = wellPathItem->m_wellpath;
if ( !wellPath ) return;
RimWellPathCollection* wellPathCollection = RimTools::wellPathCollection();
if ( !wellPathCollection ) return;
RicNewFractureModelFeature::addFractureModel( wellPath, wellPathCollection, wellPathItem->m_measuredDepth );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewWellPathFractureModelAtPosFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setIcon( QIcon( ":/FractureSymbol16x16.png" ) );
actionToSetup->setText( "Create Fracture Model at this Depth" );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicNewWellPathFractureModelAtPosFeature::isCommandEnabled()
{
return true;
}

View File

@ -0,0 +1,36 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2020- Equinor 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 RicNewWellPathFractureModelAtPosFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
bool isCommandEnabled() override;
};

View File

@ -526,6 +526,7 @@ void RiuViewerCommands::displayContextMenu( QMouseEvent* event )
menuBuilder << "RicNewValveAtMeasuredDepthFeature"; menuBuilder << "RicNewValveAtMeasuredDepthFeature";
menuBuilder << "RicNewFishbonesSubsAtMeasuredDepthFeature"; menuBuilder << "RicNewFishbonesSubsAtMeasuredDepthFeature";
menuBuilder << "RicNewWellPathFractureAtPosFeature"; menuBuilder << "RicNewWellPathFractureAtPosFeature";
menuBuilder << "RicNewWellPathFractureModelAtPosFeature";
menuBuilder.addSeparator(); menuBuilder.addSeparator();
menuBuilder << "RicNewWellPathAttributeFeature"; menuBuilder << "RicNewWellPathAttributeFeature";
menuBuilder << "RicWellPathImportCompletionsFileFeature"; menuBuilder << "RicWellPathImportCompletionsFileFeature";