2016-12-20 15:28:37 +01:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// Copyright (C) 2016- Statoil ASA
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2016-12-20 15:28:37 +01:00
|
|
|
// 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.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2016-12-20 15:28:37 +01:00
|
|
|
// 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.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2016-12-20 15:28:37 +01:00
|
|
|
// for more details.
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2017-01-02 14:01:31 +01:00
|
|
|
#include "RicNewWellPathFractureAtPosFeature.h"
|
2016-12-20 15:28:37 +01:00
|
|
|
|
|
|
|
|
#include "RiaApplication.h"
|
|
|
|
|
|
2017-06-09 13:05:32 +02:00
|
|
|
#include "RicNewWellPathFractureFeature.h"
|
2017-01-02 11:59:30 +01:00
|
|
|
|
2018-01-23 07:28:32 +01:00
|
|
|
#include "RimProject.h"
|
|
|
|
|
|
2018-11-30 12:53:46 +01:00
|
|
|
#include "Riu3dSelectionManager.h"
|
2017-01-02 11:59:30 +01:00
|
|
|
|
2017-01-02 10:10:45 +01:00
|
|
|
#include <QAction>
|
2016-12-21 13:40:53 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
CAF_CMD_SOURCE_INIT( RicNewWellPathFractureAtPosFeature, "RicNewWellPathFractureAtPosFeature" );
|
2016-12-20 15:28:37 +01:00
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2016-12-20 15:28:37 +01:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
void RicNewWellPathFractureAtPosFeature::onActionTriggered( bool isChecked )
|
2016-12-20 15:28:37 +01:00
|
|
|
{
|
2018-11-30 12:53:46 +01:00
|
|
|
Riu3dSelectionManager* riuSelManager = Riu3dSelectionManager::instance();
|
2019-09-06 10:40:57 +02:00
|
|
|
RiuSelectionItem* selItem = riuSelManager->selectedItem( Riu3dSelectionManager::RUI_TEMPORARY );
|
2016-12-20 15:28:37 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
RiuWellPathSelectionItem* wellPathItem = dynamic_cast<RiuWellPathSelectionItem*>( selItem );
|
|
|
|
|
if ( !wellPathItem ) return;
|
2016-12-20 15:28:37 +01:00
|
|
|
|
2017-01-04 09:08:10 +01:00
|
|
|
RimWellPath* wellPath = wellPathItem->m_wellpath;
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( !wellPath ) return;
|
2017-01-05 14:52:59 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
RicNewWellPathFractureFeature::addFracture( wellPath, wellPathItem->m_measuredDepth );
|
2016-12-20 15:28:37 +01:00
|
|
|
}
|
2019-09-06 10:40:57 +02:00
|
|
|
|
2016-12-20 15:28:37 +01:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2016-12-20 15:28:37 +01:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
void RicNewWellPathFractureAtPosFeature::setupActionLook( QAction* actionToSetup )
|
2016-12-20 15:28:37 +01:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
actionToSetup->setIcon( QIcon( ":/FractureSymbol16x16.png" ) );
|
|
|
|
|
actionToSetup->setText( "Create Fracture at this Depth" );
|
2016-12-20 15:28:37 +01:00
|
|
|
}
|
2019-09-06 10:40:57 +02:00
|
|
|
|
2016-12-20 15:28:37 +01:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2016-12-20 15:28:37 +01:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-01-02 14:01:31 +01:00
|
|
|
bool RicNewWellPathFractureAtPosFeature::isCommandEnabled()
|
2016-12-20 15:28:37 +01:00
|
|
|
{
|
2017-06-09 13:05:32 +02:00
|
|
|
return true;
|
2016-12-20 15:28:37 +01:00
|
|
|
}
|