mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#633) Added branch control to simulation well cross sections.
This commit is contained in:
@@ -67,10 +67,11 @@ RimCrossSection::RimCrossSection()
|
|||||||
CAF_PDM_InitField(&isActive, "Active", true, "Active", "", "", "");
|
CAF_PDM_InitField(&isActive, "Active", true, "Active", "", "", "");
|
||||||
isActive.uiCapability()->setUiHidden(true);
|
isActive.uiCapability()->setUiHidden(true);
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault(&wellPath, "WellPath", "Well Path", "", "", "");
|
|
||||||
CAF_PDM_InitFieldNoDefault(&simulationWell, "SimulationWell", "Simulation Well", "", "", "");
|
|
||||||
CAF_PDM_InitFieldNoDefault(&type, "Type", "Type", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&type, "Type", "Type", "", "", "");
|
||||||
CAF_PDM_InitFieldNoDefault(&direction, "Direction", "Direction", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&direction, "Direction", "Direction", "", "", "");
|
||||||
|
CAF_PDM_InitFieldNoDefault(&wellPath, "WellPath", "Well Path", "", "", "");
|
||||||
|
CAF_PDM_InitFieldNoDefault(&simulationWell, "SimulationWell", "Simulation Well", "", "", "");
|
||||||
|
CAF_PDM_InitField (&branchIndex, "Branch", -1, "Branch", "", "", "");
|
||||||
|
|
||||||
uiCapability()->setUiChildrenHidden(true);
|
uiCapability()->setUiChildrenHidden(true);
|
||||||
}
|
}
|
||||||
@@ -84,7 +85,8 @@ void RimCrossSection::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
|||||||
changedField == &type ||
|
changedField == &type ||
|
||||||
changedField == &direction ||
|
changedField == &direction ||
|
||||||
changedField == &wellPath ||
|
changedField == &wellPath ||
|
||||||
changedField == &simulationWell)
|
changedField == &simulationWell ||
|
||||||
|
changedField == &branchIndex)
|
||||||
{
|
{
|
||||||
m_crossSectionPartMgr = NULL;
|
m_crossSectionPartMgr = NULL;
|
||||||
|
|
||||||
@@ -95,6 +97,15 @@ void RimCrossSection::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
|||||||
rimView->scheduleCreateDisplayModelAndRedraw();
|
rimView->scheduleCreateDisplayModelAndRedraw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (changedField == &simulationWell
|
||||||
|
|| changedField == &isActive
|
||||||
|
|| changedField == &type)
|
||||||
|
{
|
||||||
|
m_wellBranchCenterlines.clear();
|
||||||
|
updateWellCenterline();
|
||||||
|
branchIndex = -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -113,6 +124,11 @@ void RimCrossSection::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
|||||||
else if (type == CS_SIMULATION_WELL)
|
else if (type == CS_SIMULATION_WELL)
|
||||||
{
|
{
|
||||||
uiOrdering.add(&simulationWell);
|
uiOrdering.add(&simulationWell);
|
||||||
|
updateWellCenterline();
|
||||||
|
if (simulationWell() && m_wellBranchCenterlines.size() > 1)
|
||||||
|
{
|
||||||
|
uiOrdering.add(&branchIndex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -168,7 +184,19 @@ QList<caf::PdmOptionItemInfo> RimCrossSection::calculateValueOptions(const caf::
|
|||||||
options.push_front(caf::PdmOptionItemInfo("None", QVariant::fromValue(caf::PdmPointer<caf::PdmObjectHandle>(NULL))));
|
options.push_front(caf::PdmOptionItemInfo("None", QVariant::fromValue(caf::PdmPointer<caf::PdmObjectHandle>(NULL))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (fieldNeedingOptions == &branchIndex)
|
||||||
|
{
|
||||||
|
updateWellCenterline();
|
||||||
|
|
||||||
|
size_t branchCount = m_wellBranchCenterlines.size();
|
||||||
|
|
||||||
|
options.push_back(caf::PdmOptionItemInfo("All", -1));
|
||||||
|
|
||||||
|
for (int bIdx = 0; bIdx < branchCount; ++bIdx)
|
||||||
|
{
|
||||||
|
options.push_back(caf::PdmOptionItemInfo(QString::number(bIdx + 1), QVariant::fromValue(bIdx)));
|
||||||
|
}
|
||||||
|
}
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -221,8 +249,17 @@ std::vector< std::vector <cvf::Vec3d> > RimCrossSection::polyLines() const
|
|||||||
{
|
{
|
||||||
if (simulationWell())
|
if (simulationWell())
|
||||||
{
|
{
|
||||||
std::vector< std::vector <RigWellResultPoint> > pipeBranchesCellIds;
|
updateWellCenterline();
|
||||||
RigSimulationWellCenterLineCalculator::calculateWellPipeCenterline(simulationWell(), lines, pipeBranchesCellIds);
|
|
||||||
|
if (0 <= branchIndex && branchIndex < m_wellBranchCenterlines.size())
|
||||||
|
{
|
||||||
|
lines.push_back(m_wellBranchCenterlines[branchIndex]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (branchIndex == -1)
|
||||||
|
{
|
||||||
|
lines = m_wellBranchCenterlines;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -258,3 +295,23 @@ RivCrossSectionPartMgr* RimCrossSection::crossSectionPartMgr()
|
|||||||
return m_crossSectionPartMgr.p();
|
return m_crossSectionPartMgr.p();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimCrossSection::updateWellCenterline() const
|
||||||
|
{
|
||||||
|
if (isActive() && type == CS_SIMULATION_WELL && simulationWell())
|
||||||
|
{
|
||||||
|
if (m_wellBranchCenterlines.size() == 0)
|
||||||
|
{
|
||||||
|
std::vector< std::vector <RigWellResultPoint> > pipeBranchesCellIds;
|
||||||
|
|
||||||
|
RigSimulationWellCenterLineCalculator::calculateWellPipeCenterline(simulationWell(), m_wellBranchCenterlines, pipeBranchesCellIds);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_wellBranchCenterlines.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ public:
|
|||||||
|
|
||||||
caf::PdmPtrField<RimWellPath*> wellPath;
|
caf::PdmPtrField<RimWellPath*> wellPath;
|
||||||
caf::PdmPtrField<RimEclipseWell*> simulationWell;
|
caf::PdmPtrField<RimEclipseWell*> simulationWell;
|
||||||
|
caf::PdmField<int> branchIndex;
|
||||||
|
|
||||||
std::vector< std::vector <cvf::Vec3d> > polyLines() const;
|
std::vector< std::vector <cvf::Vec3d> > polyLines() const;
|
||||||
|
|
||||||
@@ -83,7 +84,9 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
RimEclipseWellCollection* simulationWellCollection();
|
RimEclipseWellCollection* simulationWellCollection();
|
||||||
|
void updateWellCenterline() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
cvf::ref<RivCrossSectionPartMgr> m_crossSectionPartMgr;
|
cvf::ref<RivCrossSectionPartMgr> m_crossSectionPartMgr;
|
||||||
|
mutable std::vector< std::vector <cvf::Vec3d> > m_wellBranchCenterlines;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user