mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#6597 Add pdm objects and context menu for elastic property scaling.
This commit is contained in:
@@ -15,6 +15,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewFractureModelFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureModelAtPosFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewFractureModelTemplateFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewElasticPropertyScalingFeature.h
|
||||
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesOptionItemUi.h
|
||||
@@ -39,6 +40,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewFractureModelFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureModelAtPosFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewFractureModelTemplateFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewElasticPropertyScalingFeature.cpp
|
||||
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesOptionItemUi.cpp
|
||||
|
||||
@@ -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 "RicNewElasticPropertyScalingFeature.h"
|
||||
|
||||
#include "RimElasticProperties.h"
|
||||
#include "RimElasticPropertyScaling.h"
|
||||
#include "RimElasticPropertyScalingCollection.h"
|
||||
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include "cvfAssert.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicNewElasticPropertyScalingFeature, "RicNewElasticPropertyScalingFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewElasticPropertyScalingFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
RimElasticProperties* elasticProperties =
|
||||
caf::SelectionManager::instance()->selectedItemOfType<RimElasticProperties>();
|
||||
if ( !elasticProperties ) return;
|
||||
|
||||
RimElasticPropertyScalingCollection* scalingColl = elasticProperties->scalingCollection();
|
||||
if ( !scalingColl ) return;
|
||||
|
||||
RimElasticPropertyScaling* fractureModelTemplate = new RimElasticPropertyScaling;
|
||||
|
||||
scalingColl->addElasticPropertyScaling( fractureModelTemplate );
|
||||
scalingColl->updateConnectedEditors();
|
||||
Riu3DMainWindowTools::selectAsCurrentItem( fractureModelTemplate );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewElasticPropertyScalingFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setText( "New Property Scaling" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewElasticPropertyScalingFeature::isCommandEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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"
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicNewElasticPropertyScalingFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
bool isCommandEnabled() override;
|
||||
};
|
||||
Reference in New Issue
Block a user