From ddf45e5e20e5ba5d09198dd2958991918c0d6903 Mon Sep 17 00:00:00 2001 From: green_machine Date: Tue, 20 Nov 2018 08:53:49 -0500 Subject: [PATCH] move define VTK version switch to original location --- visualization/src/pcl_visualizer.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/visualization/src/pcl_visualizer.cpp b/visualization/src/pcl_visualizer.cpp index 0f17513a4f3..a0b881e9b4d 100644 --- a/visualization/src/pcl_visualizer.cpp +++ b/visualization/src/pcl_visualizer.cpp @@ -3528,7 +3528,11 @@ pcl::visualization::PCLVisualizer::addTextureMesh (const pcl::TextureMesh &mesh, std::size_t tex_id = 0; while (tex_id < last_tex_id) { +#if (VTK_MAJOR_VERSION == 8 && VTK_MINOR_VERSION >= 2) || VTK_MAJOR_VERSION > 8 + const char *tu = mesh.tex_materials[tex_id].tex_name.c_str(); +#else int tu = vtkProperty::VTK_TEXTURE_UNIT_0 + tex_id; +#endif vtkSmartPointer texture = vtkSmartPointer::New (); if (textureFromTexMaterial (mesh.tex_materials[tex_id], texture)) { @@ -3556,15 +3560,9 @@ pcl::visualization::PCLVisualizer::addTextureMesh (const pcl::TextureMesh &mesh, else for (std::size_t tc = 0; tc < mesh.tex_coordinates[t].size (); ++tc) coordinates->InsertNextTuple2 (-1.0, -1.0); -#if (VTK_MAJOR_VERSION == 8 && VTK_MINOR_VERSION >= 2) || VTK_MAJOR_VERSION > 8 - mapper->MapDataArrayToMultiTextureAttribute(mesh.tex_materials[tex_id].tex_name.c_str(), - this_coordinates_name.c_str(), - vtkDataObject::FIELD_ASSOCIATION_POINTS); -#else mapper->MapDataArrayToMultiTextureAttribute(tu, this_coordinates_name.c_str(), vtkDataObject::FIELD_ASSOCIATION_POINTS); -#endif polydata->GetPointData ()->AddArray (coordinates); actor->GetProperty ()->SetTexture (tu, texture);