mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2684 Well CF Visualization: Option to turn off CF visualization on closed connections
This commit is contained in:
@@ -287,34 +287,36 @@ void RivSimWellPipesPartMgr::buildWellPipeParts(const caf::DisplayCoordTransform
|
||||
for (const auto& intersectionInfo : wellPathCellIntersections)
|
||||
{
|
||||
size_t globalCellIndex = intersectionInfo.globCellIndex;
|
||||
const RigWellResultPoint* wResCell = wResFrame.findResultCell(0, globalCellIndex);
|
||||
|
||||
for (const auto& wellResultPoint : pbd.m_cellIds)
|
||||
if (!wResCell || !wResCell->isValid())
|
||||
{
|
||||
if (wellResultPoint.m_gridCellIndex == globalCellIndex)
|
||||
{
|
||||
double startMD = intersectionInfo.startMD;
|
||||
double endMD = intersectionInfo.endMD;
|
||||
continue;
|
||||
}
|
||||
|
||||
double middleMD = (startMD + endMD) / 2.0;
|
||||
if (!virtualPerforationResult->showConnectionFactorsOnClosedConnections() && !wResCell->m_isOpen)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
cvf::Vec3d defaultLocationInDomainCoord = wellPath->interpolatedPointAlongWellPath(middleMD);
|
||||
double startMD = intersectionInfo.startMD;
|
||||
double endMD = intersectionInfo.endMD;
|
||||
|
||||
cvf::Vec3d p1;
|
||||
cvf::Vec3d p2;
|
||||
wellPath->twoClosestPoints(defaultLocationInDomainCoord, &p1, &p2);
|
||||
double middleMD = (startMD + endMD) / 2.0;
|
||||
|
||||
cvf::Vec3d defaultWellPathDirection = (p2 - p1).getNormalized();
|
||||
cvf::Vec3d domainCoord = wellPath->interpolatedPointAlongWellPath(middleMD);
|
||||
|
||||
cvf::Vec3d anchor = displayXf->transformToDisplayCoord(defaultLocationInDomainCoord);;
|
||||
cvf::Vec3d p1;
|
||||
cvf::Vec3d p2;
|
||||
wellPath->twoClosestPoints(domainCoord, &p1, &p2);
|
||||
|
||||
const RigWellResultPoint* wResCell = wResFrame.findResultCell(wellResultPoint.m_gridIndex, wellResultPoint.m_gridCellIndex);
|
||||
if (wResCell && wResCell->isValid())
|
||||
{
|
||||
CompletionVizData data(anchor, defaultWellPathDirection, wResCell->connectionFactor(), globalCellIndex);
|
||||
cvf::Vec3d direction = (p2 - p1).getNormalized();
|
||||
|
||||
completionVizDataItems.push_back(data);
|
||||
}
|
||||
}
|
||||
cvf::Vec3d anchor = displayXf->transformToDisplayCoord(domainCoord);
|
||||
{
|
||||
CompletionVizData data(anchor, direction, wResCell->connectionFactor(), globalCellIndex);
|
||||
|
||||
completionVizDataItems.push_back(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -94,6 +94,17 @@ void RivWellConnectionFactorPartMgr::appendDynamicGeometryPartsToModel(cvf::Mode
|
||||
std::vector<CompletionVizData> completionVizDataItems;
|
||||
for (const auto& cell : conn)
|
||||
{
|
||||
if (!m_virtualPerforationResult->showConnectionFactorsOnClosedConnections())
|
||||
{
|
||||
for (const auto& completion : cell.second)
|
||||
{
|
||||
if (completion.connectionState() == SHUT)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
size_t gridIndex = cell.first.globalCellIndex();
|
||||
|
||||
const RigCell& rigCell = mainGrid->cell(gridIndex);
|
||||
|
@@ -1108,7 +1108,7 @@ void RimEclipseView::updateLegends()
|
||||
}
|
||||
}
|
||||
|
||||
if (m_virtualPerforationResult->isActive() && m_virtualPerforationResult->legendConfig()->showLegend())
|
||||
if (m_virtualPerforationResult->showConnectionFactors() && m_virtualPerforationResult->legendConfig()->showLegend())
|
||||
{
|
||||
updateVirtualConnectionLegendRanges();
|
||||
|
||||
@@ -1433,7 +1433,7 @@ bool RimEclipseView::isVirtualConnectionFactorGeometryVisible() const
|
||||
{
|
||||
if (!m_showWindow()) return false;
|
||||
|
||||
if (!m_virtualPerforationResult->isActive()) return false;
|
||||
if (!m_virtualPerforationResult->showConnectionFactors()) return false;
|
||||
|
||||
// TODO: Consider check if no well paths are visible
|
||||
|
||||
|
@@ -36,7 +36,8 @@ RimVirtualPerforationResults::RimVirtualPerforationResults()
|
||||
CAF_PDM_InitObject(connectionFactorUiName, ":/CellResult.png", "", "");
|
||||
|
||||
CAF_PDM_InitField(&m_isActive, "ShowConnectionFactors", false, "", "", "", "");
|
||||
CAF_PDM_InitField(&m_geometryScaleFactor, "GeometryScaleFactor", 1.0, "Geometry Scale Factor", "", "", "");
|
||||
CAF_PDM_InitField(&m_showClosedConnections, "ShowClosedConnections", true, "Show On Closed Connections", "", "", "");
|
||||
CAF_PDM_InitField(&m_geometryScaleFactor, "GeometryScaleFactor", 2.0, "Geometry Scale Factor", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_legendConfig, "LegendDefinition", "Legend Definition", "", "", "");
|
||||
m_legendConfig.uiCapability()->setUiHidden(true);
|
||||
@@ -55,11 +56,19 @@ RimVirtualPerforationResults::~RimVirtualPerforationResults() {}
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimVirtualPerforationResults::isActive() const
|
||||
bool RimVirtualPerforationResults::showConnectionFactors() const
|
||||
{
|
||||
return m_isActive();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimVirtualPerforationResults::showConnectionFactorsOnClosedConnections() const
|
||||
{
|
||||
return m_showClosedConnections();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -117,24 +126,13 @@ caf::PdmFieldHandle* RimVirtualPerforationResults::objectToggleField()
|
||||
return &m_isActive;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QList<caf::PdmOptionItemInfo> RimVirtualPerforationResults::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
bool* useOptionsOnly)
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
*useOptionsOnly = true;
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimVirtualPerforationResults::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
uiOrdering.add(&m_geometryScaleFactor);
|
||||
uiOrdering.add(&m_showClosedConnections);
|
||||
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
}
|
||||
|
@@ -22,7 +22,6 @@
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
|
||||
#include <vector>
|
||||
|
||||
class RimRegularLegendConfig;
|
||||
@@ -39,21 +38,21 @@ public:
|
||||
RimVirtualPerforationResults();
|
||||
virtual ~RimVirtualPerforationResults();
|
||||
|
||||
bool isActive() const;
|
||||
bool showConnectionFactors() const;
|
||||
bool showConnectionFactorsOnClosedConnections() const;
|
||||
double geometryScaleFactor() const;
|
||||
RimRegularLegendConfig* legendConfig() const;
|
||||
|
||||
void loadData();
|
||||
|
||||
private:
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
virtual caf::PdmFieldHandle* objectToggleField() override;
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
virtual void initAfterRead() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<bool> m_isActive;
|
||||
caf::PdmField<bool> m_showClosedConnections;
|
||||
caf::PdmField<double> m_geometryScaleFactor;
|
||||
|
||||
caf::PdmChildField<RimRegularLegendConfig*> m_legendConfig;
|
||||
|
Reference in New Issue
Block a user