#6597 Add pdm objects and context menu for elastic property scaling.

This commit is contained in:
Kristian Bendiksen
2020-10-01 15:30:34 +02:00
parent 825a9bb531
commit 7c555658ec
11 changed files with 460 additions and 2 deletions

View File

@@ -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

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 "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;
}

View File

@@ -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;
};