From 2a683ec3efedbce2c976b0427e3104940d26f0fd Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Wed, 17 Mar 2021 12:10:34 +0100 Subject: [PATCH] img_patch_param: fix error when passing double data with GL_FLOAT --- .../VisibilityCheck.cpp | 20 ++++++++++--------- .../filter_img_patch_param/VisibleSet.cpp | 8 ++++---- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/meshlabplugins/filter_img_patch_param/VisibilityCheck.cpp b/src/meshlabplugins/filter_img_patch_param/VisibilityCheck.cpp index 6ceeee252..2e011faaa 100644 --- a/src/meshlabplugins/filter_img_patch_param/VisibilityCheck.cpp +++ b/src/meshlabplugins/filter_img_patch_param/VisibilityCheck.cpp @@ -29,15 +29,17 @@ VisibilityCheck* VisibilityCheck::s_Instance = NULL; VisibilityCheck* VisibilityCheck::GetInstance( glw::Context &ctx ) { - if( !s_Instance ) - { - if( VisibilityCheck_ShadowMap::isSupported() ) - s_Instance = new VisibilityCheck_ShadowMap( ctx ); - else if( VisibilityCheck_VMV2002::isSupported() ) - s_Instance = new VisibilityCheck_VMV2002( ctx ); - } + if( !s_Instance ) + { + if( VisibilityCheck_ShadowMap::isSupported() ){ + s_Instance = new VisibilityCheck_ShadowMap( ctx ); + } + else if( VisibilityCheck_VMV2002::isSupported() ){ + s_Instance = new VisibilityCheck_VMV2002( ctx ); + } + } - return s_Instance; + return s_Instance; } @@ -450,7 +452,7 @@ void VisibilityCheck_ShadowMap::initMeshTextures() { // Creates a first OpenGL texture into which normal vectors at each mesh vertex are stored. int mapH = (int) std::ceil( m_Mesh->vn / 2048.0f ); - Point3m *mapData = new Point3m [ 2048*mapH ]; + vcg::Point3f *mapData = new vcg::Point3f [ 2048*mapH ]; for( int i=0; ivn; ++i ) mapData[i] = m_Mesh->vert[i].N(); diff --git a/src/meshlabplugins/filter_img_patch_param/VisibleSet.cpp b/src/meshlabplugins/filter_img_patch_param/VisibleSet.cpp index 4c9cdc401..8245cd284 100644 --- a/src/meshlabplugins/filter_img_patch_param/VisibleSet.cpp +++ b/src/meshlabplugins/filter_img_patch_param/VisibleSet.cpp @@ -66,18 +66,18 @@ VisibleSet::VisibleSet( m_DepthRangeInv = 1.0f / (m_DepthMax-depthMin); - foreach( RasterModel *rm, rasterList ) + for( RasterModel *rm : qAsConst(rasterList)) { visibility.setRaster( rm ); visibility.checkVisibility(); - for( int f=0; f= 0.0f ) m_FaceVis[f].add( w, rm ); } + } } VisibilityCheck::ReleaseInstance();