]> git.pld-linux.org Git - packages/pcl.git/commitdiff
- one more vtk 7.x fix
authorJan Rękorajski <baggins@pld-linux.org>
Thu, 26 Jan 2017 07:44:21 +0000 (08:44 +0100)
committerJan Rękorajski <baggins@pld-linux.org>
Thu, 26 Jan 2017 07:44:21 +0000 (08:44 +0100)
pcl.spec
vtkOpenGL2.patch [new file with mode: 0644]

index ce1495e7d541d929e05cb40938fa85d18d1478e0..fcc40bad36382728be9c8a17605668682c4a4ff0 100644 (file)
--- 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 (file)
index 0000000..21a2ead
--- /dev/null
@@ -0,0 +1,65 @@
+From 9cfb00970f7d46f1732149d4c50ba3646f038b6c Mon Sep 17 00:00:00 2001
+From: Sergey Alexandrov <alexandrov88@gmail.com>
+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 <vtkRenderWindowInteractor.h>
+ #include <vtkAreaPicker.h>
+ #include <vtkXYPlotActor.h>
+-#include <vtkOpenGLHardwareSupport.h>
+ #include <vtkOpenGLRenderWindow.h>
+ #include <vtkJPEGReader.h>
+ #include <vtkBMPReader.h>
+@@ -92,6 +91,7 @@
+ #include <vtkPNMReader.h>
+ #include <vtkPNGReader.h>
+ #include <vtkTIFFReader.h>
++#include <vtkTextureUnitManager.h>
+ #include <pcl/visualization/common/shapes.h>
+ #include <pcl/visualization/pcl_visualizer.h>
+@@ -3223,17 +3223,18 @@ pcl::visualization::PCLVisualizer::addTextureMesh (const pcl::TextureMesh &mesh,
+ #endif
+   vtkSmartPointer<vtkLODActor> actor = vtkSmartPointer<vtkLODActor>::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<int> (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");
This page took 0.20389 seconds and 4 git commands to generate.