#4317 Add default ellipse fracture template

This commit is contained in:
Gaute Lindkvist 2019-04-16 13:30:03 +02:00
parent a8bcfefca2
commit 4439f7609b
4 changed files with 20 additions and 9 deletions

View File

@ -81,14 +81,7 @@ RimEllipseFractureTemplate* RicNewEllipseFractureTemplateFeature::createNewTempl
if (fracDefColl)
{
RimEllipseFractureTemplate* ellipseFractureTemplate = new RimEllipseFractureTemplate();
fracDefColl->addFractureTemplate(ellipseFractureTemplate);
ellipseFractureTemplate->setName("Ellipse Fracture Template");
ellipseFractureTemplate->setUnitSystem(fracDefColl->defaultUnitSystemType());
ellipseFractureTemplate->setDefaultValuesFromUnit();
return ellipseFractureTemplate;
return fracDefColl->addDefaultEllipseTemplate();
}
return nullptr;
}

View File

@ -36,7 +36,7 @@ RimCompletionTemplateCollection::RimCompletionTemplateCollection()
CAF_PDM_InitFieldNoDefault(&m_fractureTemplates, "FractureTemplates", "", "", "", "");
m_fractureTemplates = new RimFractureTemplateCollection;
m_fractureTemplates->addDefaultEllipseTemplate();
CAF_PDM_InitFieldNoDefault(&m_valveTemplates, "ValveTemplates", "", "", "", "");
m_valveTemplates = new RimValveTemplateCollection;
}

View File

@ -99,6 +99,22 @@ std::vector<RimFractureTemplate*> RimFractureTemplateCollection::fractureTemplat
return templates;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimEllipseFractureTemplate* RimFractureTemplateCollection::addDefaultEllipseTemplate()
{
RimEllipseFractureTemplate* ellipseFractureTemplate = new RimEllipseFractureTemplate();
addFractureTemplate(ellipseFractureTemplate);
ellipseFractureTemplate->setName("Ellipse Fracture Template");
ellipseFractureTemplate->setUnitSystem(defaultUnitSystemType());
ellipseFractureTemplate->setDefaultValuesFromUnit();
return ellipseFractureTemplate;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -24,6 +24,7 @@
#include "cafPdmObject.h"
#include "cafPdmChildArrayField.h"
class RimEllipseFractureTemplate;
class RimFractureTemplate;
//==================================================================================================
@ -40,6 +41,7 @@ public:
RimFractureTemplate* fractureTemplate(int id) const;
std::vector<RimFractureTemplate*> fractureTemplates() const;
RimEllipseFractureTemplate* addDefaultEllipseTemplate();
void addFractureTemplate(RimFractureTemplate* templ);
RiaEclipseUnitTools::UnitSystemType defaultUnitSystemType() const;