#6232 Make fracture model pdm objects scriptable.

This commit is contained in:
Kristian Bendiksen 2020-08-07 10:51:07 +02:00
parent 67af692f96
commit 7c69fc61ef
5 changed files with 84 additions and 51 deletions

View File

@ -51,6 +51,8 @@
#include "RimWellPathGeometryDef.h" #include "RimWellPathGeometryDef.h"
#include "RimWellPathTarget.h" #include "RimWellPathTarget.h"
#include "cafPdmFieldIOScriptability.h"
#include "cafPdmObjectScriptability.h"
#include "cafPdmUiDoubleSliderEditor.h" #include "cafPdmUiDoubleSliderEditor.h"
#include "cafPdmUiPushButtonEditor.h" #include "cafPdmUiPushButtonEditor.h"
#include "cafPdmUiToolButtonEditor.h" #include "cafPdmUiToolButtonEditor.h"
@ -83,65 +85,89 @@ void caf::AppEnum<RimFractureModel::ExtractionType>::setUp()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RimFractureModel::RimFractureModel() RimFractureModel::RimFractureModel()
{ {
CAF_PDM_InitObject( "FractureModel", "", "", "" ); CAF_PDM_InitScriptableObject( "FractureModel", "", "", "" );
CAF_PDM_InitField( &m_MD, "MD", 0.0, "MD", "", "", "" ); CAF_PDM_InitScriptableField( &m_MD, "MD", 0.0, "MD", "", "", "" );
CAF_PDM_InitField( &m_extractionType, CAF_PDM_InitScriptableField( &m_extractionType,
"ExtractionType", "ExtractionType",
caf::AppEnum<ExtractionType>( ExtractionType::TRUE_STRATIGRAPHIC_THICKNESS ), caf::AppEnum<ExtractionType>( ExtractionType::TRUE_STRATIGRAPHIC_THICKNESS ),
"Extraction Type", "Extraction Type",
"", "",
"", "",
"" ); "" );
CAF_PDM_InitFieldNoDefault( &m_anchorPosition, "AnchorPosition", "Anchor Position", "", "", "" ); CAF_PDM_InitScriptableFieldNoDefault( &m_anchorPosition, "AnchorPosition", "Anchor Position", "", "", "" );
m_anchorPosition.uiCapability()->setUiReadOnly( true ); m_anchorPosition.uiCapability()->setUiReadOnly( true );
CAF_PDM_InitFieldNoDefault( &m_thicknessDirection, "ThicknessDirection", "Thickness Direction", "", "", "" ); CAF_PDM_InitScriptableFieldNoDefault( &m_thicknessDirection, "ThicknessDirection", "Thickness Direction", "", "", "" );
m_thicknessDirection.uiCapability()->setUiReadOnly( true ); m_thicknessDirection.uiCapability()->setUiReadOnly( true );
CAF_PDM_InitFieldNoDefault( &m_thicknessDirectionWellPath, CAF_PDM_InitScriptableFieldNoDefault( &m_thicknessDirectionWellPath,
"ThicknessDirectionWellPath", "ThicknessDirectionWellPath",
"Thickness Direction Well Path", "Thickness Direction Well Path",
"", "",
"", "",
"" ); "" );
CAF_PDM_InitField( &m_boundingBoxHorizontal, "BoundingBoxHorizontal", 50.0, "Bounding Box Horizontal", "", "", "" ); CAF_PDM_InitScriptableField( &m_boundingBoxHorizontal, "BoundingBoxHorizontal", 50.0, "Bounding Box Horizontal", "", "", "" );
CAF_PDM_InitField( &m_boundingBoxVertical, "BoundingBoxVertical", 100.0, "Bounding Box Vertical", "", "", "" ); CAF_PDM_InitScriptableField( &m_boundingBoxVertical, "BoundingBoxVertical", 100.0, "Bounding Box Vertical", "", "", "" );
CAF_PDM_InitField( &m_defaultPorosity, "DefaultPorosity", 0.0, "Default Porosity", "", "", "" ); CAF_PDM_InitScriptableField( &m_defaultPorosity, "DefaultPorosity", 0.0, "Default Porosity", "", "", "" );
CAF_PDM_InitField( &m_defaultPermeability, "DefaultPermeability", 10.0e-6, "Default Permeability", "", "", "" ); CAF_PDM_InitScriptableField( &m_defaultPermeability, "DefaultPermeability", 10.0e-6, "Default Permeability", "", "", "" );
// Stress unit: bar // Stress unit: bar
// Stress gradient unit: bar/m // Stress gradient unit: bar/m
// Depth is meter // Depth is meter
CAF_PDM_InitField( &m_verticalStress, "VerticalStress", 879.0, "Vertical Stress", "", "", "" ); CAF_PDM_InitScriptableField( &m_verticalStress, "VerticalStress", 879.0, "Vertical Stress", "", "", "" );
CAF_PDM_InitField( &m_verticalStressGradient, "VerticalStressGradient", 0.238, "Vertical Stress Gradient", "", "", "" ); CAF_PDM_InitScriptableField( &m_verticalStressGradient,
CAF_PDM_InitField( &m_stressDepth, "StressDepth", 1000.0, "Stress Depth", "", "", "" ); "VerticalStressGradient",
0.238,
"Vertical Stress Gradient",
"",
"",
"" );
CAF_PDM_InitScriptableField( &m_stressDepth, "StressDepth", 1000.0, "Stress Depth", "", "", "" );
CAF_PDM_InitField( &m_overburdenHeight, "OverburdenHeight", 50.0, "Overburden Height", "", "", "" ); CAF_PDM_InitScriptableField( &m_overburdenHeight, "OverburdenHeight", 50.0, "Overburden Height", "", "", "" );
CAF_PDM_InitFieldNoDefault( &m_overburdenFormation, "OverburdenFormation", "Overburden Formation", "", "", "" ); CAF_PDM_InitScriptableFieldNoDefault( &m_overburdenFormation, "OverburdenFormation", "Overburden Formation", "", "", "" );
CAF_PDM_InitFieldNoDefault( &m_overburdenFacies, "OverburdenFacies", "Overburden Facies", "", "", "" ); CAF_PDM_InitScriptableFieldNoDefault( &m_overburdenFacies, "OverburdenFacies", "Overburden Facies", "", "", "" );
CAF_PDM_InitField( &m_overburdenPorosity, "OverburdenPorosity", 0.0, "Overburden Porosity", "", "", "" ); CAF_PDM_InitScriptableField( &m_overburdenPorosity, "OverburdenPorosity", 0.0, "Overburden Porosity", "", "", "" );
CAF_PDM_InitField( &m_overburdenPermeability, "OverburdenPermeability", 10.0e-6, "Overburden Permeability", "", "", "" ); CAF_PDM_InitScriptableField( &m_overburdenPermeability,
CAF_PDM_InitField( &m_overburdenFluidDensity, "OverburdenFluidDensity", 1.03, "Overburden Fluid Density [g/cm^3]", "", "", "" ); "OverburdenPermeability",
10.0e-6,
"Overburden Permeability",
"",
"",
"" );
CAF_PDM_InitScriptableField( &m_overburdenFluidDensity,
"OverburdenFluidDensity",
1.03,
"Overburden Fluid Density [g/cm^3]",
"",
"",
"" );
CAF_PDM_InitField( &m_underburdenHeight, "UnderburdenHeight", 50.0, "Underburden Height", "", "", "" ); CAF_PDM_InitScriptableField( &m_underburdenHeight, "UnderburdenHeight", 50.0, "Underburden Height", "", "", "" );
CAF_PDM_InitFieldNoDefault( &m_underburdenFormation, "UnderburdenFormation", "Underburden Formation", "", "", "" ); CAF_PDM_InitScriptableFieldNoDefault( &m_underburdenFormation, "UnderburdenFormation", "Underburden Formation", "", "", "" );
CAF_PDM_InitFieldNoDefault( &m_underburdenFacies, "UnderburdenFacies", "Underburden Facies", "", "", "" ); CAF_PDM_InitScriptableFieldNoDefault( &m_underburdenFacies, "UnderburdenFacies", "Underburden Facies", "", "", "" );
CAF_PDM_InitField( &m_underburdenPorosity, "UnderburdenPorosity", 0.0, "Underburden Porosity", "", "", "" ); CAF_PDM_InitScriptableField( &m_underburdenPorosity, "UnderburdenPorosity", 0.0, "Underburden Porosity", "", "", "" );
CAF_PDM_InitField( &m_underburdenPermeability, "UnderburdenPermeability", 10.0e-6, "Underburden Permeability", "", "", "" ); CAF_PDM_InitScriptableField( &m_underburdenPermeability,
CAF_PDM_InitField( &m_underburdenFluidDensity, "UnderburdenPermeability",
"UnderburdenFluidDensity", 10.0e-6,
1.03, "Underburden Permeability",
"Underburden Fluid Density [g/cm^3]", "",
"", "",
"", "" );
"" ); CAF_PDM_InitScriptableField( &m_underburdenFluidDensity,
"UnderburdenFluidDensity",
1.03,
"Underburden Fluid Density [g/cm^3]",
"",
"",
"" );
CAF_PDM_InitFieldNoDefault( &m_elasticProperties, "ElasticProperties", "Elastic Properties", "", "", "" ); CAF_PDM_InitScriptableFieldNoDefault( &m_elasticProperties, "ElasticProperties", "Elastic Properties", "", "", "" );
m_elasticProperties.uiCapability()->setUiHidden( true ); m_elasticProperties.uiCapability()->setUiHidden( true );
m_elasticProperties.uiCapability()->setUiTreeHidden( true ); m_elasticProperties.uiCapability()->setUiTreeHidden( true );
} }

