#1555 Add start measured depth to fishbones collection

This commit is contained in:
Bjørnar Grip Fjær 2017-06-02 14:58:33 +02:00
parent c5264f56cb
commit 3bb0e84eb7
3 changed files with 36 additions and 0 deletions

View File

@ -29,6 +29,7 @@
#include <QColor>
#include <algorithm>
CAF_PDM_SOURCE_INIT(RimFishbonesCollection, "FishbonesCollection");
@ -49,6 +50,8 @@ RimFishbonesCollection::RimFishbonesCollection()
CAF_PDM_InitFieldNoDefault(&m_wellPathCollection, "WellPathCollection", "Well Paths", "", "", "");
m_wellPathCollection = new RimFishboneWellPathCollection;
m_wellPathCollection.uiCapability()->setUiHidden(true);
CAF_PDM_InitField(&m_startMD, "StartMD", HUGE_VAL, "Start MD", "", "", "");
}
//--------------------------------------------------------------------------------------------------
@ -78,6 +81,8 @@ void RimFishbonesCollection::appendFishbonesSubs(RimFishbonesMultipleSubs* subs)
{
subs->fishbonesColor = nextFishbonesColor();
fishbonesSubs.push_back(subs);
recalculateStartMD();
}
//--------------------------------------------------------------------------------------------------
@ -113,3 +118,24 @@ cvf::Color3f RimFishbonesCollection::nextFishbonesColor() const
return cvf::Color3f::fromByteColor(qFishbonesColor.red(), qFishbonesColor.green(), qFishbonesColor.blue());
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFishbonesCollection::recalculateStartMD()
{
double minStartMD = HUGE_VAL;
for (const RimFishbonesMultipleSubs* sub : fishbonesSubs())
{
for (auto& index : sub->installedLateralIndices())
{
minStartMD = std::min(minStartMD, sub->measuredDepth(index.subIndex) - 13.0);
}
}
if (minStartMD < m_startMD())
{
m_startMD = minStartMD;
}
}

View File

@ -46,11 +46,16 @@ public:
caf::PdmChildArrayField<RimFishbonesMultipleSubs*> fishbonesSubs;
void recalculateStartMD();
protected:
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
private:
cvf::Color3f nextFishbonesColor() const;
private:
caf::PdmChildField<RimFishboneWellPathCollection*> m_wellPathCollection;
caf::PdmField<double> m_startMD;
};

View File

@ -22,6 +22,7 @@
#include "RigWellPath.h"
#include "RimProject.h"
#include "RimWellPath.h"
#include "RimFishbonesCollection.h"
#include "cafPdmUiListEditor.h"
@ -334,6 +335,10 @@ void RimFishbonesMultipleSubs::computeRangesAndLocations()
m_locationOfSubs = validMeasuredDepths;
}
RimFishbonesCollection* collection;
this->firstAncestorOrThisOfTypeAsserted(collection);
collection->recalculateStartMD();
}
//--------------------------------------------------------------------------------------------------