2017-05-16 10:21:36 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
2017-05-16 12:49:36 +02:00
|
|
|
// Copyright (C) 2017 Statoil ASA
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2017-05-16 10:21:36 +02: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
|
|
|
//
|
2017-05-16 10:21:36 +02: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>
|
2017-05-16 10:21:36 +02:00
|
|
|
// for more details.
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
#include "RicNewFishbonesSubsAtMeasuredDepthFeature.h"
|
|
|
|
|
|
2017-05-20 20:21:19 +02:00
|
|
|
#include "RicNewFishbonesSubsFeature.h"
|
2017-06-07 11:57:25 +02:00
|
|
|
#include "WellPathCommands/RicWellPathsUnitSystemSettingsImpl.h"
|
2017-05-20 20:21:19 +02:00
|
|
|
|
2021-02-26 14:27:59 +01:00
|
|
|
#include "RimFishbones.h"
|
2017-05-19 15:44:32 +02:00
|
|
|
#include "RimFishbonesCollection.h"
|
2017-05-16 10:21:36 +02:00
|
|
|
#include "RimProject.h"
|
|
|
|
|
#include "RimWellPath.h"
|
|
|
|
|
|
2018-02-27 15:21:14 +01:00
|
|
|
#include "Riu3DMainWindowTools.h"
|
2018-11-30 12:53:46 +01:00
|
|
|
#include "Riu3dSelectionManager.h"
|
2017-05-16 10:21:36 +02:00
|
|
|
|
|
|
|
|
#include "cafSelectionManager.h"
|
|
|
|
|
|
|
|
|
|
#include <QAction>
|
|
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
CAF_CMD_SOURCE_INIT( RicNewFishbonesSubsAtMeasuredDepthFeature, "RicNewFishbonesSubsAtMeasuredDepthFeature" );
|
2017-05-16 10:21:36 +02:00
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2017-05-16 10:21:36 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
void RicNewFishbonesSubsAtMeasuredDepthFeature::onActionTriggered( bool isChecked )
|
2017-05-16 10:21:36 +02:00
|
|
|
{
|
2021-06-29 09:59:45 +02:00
|
|
|
RiuWellPathSelectionItem* wellPathSelItem = RiuWellPathSelectionItem::wellPathSelectionItem();
|
2019-09-06 10:40:57 +02:00
|
|
|
CVF_ASSERT( wellPathSelItem );
|
2017-05-16 10:21:36 +02:00
|
|
|
|
|
|
|
|
RimWellPath* wellPath = wellPathSelItem->m_wellpath;
|
2019-09-06 10:40:57 +02:00
|
|
|
CVF_ASSERT( wellPath );
|
2017-06-07 11:57:25 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( !RicWellPathsUnitSystemSettingsImpl::ensureHasUnitSystem( wellPath ) ) return;
|
2017-05-16 10:21:36 +02:00
|
|
|
|
2021-02-26 14:27:59 +01:00
|
|
|
RimFishbones* obj = new RimFishbones;
|
2019-09-06 10:40:57 +02:00
|
|
|
wellPath->fishbonesCollection()->appendFishbonesSubs( obj );
|
2017-05-16 10:21:36 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
obj->setMeasuredDepthAndCount( wellPathSelItem->m_measuredDepth, 12.5, 13 );
|
2017-05-31 16:16:28 +02:00
|
|
|
|
2021-04-23 08:06:56 +02:00
|
|
|
RicNewFishbonesSubsFeature::adjustWellPathScaling( wellPath->fishbonesCollection() );
|
2017-05-20 20:21:19 +02:00
|
|
|
|
2017-05-16 10:21:36 +02:00
|
|
|
wellPath->updateConnectedEditors();
|
2019-09-06 10:40:57 +02:00
|
|
|
Riu3DMainWindowTools::selectAsCurrentItem( obj );
|
2017-05-16 10:21:36 +02:00
|
|
|
|
|
|
|
|
RimProject* proj;
|
2019-09-06 10:40:57 +02:00
|
|
|
wellPath->firstAncestorOrThisOfTypeAsserted( proj );
|
2017-06-02 10:35:52 +02:00
|
|
|
proj->reloadCompletionTypeResultsInAllViews();
|
2017-05-16 10:21:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2017-05-16 10:21:36 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
void RicNewFishbonesSubsAtMeasuredDepthFeature::setupActionLook( QAction* actionToSetup )
|
2017-05-16 10:21:36 +02:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
actionToSetup->setIcon( QIcon( ":/FishBoneGroup16x16.png" ) );
|
|
|
|
|
actionToSetup->setText( "Create Fishbones at this Depth" );
|
2017-05-16 10:21:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2017-05-16 10:21:36 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
bool RicNewFishbonesSubsAtMeasuredDepthFeature::isCommandEnabled()
|
|
|
|
|
{
|
2021-06-29 09:59:45 +02:00
|
|
|
if ( RiuWellPathSelectionItem::wellPathSelectionItem() )
|
2017-05-16 10:21:36 +02:00
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|