mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2483 Intersections : Keep branch index in intersection when switching branch detection mode
This commit is contained in:
parent
48419480fa
commit
fbe3e4fbda
@ -353,7 +353,7 @@ caf::PdmFieldHandle* RimIntersection::objectToggleField()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimSimWellInViewCollection* RimIntersection::simulationWellCollection()
|
RimSimWellInViewCollection* RimIntersection::simulationWellCollection() const
|
||||||
{
|
{
|
||||||
RimEclipseView* eclipseView = nullptr;
|
RimEclipseView* eclipseView = nullptr;
|
||||||
firstAncestorOrThisOfType(eclipseView);
|
firstAncestorOrThisOfType(eclipseView);
|
||||||
@ -411,12 +411,14 @@ std::vector< std::vector <cvf::Vec3d> > RimIntersection::polyLines(double * hori
|
|||||||
{
|
{
|
||||||
updateSimulationWellCenterline();
|
updateSimulationWellCenterline();
|
||||||
|
|
||||||
if (0 <= m_branchIndex && m_branchIndex < static_cast<int>(m_simulationWellBranchCenterlines.size()))
|
int branchIndexToUse = branchIndex();
|
||||||
|
|
||||||
|
if (0 <= branchIndexToUse && branchIndexToUse < static_cast<int>(m_simulationWellBranchCenterlines.size()))
|
||||||
{
|
{
|
||||||
lines.push_back(m_simulationWellBranchCenterlines[m_branchIndex]);
|
lines.push_back(m_simulationWellBranchCenterlines[branchIndexToUse]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_branchIndex == -1)
|
if (branchIndexToUse == -1)
|
||||||
{
|
{
|
||||||
lines = m_simulationWellBranchCenterlines;
|
lines = m_simulationWellBranchCenterlines;
|
||||||
}
|
}
|
||||||
@ -587,9 +589,9 @@ void RimIntersection::updateName()
|
|||||||
if (type == CS_SIMULATION_WELL && simulationWell())
|
if (type == CS_SIMULATION_WELL && simulationWell())
|
||||||
{
|
{
|
||||||
name = simulationWell()->name();
|
name = simulationWell()->name();
|
||||||
if (m_branchIndex() != -1)
|
if (branchIndex() != -1)
|
||||||
{
|
{
|
||||||
name = name() + " Branch " + QString::number(m_branchIndex() + 1);
|
name = name() + " Branch " + QString::number(branchIndex() + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (type() == CS_WELL_PATH && wellPath())
|
else if (type() == CS_WELL_PATH && wellPath())
|
||||||
@ -658,6 +660,26 @@ void RimIntersection::clipToReservoir(std::vector<cvf::Vec3d> &polyLine, double
|
|||||||
polyLine.swap(clippedPolyLine);
|
polyLine.swap(clippedPolyLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
int RimIntersection::branchIndex() const
|
||||||
|
{
|
||||||
|
RimSimWellInViewCollection* coll = simulationWellCollection();
|
||||||
|
|
||||||
|
if (coll && !coll->isAutoDetectingBranches())
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_branchIndex >= m_simulationWellBranchCenterlines.size())
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return m_branchIndex;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -881,7 +903,6 @@ void RimIntersection::recomputeSimulationWellBranchData()
|
|||||||
{
|
{
|
||||||
m_simulationWellBranchCenterlines.clear();
|
m_simulationWellBranchCenterlines.clear();
|
||||||
updateSimulationWellCenterline();
|
updateSimulationWellCenterline();
|
||||||
m_branchIndex = -1;
|
|
||||||
|
|
||||||
m_crossSectionPartMgr = nullptr;
|
m_crossSectionPartMgr = nullptr;
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,10 @@ protected:
|
|||||||
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute);
|
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute);
|
||||||
|
|
||||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly);
|
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly);
|
||||||
|
|
||||||
|
private:
|
||||||
|
int branchIndex() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<int> m_branchIndex;
|
caf::PdmField<int> m_branchIndex;
|
||||||
caf::PdmField<double> m_extentLength;
|
caf::PdmField<double> m_extentLength;
|
||||||
@ -130,7 +133,7 @@ private:
|
|||||||
static void setPushButtonText(bool buttonEnable, caf::PdmUiPushButtonEditorAttribute* attribute);
|
static void setPushButtonText(bool buttonEnable, caf::PdmUiPushButtonEditorAttribute* attribute);
|
||||||
static void setBaseColor(bool enable, caf::PdmUiListEditorAttribute* attribute);
|
static void setBaseColor(bool enable, caf::PdmUiListEditorAttribute* attribute);
|
||||||
|
|
||||||
RimSimWellInViewCollection* simulationWellCollection();
|
RimSimWellInViewCollection* simulationWellCollection() const;
|
||||||
void updateAzimuthLine();
|
void updateAzimuthLine();
|
||||||
void updateSimulationWellCenterline() const;
|
void updateSimulationWellCenterline() const;
|
||||||
void updateWellExtentDefaultValue();
|
void updateWellExtentDefaultValue();
|
||||||
|
Loading…
Reference in New Issue
Block a user