(#668) Autmatically change itersection name when changing well or branch

This commit is contained in:
Jacob Støren 2015-11-27 10:13:29 +01:00
parent eb4fefce7c
commit 5c0c18ca30
2 changed files with 57 additions and 30 deletions

View File

@ -109,6 +109,15 @@ void RimCrossSection::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
updateWellCenterline();
m_branchIndex = -1;
}
if (changedField == &simulationWell
|| changedField == &wellPath
|| changedField == &m_branchIndex)
{
updateName();
}
}
//--------------------------------------------------------------------------------------------------
@ -394,3 +403,23 @@ void RimCrossSection::updateWellExtentDefaultValue()
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimCrossSection::updateName()
{
if (type == CS_SIMULATION_WELL && simulationWell())
{
name = simulationWell()->name();
if (m_branchIndex() != -1)
{
name = name() + " Branch " + QString::number(m_branchIndex() + 1);
}
}
else if (type() == CS_WELL_PATH && wellPath())
{
name = wellPath()->name();
}
}

View File

@ -68,12 +68,7 @@ public:
caf::PdmPtrField<RimWellPath*> wellPath;
caf::PdmPtrField<RimEclipseWell*> simulationWell;
std::vector< std::vector <cvf::Vec3d> > polyLines() const;
void addExtents(std::vector<cvf::Vec3d> &polyLine) const;
RivCrossSectionPartMgr* crossSectionPartMgr();
protected:
@ -92,8 +87,11 @@ private:
RimEclipseWellCollection* simulationWellCollection();
void updateWellCenterline() const;
void updateWellExtentDefaultValue();
void addExtents(std::vector<cvf::Vec3d> &polyLine) const;
void updateName();
private:
cvf::ref<RivCrossSectionPartMgr> m_crossSectionPartMgr;
mutable std::vector< std::vector <cvf::Vec3d> > m_wellBranchCenterlines;
mutable
std::vector< std::vector <cvf::Vec3d> > m_wellBranchCenterlines;
};