#2600 Well CF Visualization: Add picking on connection factor objects

This commit is contained in:
Magne Sjaastad
2018-03-16 15:33:57 +01:00
parent 9656883c92
commit 7bb705b1b7
2 changed files with 62 additions and 1 deletions

View File

@@ -154,6 +154,8 @@ cvf::ref<cvf::DrawableGeo> RivWellConnectionFactorGeometryGenerator::createPipeS
RivWellConnectionFactorGeometryGenerator::createStarGeometry(
&verticesForOneObject, &indicesForOneObject, m_radius, m_radius * 0.3f);
m_trianglesPerConnection = indicesForOneObject.size() / 3;
cvf::ref<cvf::Vec3fArray> vertices = new cvf::Vec3fArray;
cvf::ref<cvf::UIntArray> indices = new cvf::UIntArray;
@@ -195,6 +197,8 @@ cvf::ref<cvf::DrawableGeo> RivWellConnectionFactorGeometryGenerator::createPipeS
//--------------------------------------------------------------------------------------------------
size_t RivWellConnectionFactorGeometryGenerator::globalCellIndexFromTriangleIndex(cvf::uint triangleIndex) const
{
if (m_trianglesPerConnection == 0) return 0;
size_t connectionIndex = triangleIndex / m_trianglesPerConnection;
return m_centerColorPairs[connectionIndex].m_globalCellIndex;