Implemented #310 Result info when picking

This included some refactorization to remove the command stuff out of
RiuViewer,
and to communicate the grid index via the source info struct, and not as
a cvfPart::id
This commit is contained in:
Jacob Støren
2015-06-11 11:38:51 +02:00
parent 24fb7ac584
commit 4f77afe43c
10 changed files with 930 additions and 421 deletions

View File

@@ -120,12 +120,11 @@ void RivGridPartMgr::generatePartGeometry(cvf::StructGridGeometryGenerator& geoB
cvf::ref<cvf::Part> part = new cvf::Part;
part->setName("Grid " + cvf::String(static_cast<int>(m_gridIdx)));
part->setId(m_gridIdx); // !! For now, use grid index as part ID (needed for pick info)
part->setDrawable(geo.p());
part->setTransform(m_scaleTransform.p());
// Set mapping from triangle face index to cell index
cvf::ref<RivSourceInfo> si = new RivSourceInfo;
cvf::ref<RivSourceInfo> si = new RivSourceInfo(m_gridIdx);
si->m_cellFaceFromTriangleMapper = geoBuilder.triangleToCellFaceMapper();
part->setSourceInfo(si.p());