#5379 Surface : Add grid case surface

This commit is contained in:
Magne Sjaastad
2020-05-03 11:29:33 +02:00
parent 4d114e36f8
commit 77734b8b57
15 changed files with 641 additions and 85 deletions

View File

@@ -141,6 +141,7 @@ void RivSurfaceIntersectionGeometryGenerator::calculateArrays()
{
if ( m_triangleVxes->size() ) return;
if ( m_hexGrid.isNull() ) return;
if ( !m_surfaceInView->surface()->surfaceData() ) return;
std::vector<cvf::Vec3f> outputTriangleVertices;
@@ -323,8 +324,6 @@ cvf::ref<cvf::DrawableGeo> RivSurfaceIntersectionGeometryGenerator::generateSurf
{
calculateArrays();
CVF_ASSERT( m_triangleVxes.notNull() );
if ( m_triangleVxes->size() == 0 ) return nullptr;
cvf::ref<cvf::DrawableGeo> geo = new cvf::DrawableGeo;

View File

@@ -377,7 +377,9 @@ void RivSurfacePartMgr::generateNativePartGeometry()
m_surfaceInView->firstAncestorOrThisOfTypeAsserted( ownerCase );
cvf::Vec3d displayModOffsett = ownerCase->displayModelOffset();
m_usedSurfaceData = m_surfaceInView->surface()->surfaceData();
m_usedSurfaceData = m_surfaceInView->surface()->surfaceData();
if ( m_usedSurfaceData.isNull() ) return;
double depthOffset = m_surfaceInView->depthOffset();
displayModOffsett.z() = displayModOffsett.z() + depthOffset;
@@ -413,6 +415,8 @@ void RivSurfacePartMgr::generateNativePartGeometry()
//--------------------------------------------------------------------------------------------------
void RivSurfacePartMgr::generateNativeVertexToCellIndexMap()
{
if ( m_usedSurfaceData.isNull() ) return;
cvf::ref<RivIntersectionHexGridInterface> hexGrid = m_surfaceInView->createHexGridInterface();
const std::vector<cvf::Vec3d>& vertices = m_usedSurfaceData->vertices();