Skip to content

Commit

Permalink
Merge pull request #2612 from greenbrettmichael/vtk_patch
Browse files Browse the repository at this point in the history
address conflict between visualization and VTK head
  • Loading branch information
SergioRAgostinho authored Nov 21, 2018
2 parents daa671e + ddf45e5 commit ce08586
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions visualization/src/pcl_visualizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3528,12 +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 < 9
int tu = vtkProperty::VTK_TEXTURE_UNIT_0 + 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
const char *tu = mesh.tex_materials[tex_id].tex_name.c_str ();
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 @@ -3561,10 +3560,10 @@ 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);

mapper->MapDataArrayToMultiTextureAttribute(tu,
this_coordinates_name.c_str (),
vtkDataObject::FIELD_ASSOCIATION_POINTS);
this_coordinates_name.c_str(),
vtkDataObject::FIELD_ASSOCIATION_POINTS);

polydata->GetPointData ()->AddArray (coordinates);
actor->GetProperty ()->SetTexture (tu, texture);
++tex_id;
Expand Down

0 comments on commit ce08586

Please sign in to comment.