#6234 Fracture Model: add template to enable data sharing.

This commit is contained in:
Kristian Bendiksen
2020-09-22 15:53:17 +02:00
parent c325dce252
commit 851e245f83
25 changed files with 1101 additions and 213 deletions

View File

@@ -19,8 +19,10 @@
#include "RimFaciesProperties.h"
#include "RimColorLegend.h"
#include "RimColorLegendCollection.h"
#include "RimEclipseResultDefinition.h"
#include "RimFractureModel.h"
#include "RimFractureModelTemplate.h"
#include "RimProject.h"
#include "RimRegularLegendConfig.h"
#include "RicFaciesPropertiesImportTools.h"
@@ -93,6 +95,28 @@ void RimFaciesProperties::setFaciesCodeName( int code, const QString& name )
m_propertiesTable = generatePropertiesTable();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QList<caf::PdmOptionItemInfo> RimFaciesProperties::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly )
{
QList<caf::PdmOptionItemInfo> options;
if ( fieldNeedingOptions == &m_colorLegend )
{
RimProject* project = RimProject::current();
RimColorLegendCollection* colorLegendCollection = project->colorLegendCollection();
std::vector<RimColorLegend*> colorLegends = colorLegendCollection->allColorLegends();
for ( RimColorLegend* colorLegend : colorLegends )
{
options.push_back( caf::PdmOptionItemInfo( colorLegend->colorLegendName(), colorLegend ) );
}
}
return options;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -165,8 +189,16 @@ void RimFaciesProperties::loadDataAndUpdate()
{
if ( !m_filePath().path().isEmpty() )
{
RimFractureModel* fractureModel;
firstAncestorOrThisOfType( fractureModel );
RicFaciesPropertiesImportTools::importFaciesPropertiesFromFile( m_filePath().path(), fractureModel );
RimFractureModelTemplate* fractureModelTemplate;
firstAncestorOrThisOfType( fractureModelTemplate );
RicFaciesPropertiesImportTools::importFaciesPropertiesFromFile( m_filePath().path(), fractureModelTemplate );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFaciesProperties::setEclipseCase( RimEclipseCase* eclipseCase )
{
m_faciesDefinition->setEclipseCase( eclipseCase );
}