mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#6597: Add python api for adding elastic properties scaling.
This commit is contained in:
@@ -4,6 +4,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimcSummaryPlotCollection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcSummaryCase.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcSummaryResampleData.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcProject.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcElasticProperties.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcFractureModelCollection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcFractureModelTemplateCollection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcFractureModelPlotCollection.h
|
||||
@@ -19,6 +20,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimcSummaryPlotCollection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcSummaryCase.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcSummaryResampleData.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcProject.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcElasticProperties.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcFractureModelCollection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcFractureModelTemplateCollection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimcFractureModelPlotCollection.cpp
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RimcElasticProperties.h"
|
||||
|
||||
#include "RimElasticProperties.h"
|
||||
#include "RimElasticPropertyScaling.h"
|
||||
#include "RimElasticPropertyScalingCollection.h"
|
||||
|
||||
#include "cafPdmAbstractFieldScriptingCapability.h"
|
||||
#include "cafPdmFieldScriptingCapability.h"
|
||||
|
||||
CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimElasticProperties, RimcElasticProperties_addPropertyScaling, "AddPropertyScaling" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimcElasticProperties_addPropertyScaling::RimcElasticProperties_addPropertyScaling( caf::PdmObjectHandle* self )
|
||||
: caf::PdmObjectMethod( self )
|
||||
{
|
||||
CAF_PDM_InitObject( "Add Elastic Propery Scaling", "", "", "Add Elastic Property Scaling" );
|
||||
|
||||
CAF_PDM_InitScriptableFieldNoDefault( &m_formation, "Formation", "", "", "", "Formation" );
|
||||
CAF_PDM_InitScriptableFieldNoDefault( &m_facies, "Facies", "", "", "", "Facies" );
|
||||
CAF_PDM_InitScriptableFieldNoDefault( &m_property, "Property", "", "", "", "Property" );
|
||||
CAF_PDM_InitScriptableFieldNoDefault( &m_scale, "Scale", "", "", "", "Scale" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmObjectHandle* RimcElasticProperties_addPropertyScaling::execute()
|
||||
{
|
||||
RimElasticProperties* elasticProperties = self<RimElasticProperties>();
|
||||
|
||||
RimElasticPropertyScalingCollection* scalingColl = elasticProperties->scalingCollection();
|
||||
if ( !scalingColl ) return nullptr;
|
||||
|
||||
RimElasticPropertyScaling* propertyScaling = new RimElasticPropertyScaling;
|
||||
propertyScaling->setFormation( m_formation() );
|
||||
propertyScaling->setFacies( m_facies() );
|
||||
propertyScaling->setScale( m_scale() );
|
||||
|
||||
caf::AppEnum<RiaDefines::CurveProperty> property;
|
||||
property.setFromText( m_property() );
|
||||
propertyScaling->setProperty( property );
|
||||
|
||||
scalingColl->addElasticPropertyScaling( propertyScaling );
|
||||
scalingColl->updateConnectedEditors();
|
||||
|
||||
return propertyScaling;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimcElasticProperties_addPropertyScaling::resultIsPersistent() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::unique_ptr<caf::PdmObjectHandle> RimcElasticProperties_addPropertyScaling::defaultResult() const
|
||||
{
|
||||
return std::unique_ptr<caf::PdmObjectHandle>( new RimElasticPropertyScaling );
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RimFractureModelCollection.h"
|
||||
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObjectHandle.h"
|
||||
#include "cafPdmObjectMethod.h"
|
||||
#include "cafPdmPtrArrayField.h"
|
||||
#include "cafPdmPtrField.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
class RimFractureModelCollection;
|
||||
class RimFractureModelTemplate;
|
||||
class RimWellPath;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimcElasticProperties_addPropertyScaling : public caf::PdmObjectMethod
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RimcElasticProperties_addPropertyScaling( caf::PdmObjectHandle* self );
|
||||
|
||||
caf::PdmObjectHandle* execute() override;
|
||||
bool resultIsPersistent() const override;
|
||||
std::unique_ptr<PdmObjectHandle> defaultResult() const override;
|
||||
|
||||
private:
|
||||
caf::PdmField<QString> m_formation;
|
||||
caf::PdmField<QString> m_facies;
|
||||
caf::PdmField<QString> m_property;
|
||||
caf::PdmField<double> m_scale;
|
||||
};
|
||||
Reference in New Issue
Block a user