mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#668) Autmatically change itersection name when changing well or branch
This commit is contained in:
parent
eb4fefce7c
commit
5c0c18ca30
@ -109,6 +109,15 @@ void RimCrossSection::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
|||||||
updateWellCenterline();
|
updateWellCenterline();
|
||||||
m_branchIndex = -1;
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -59,41 +59,39 @@ public:
|
|||||||
public:
|
public:
|
||||||
RimCrossSection();
|
RimCrossSection();
|
||||||
|
|
||||||
caf::PdmField<QString> name;
|
caf::PdmField<QString> name;
|
||||||
caf::PdmField<bool> isActive;
|
caf::PdmField<bool> isActive;
|
||||||
|
|
||||||
caf::PdmField< caf::AppEnum< CrossSectionEnum > > type;
|
caf::PdmField< caf::AppEnum< CrossSectionEnum > > type;
|
||||||
caf::PdmField< caf::AppEnum< CrossSectionDirEnum > > direction;
|
caf::PdmField< caf::AppEnum< CrossSectionDirEnum > > direction;
|
||||||
|
|
||||||
caf::PdmPtrField<RimWellPath*> wellPath;
|
caf::PdmPtrField<RimWellPath*> wellPath;
|
||||||
caf::PdmPtrField<RimEclipseWell*> simulationWell;
|
caf::PdmPtrField<RimEclipseWell*> simulationWell;
|
||||||
|
|
||||||
|
std::vector< std::vector <cvf::Vec3d> > polyLines() const;
|
||||||
|
RivCrossSectionPartMgr* crossSectionPartMgr();
|
||||||
std::vector< std::vector <cvf::Vec3d> > polyLines() const;
|
|
||||||
|
|
||||||
void addExtents(std::vector<cvf::Vec3d> &polyLine) const;
|
|
||||||
|
|
||||||
RivCrossSectionPartMgr* crossSectionPartMgr();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual caf::PdmFieldHandle* userDescriptionField();
|
virtual caf::PdmFieldHandle* userDescriptionField();
|
||||||
virtual caf::PdmFieldHandle* objectToggleField();
|
virtual caf::PdmFieldHandle* objectToggleField();
|
||||||
|
|
||||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
|
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
|
||||||
|
|
||||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly);
|
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<int> m_branchIndex;
|
caf::PdmField<int> m_branchIndex;
|
||||||
caf::PdmField<double> m_extentLength;
|
caf::PdmField<double> m_extentLength;
|
||||||
|
|
||||||
RimEclipseWellCollection* simulationWellCollection();
|
RimEclipseWellCollection* simulationWellCollection();
|
||||||
void updateWellCenterline() const;
|
void updateWellCenterline() const;
|
||||||
void updateWellExtentDefaultValue();
|
void updateWellExtentDefaultValue();
|
||||||
|
void addExtents(std::vector<cvf::Vec3d> &polyLine) const;
|
||||||
private:
|
void updateName();
|
||||||
cvf::ref<RivCrossSectionPartMgr> m_crossSectionPartMgr;
|
private:
|
||||||
mutable std::vector< std::vector <cvf::Vec3d> > m_wellBranchCenterlines;
|
cvf::ref<RivCrossSectionPartMgr> m_crossSectionPartMgr;
|
||||||
|
|
||||||
|
mutable
|
||||||
|
std::vector< std::vector <cvf::Vec3d> > m_wellBranchCenterlines;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user