From: Jan Rękorajski Date: Thu, 26 Jan 2017 07:44:21 +0000 (+0100) Subject: - one more vtk 7.x fix X-Git-Tag: auto/th/pcl-1.7.2-12~6 X-Git-Url: http://git.pld-linux.org/?a=commitdiff_plain;h=2b7743ff9570fc5800324bea394ab73ccc9d5b7f;hp=7bcf787f7ec2dd91571ce380240f8c8cf43e19ee;p=packages%2Fpcl.git - one more vtk 7.x fix --- diff --git a/pcl.spec b/pcl.spec index ce1495e..fcc40ba 100644 --- a/pcl.spec +++ b/pcl.spec @@ -23,6 +23,7 @@ Patch2: %{name}-openni.patch Patch3: eigen-dependency.patch Patch4: vtk7.patch Patch5: vtk71.patch +Patch6: vtkOpenGL2.patch URL: http://pointclouds.org/ BuildRequires: OpenGL-devel BuildRequires: OpenGL-GLU-devel @@ -116,6 +117,7 @@ Dokumentacja API oraz wprowadzenie do biblioteki PCL. %patch3 -p1 %patch4 -p1 %patch5 -p1 +%patch6 -p1 %build mkdir build diff --git a/vtkOpenGL2.patch b/vtkOpenGL2.patch new file mode 100644 index 0000000..21a2ead --- /dev/null +++ b/vtkOpenGL2.patch @@ -0,0 +1,65 @@ +From 9cfb00970f7d46f1732149d4c50ba3646f038b6c Mon Sep 17 00:00:00 2001 +From: Sergey Alexandrov +Date: Thu, 11 Feb 2016 22:19:01 +0100 +Subject: [PATCH] Use vtkTextureUnitManager to query the number of available + texture units + +The new OpenGL2 backend does not have vktOpenGLHardwareSupport class +which was used before. +--- + visualization/src/pcl_visualizer.cpp | 15 +++++++-------- + 1 file changed, 7 insertions(+), 8 deletions(-) + +diff --git a/visualization/src/pcl_visualizer.cpp b/visualization/src/pcl_visualizer.cpp +index dc91674..007c251 100644 +--- a/visualization/src/pcl_visualizer.cpp ++++ b/visualization/src/pcl_visualizer.cpp +@@ -84,7 +84,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -92,6 +91,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -3223,17 +3223,18 @@ pcl::visualization::PCLVisualizer::addTextureMesh (const pcl::TextureMesh &mesh, + #endif + + vtkSmartPointer actor = vtkSmartPointer::New (); +- vtkOpenGLHardwareSupport* hardware = vtkOpenGLRenderWindow::SafeDownCast (win_)->GetHardwareSupport (); ++ vtkTextureUnitManager* tex_manager = vtkOpenGLRenderWindow::SafeDownCast (win_)->GetTextureUnitManager (); ++ if (!tex_manager) ++ return (false); +- bool supported = hardware->GetSupportsMultiTexturing (); + // Check if hardware support multi texture +- std::size_t texture_units (hardware->GetNumberOfFixedTextureUnits ()); +- if ((mesh.tex_materials.size () > 1) && supported && (texture_units > 1)) ++ int texture_units = tex_manager->GetNumberOfTextureUnits (); ++ if ((mesh.tex_materials.size () > 1) && (texture_units > 1)) + { + if (texture_units < mesh.tex_materials.size ()) + PCL_WARN ("[PCLVisualizer::addTextureMesh] GPU texture units %d < mesh textures %d!\n", + texture_units, mesh.tex_materials.size ()); + // Load textures +- std::size_t last_tex_id = std::min (mesh.tex_materials.size (), texture_units); ++ std::size_t last_tex_id = std::min (static_cast (mesh.tex_materials.size ()), texture_units); + int tu = vtkProperty::VTK_TEXTURE_UNIT_0; + std::size_t tex_id = 0; + while (tex_id < last_tex_id) +@@ -3279,7 +3278,7 @@ pcl::visualization::PCLVisualizer::addTextureMesh (const pcl::TextureMesh &mesh, + } // end of multi texturing + else + { +- if (!supported || texture_units < 2) ++ if ((mesh.tex_materials.size () > 1) && (texture_units < 2)) + PCL_WARN ("[PCLVisualizer::addTextureMesh] Your GPU doesn't support multi texturing. " + "Will use first one only!\n"); +