mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Well cell transparency: Turned off well cell transparency when no well pipe is visible.
For results visulaization, cell edge and faults faces. Not yet done for visualization without result colors. p4#: 21462
This commit is contained in:
@@ -136,6 +136,7 @@ void RigCaseData::computeWellCellsPrGrid()
|
||||
// Allocate and initialize the arrays
|
||||
|
||||
m_wellCellsInGrid.resize(grids.size());
|
||||
m_gridCellToWellIndex.resize(grids.size());
|
||||
|
||||
for (gIdx = 0; gIdx < grids.size(); ++gIdx)
|
||||
{
|
||||
@@ -144,8 +145,11 @@ void RigCaseData::computeWellCellsPrGrid()
|
||||
m_wellCellsInGrid[gIdx] = new cvf::UByteArray;
|
||||
m_wellCellsInGrid[gIdx]->resize(grids[gIdx]->cellCount());
|
||||
|
||||
m_gridCellToWellIndex[gIdx] = new cvf::UIntArray;
|
||||
m_gridCellToWellIndex[gIdx]->resize(grids[gIdx]->cellCount());
|
||||
}
|
||||
m_wellCellsInGrid[gIdx]->setAll(false);
|
||||
m_gridCellToWellIndex[gIdx]->setAll(cvf::UNDEFINED_UINT);
|
||||
}
|
||||
|
||||
// Fill arrays with data
|
||||
@@ -162,6 +166,7 @@ void RigCaseData::computeWellCellsPrGrid()
|
||||
|
||||
CVF_ASSERT(gridIndex < m_wellCellsInGrid.size() && gridCellIndex < m_wellCellsInGrid[gridIndex]->size());
|
||||
m_wellCellsInGrid[gridIndex]->set(gridCellIndex, true);
|
||||
m_gridCellToWellIndex[gridIndex]->set(gridCellIndex, static_cast<cvf::uint>(wIdx));
|
||||
|
||||
size_t sIdx;
|
||||
for (sIdx = 0; sIdx < wellCells.m_wellResultBranches.size(); ++sIdx)
|
||||
@@ -176,6 +181,7 @@ void RigCaseData::computeWellCellsPrGrid()
|
||||
CVF_ASSERT(gridIndex < m_wellCellsInGrid.size() && gridCellIndex < m_wellCellsInGrid[gridIndex]->size());
|
||||
|
||||
m_wellCellsInGrid[gridIndex]->set(gridCellIndex, true);
|
||||
m_gridCellToWellIndex[gridIndex]->set(gridCellIndex, static_cast<cvf::uint>(wIdx));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -189,6 +195,8 @@ void RigCaseData::setWellResults(const cvf::Collection<RigSingleWellResultsData>
|
||||
{
|
||||
m_wellResults = data;
|
||||
m_wellCellsInGrid.clear();
|
||||
m_gridCellToWellIndex.clear();
|
||||
|
||||
computeWellCellsPrGrid();
|
||||
}
|
||||
|
||||
@@ -203,6 +211,18 @@ cvf::UByteArray* RigCaseData::wellCellsInGrid(size_t gridIndex)
|
||||
return m_wellCellsInGrid[gridIndex].p();
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::UIntArray* RigCaseData::gridCellToWellIndex(size_t gridIndex)
|
||||
{
|
||||
computeWellCellsPrGrid();
|
||||
CVF_ASSERT(gridIndex < m_gridCellToWellIndex.size());
|
||||
|
||||
return m_gridCellToWellIndex[gridIndex].p();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -63,6 +63,7 @@ public:
|
||||
const cvf::Collection<RigSingleWellResultsData>& wellResults() { return m_wellResults; }
|
||||
|
||||
cvf::UByteArray* wellCellsInGrid(size_t gridIndex);
|
||||
cvf::UIntArray* gridCellToWellIndex(size_t gridIndex);
|
||||
|
||||
RigCell& cellFromWellResultCell(const RigWellResultCell& wellResultCell);
|
||||
bool findSharedSourceFace(cvf::StructGridInterface::FaceType& sharedSourceFace, const RigWellResultCell& sourceWellCellResult, const RigWellResultCell& otherWellCellResult) const;
|
||||
@@ -73,7 +74,6 @@ private:
|
||||
void computeActiveCellIJKBBox();
|
||||
void computeWellCellsPrGrid();
|
||||
void computeActiveCellsGeometryBoundingBox();
|
||||
|
||||
private:
|
||||
cvf::ref<RigMainGrid> m_mainGrid;
|
||||
|
||||
@@ -85,4 +85,5 @@ private:
|
||||
|
||||
cvf::Collection<RigSingleWellResultsData> m_wellResults; //< A WellResults object for each well in the reservoir
|
||||
cvf::Collection<cvf::UByteArray> m_wellCellsInGrid; //< A bool array pr grid with one bool pr cell telling wether the cell is a well cell or not
|
||||
cvf::Collection<cvf::UIntArray> m_gridCellToWellIndex; //< Array pr grid with index to well pr cell telling which well a cell is in
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user