View File

@ -21,7 +21,9 @@
#include "RimFractureModel.h" #include "RimFractureModel.h"
#include "RimProject.h" #include "RimProject.h"
#include "cafPdmFieldIOScriptability.h"
#include "cafPdmObject.h" #include "cafPdmObject.h"
#include "cafPdmObjectScriptability.h"
CAF_PDM_SOURCE_INIT( RimFractureModelCollection, "FractureModelCollection" ); CAF_PDM_SOURCE_INIT( RimFractureModelCollection, "FractureModelCollection" );
@ -30,9 +32,9 @@ CAF_PDM_SOURCE_INIT( RimFractureModelCollection, "FractureModelCollection" );
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RimFractureModelCollection::RimFractureModelCollection( void ) RimFractureModelCollection::RimFractureModelCollection( void )
{ {
CAF_PDM_InitObject( "Fracture Models", "", "", "" ); CAF_PDM_InitScriptableObject( "Fracture Models", "", "", "" );
CAF_PDM_InitFieldNoDefault( &m_fractureModels, "FractureModels", "", "", "", "" ); CAF_PDM_InitScriptableFieldNoDefault( &m_fractureModels, "FractureModels", "", "", "", "" );
m_fractureModels.uiCapability()->setUiHidden( true ); m_fractureModels.uiCapability()->setUiHidden( true );
setName( "Fracture Models" ); setName( "Fracture Models" );

View File

@ -22,6 +22,8 @@
#include "RicElasticPropertiesImportTools.h" #include "RicElasticPropertiesImportTools.h"
#include "cafPdmFieldIOScriptability.h"
#include "cafPdmObjectScriptability.h"
#include "cafPdmUiLineEditor.h" #include "cafPdmUiLineEditor.h"
#include "cafPdmUiTextEditor.h" #include "cafPdmUiTextEditor.h"
@ -32,13 +34,13 @@ CAF_PDM_SOURCE_INIT( RimElasticProperties, "ElasticProperties" );
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RimElasticProperties::RimElasticProperties() RimElasticProperties::RimElasticProperties()
{ {
CAF_PDM_InitObject( "RimElasticProperties", "", "", "" ); CAF_PDM_InitScriptableObject( "RimElasticProperties", "", "", "" );
CAF_PDM_InitFieldNoDefault( &m_filePath, "FilePath", "File Path", "", "", "" ); CAF_PDM_InitScriptableFieldNoDefault( &m_filePath, "FilePath", "File Path", "", "", "" );
m_filePath.uiCapability()->setUiReadOnly( true ); m_filePath.uiCapability()->setUiReadOnly( true );
m_filePath.uiCapability()->setUiEditorTypeName( caf::PdmUiLineEditor::uiEditorTypeName() ); m_filePath.uiCapability()->setUiEditorTypeName( caf::PdmUiLineEditor::uiEditorTypeName() );
CAF_PDM_InitFieldNoDefault( &m_propertiesTable, "PropertiesTable", "Properties Table", "", "", "" ); CAF_PDM_InitScriptableFieldNoDefault( &m_propertiesTable, "PropertiesTable", "Properties Table", "", "", "" );
m_propertiesTable.uiCapability()->setUiEditorTypeName( caf::PdmUiTextEditor::uiEditorTypeName() ); m_propertiesTable.uiCapability()->setUiEditorTypeName( caf::PdmUiTextEditor::uiEditorTypeName() );
m_propertiesTable.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN ); m_propertiesTable.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
m_propertiesTable.uiCapability()->setUiReadOnly( true ); m_propertiesTable.uiCapability()->setUiReadOnly( true );

View File

@ -44,7 +44,7 @@ RimFractureModelPlot::RimFractureModelPlot()
{ {
CAF_PDM_InitScriptableObject( "Fracture Model Plot", "", "", "A fracture model plot" ); CAF_PDM_InitScriptableObject( "Fracture Model Plot", "", "", "A fracture model plot" );
CAF_PDM_InitFieldNoDefault( &m_fractureModel, "FractureModel", "Fracture Model", "", "", "" ); CAF_PDM_InitScriptableFieldNoDefault( &m_fractureModel, "FractureModel", "Fracture Model", "", "", "" );
m_fractureModel.uiCapability()->setUiTreeChildrenHidden( true ); m_fractureModel.uiCapability()->setUiTreeChildrenHidden( true );
m_fractureModel.uiCapability()->setUiHidden( true ); m_fractureModel.uiCapability()->setUiHidden( true );

View File

@ -20,6 +20,9 @@
#include "RimFractureModelPlot.h" #include "RimFractureModelPlot.h"
#include "cafPdmFieldIOScriptability.h"
#include "cafPdmObjectScriptability.h"
CAF_PDM_SOURCE_INIT( RimFractureModelPlotCollection, "FractureModelPlotCollection" ); CAF_PDM_SOURCE_INIT( RimFractureModelPlotCollection, "FractureModelPlotCollection" );
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -27,9 +30,9 @@ CAF_PDM_SOURCE_INIT( RimFractureModelPlotCollection, "FractureModelPlotCollectio
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RimFractureModelPlotCollection::RimFractureModelPlotCollection() RimFractureModelPlotCollection::RimFractureModelPlotCollection()
{ {
CAF_PDM_InitObject( "FractureModelPlots", ":/WellLogPlots16x16.png", "", "" ); CAF_PDM_InitScriptableObject( "FractureModelPlots", ":/WellLogPlots16x16.png", "", "" );
CAF_PDM_InitFieldNoDefault( &m_fractureModelPlots, "FractureModelPlots", "", "", "", "" ); CAF_PDM_InitScriptableFieldNoDefault( &m_fractureModelPlots, "FractureModelPlots", "", "", "", "" );
m_fractureModelPlots.uiCapability()->setUiHidden( true ); m_fractureModelPlots.uiCapability()->setUiHidden( true );
} }