#3268 MSW export. Improved FractureCollection interface

This commit is contained in:
Bjørn Erik Jensen 2018-09-05 11:46:02 +02:00 committed by Magne Sjaastad
parent d0f6346376
commit ff976cff38
5 changed files with 29 additions and 11 deletions

View File

@ -67,7 +67,7 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
if (wellPath->fractureCollection()->isChecked())
{
for (auto& frac : wellPath->fractureCollection()->fractures)
for (auto& frac : wellPath->fractureCollection()->fractures())
{
if (frac->isChecked())
{

View File

@ -115,7 +115,7 @@ void RicCreateMultipleFracturesFeature::slotAppendFractures()
RimWellPathFractureCollection* fractureCollection = item.wellPath->fractureCollection();
// If this is the first fracture, set default result name
if (fractureCollection->fractures.empty())
if (fractureCollection->fractures().empty())
{
RimEclipseView* activeView = dynamic_cast<RimEclipseView*>(RiaApplication::instance()->activeReservoirView());
if (activeView)
@ -125,7 +125,7 @@ void RicCreateMultipleFracturesFeature::slotAppendFractures()
}
RimWellPathFracture* fracture = new RimWellPathFracture();
fractureCollection->fractures.push_back(fracture);
fractureCollection->addFracture(fracture);
fracture->setFractureUnit(item.wellPath->unitSystem());
fracture->setMeasuredDepth(item.measuredDepth);

View File

@ -61,7 +61,7 @@ void RicNewWellPathFractureFeature::addFracture(RimWellPath* wellPath, double me
RimWellPathFractureCollection* fractureCollection = wellPath->fractureCollection();
CVF_ASSERT(fractureCollection);
if (fractureCollection->fractures.empty())
if (fractureCollection->fractures().empty())
{
RimEclipseView* activeView = dynamic_cast<RimEclipseView*>(RiaApplication::instance()->activeReservoirView());
if (activeView)
@ -71,7 +71,7 @@ void RicNewWellPathFractureFeature::addFracture(RimWellPath* wellPath, double me
}
RimWellPathFracture* fracture = new RimWellPathFracture();
fractureCollection->fractures.push_back(fracture);
fractureCollection->addFracture(fracture);
fracture->setMeasuredDepth(measuredDepth);
fracture->setFractureUnit(wellPath->unitSystem());

View File

@ -44,8 +44,8 @@ RimWellPathFractureCollection::RimWellPathFractureCollection(void)
{
CAF_PDM_InitObject("Fractures", ":/FractureLayout16x16.png", "", "");
CAF_PDM_InitFieldNoDefault(&fractures, "Fractures", "", "", "", "");
fractures.uiCapability()->setUiHidden(true);
CAF_PDM_InitFieldNoDefault(&m_fractures, "Fractures", "", "", "", "");
m_fractures.uiCapability()->setUiHidden(true);
setName("Fractures");
nameField()->uiCapability()->setUiHidden(true);
@ -73,12 +73,20 @@ const RimMswCompletionParameters* RimWellPathFractureCollection::mswParameters()
return m_mswParameters;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPathFractureCollection::addFracture(RimWellPathFracture* fracture)
{
m_fractures.push_back(fracture);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPathFractureCollection::deleteFractures()
{
fractures.deleteAllChildObjects();
m_fractures.deleteAllChildObjects();
}
//--------------------------------------------------------------------------------------------------
@ -109,6 +117,14 @@ double RimWellPathFractureCollection::manualReferenceMD() const
return m_refMD;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimWellPathFracture*> RimWellPathFractureCollection::fractures() const
{
return m_fractures.childObjects();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -26,6 +26,8 @@
#include "cafPdmObject.h"
#include "cafPdmChildArrayField.h"
#include <vector>
class RimWellPathFracture;
//==================================================================================================
@ -48,13 +50,12 @@ public:
virtual ~RimWellPathFractureCollection(void);
const RimMswCompletionParameters* mswParameters() const;
void addFracture(RimWellPathFracture* fracture);
void deleteFractures();
void setUnitSystemSpecificDefaults();
ReferenceMDType referenceMDType() const;
double manualReferenceMD() const;
public:
caf::PdmChildArrayField<RimWellPathFracture*> fractures;
std::vector<RimWellPathFracture*> fractures() const;
protected:
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
@ -62,6 +63,7 @@ protected:
private:
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
caf::PdmChildArrayField<RimWellPathFracture*> m_fractures;
caf::PdmField<ReferenceMDEnum> m_refMDType;
caf::PdmField<double> m_refMD;
caf::PdmChildField<RimMswCompletionParameters*> m_mswParameters;