Skip to content

Commit

Permalink
move define VTK version switch to original location
Browse files Browse the repository at this point in the history
  • Loading branch information
greenbrettmichael committed Nov 20, 2018
1 parent 8687c7c commit ddf45e5
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions visualization/src/pcl_visualizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<vtkTexture> texture = vtkSmartPointer<vtkTexture>::New ();
if (textureFromTexMaterial (mesh.tex_materials[tex_id], texture))
{
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit ddf45e5

Please sign in to comment.