mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2600 Well CF Visualization: Make sure all connections are visualized
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
RivWellConnectionFactorGeometryGenerator::RivWellConnectionFactorGeometryGenerator(
|
||||
std::vector<CompletionVizData>& centerColorPairs,
|
||||
float radius)
|
||||
: m_centerColorPairs(centerColorPairs)
|
||||
: m_completionVizData(centerColorPairs)
|
||||
, m_radius(radius)
|
||||
, m_trianglesPerConnection(0)
|
||||
{
|
||||
@@ -55,12 +55,12 @@ cvf::ref<cvf::DrawableGeo> RivWellConnectionFactorGeometryGenerator::createSurfa
|
||||
cvf::ref<cvf::Vec3fArray> vertices = new cvf::Vec3fArray;
|
||||
cvf::ref<cvf::UIntArray> indices = new cvf::UIntArray;
|
||||
|
||||
auto indexCount = m_centerColorPairs.size() * indicesForOneObject.size();
|
||||
auto vertexCount = m_centerColorPairs.size() * verticesForOneObject.size();
|
||||
auto indexCount = m_completionVizData.size() * indicesForOneObject.size();
|
||||
auto vertexCount = m_completionVizData.size() * verticesForOneObject.size();
|
||||
indices->reserve(indexCount);
|
||||
vertices->reserve(vertexCount);
|
||||
|
||||
for (const auto& item : m_centerColorPairs)
|
||||
for (const auto& item : m_completionVizData)
|
||||
{
|
||||
auto rotMatrix = rotationMatrixBetweenVectors(cvf::Vec3d::Y_AXIS, item.m_direction);
|
||||
|
||||
@@ -88,16 +88,36 @@ cvf::ref<cvf::DrawableGeo> RivWellConnectionFactorGeometryGenerator::createSurfa
|
||||
return drawable;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RivWellConnectionFactorGeometryGenerator::connectionFactor(cvf::uint triangleIndex) const
|
||||
{
|
||||
size_t connectionIndex = mapFromTriangleToConnectionIndex(triangleIndex);
|
||||
|
||||
return m_completionVizData[connectionIndex].m_connectionFactor;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RivWellConnectionFactorGeometryGenerator::globalCellIndexFromTriangleIndex(cvf::uint triangleIndex) const
|
||||
{
|
||||
size_t connectionIndex = mapFromTriangleToConnectionIndex(triangleIndex);
|
||||
|
||||
return m_completionVizData[connectionIndex].m_globalCellIndex;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RivWellConnectionFactorGeometryGenerator::mapFromTriangleToConnectionIndex(cvf::uint triangleIndex) const
|
||||
{
|
||||
if (m_trianglesPerConnection == 0) return 0;
|
||||
|
||||
size_t connectionIndex = triangleIndex / m_trianglesPerConnection;
|
||||
|
||||
return m_centerColorPairs[connectionIndex].m_globalCellIndex;
|
||||
return connectionIndex;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user