mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1037 - pre-proto - Added calculateValueOptions for RimFracture to find options for fractureDefinitions and wellpaths
This commit is contained in:
parent
c6b388873a
commit
456bc03483
@ -18,10 +18,20 @@
|
||||
|
||||
#include "RimFracture.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RimFractureDefinition.h"
|
||||
#include "RimFractureDefinitionCollection.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimWellPath.h"
|
||||
|
||||
#include "cafPdmFieldHandle.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmUiItem.h"
|
||||
|
||||
#include "QToolBox"
|
||||
#include "QList"
|
||||
|
||||
|
||||
namespace caf
|
||||
@ -67,6 +77,53 @@ RimFracture::~RimFracture()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QList<caf::PdmOptionItemInfo> RimFracture::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly)
|
||||
{
|
||||
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
CVF_ASSERT(proj);
|
||||
|
||||
RimOilField* oilField = proj->activeOilField();
|
||||
if (oilField == nullptr) return options;
|
||||
|
||||
if (fieldNeedingOptions == &fractureDefinition)
|
||||
{
|
||||
|
||||
RimFractureDefinitionCollection* fracDefColl = oilField->fractureDefinitionCollection();
|
||||
if (fracDefColl == nullptr) return options;
|
||||
|
||||
for (RimFractureDefinition* fracDef : fracDefColl->fractureDefinitions())
|
||||
{
|
||||
options.push_back(caf::PdmOptionItemInfo(fracDef->name(), fracDef));
|
||||
}
|
||||
}
|
||||
else if (fieldNeedingOptions == &wellpath)
|
||||
{
|
||||
RimWellPathCollection* wellPathColl = oilField->wellPathCollection();
|
||||
if (wellPathColl == nullptr) return options;
|
||||
|
||||
for (RimWellPath* wellPath : wellPathColl->wellPaths())
|
||||
{
|
||||
options.push_back(caf::PdmOptionItemInfo(wellPath->name(), wellPath));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return options;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -56,6 +56,9 @@ public:
|
||||
caf::PdmField<int> j;
|
||||
caf::PdmField<int> k;
|
||||
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
|
||||
|
||||
|
||||
protected:
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user