-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove depreciated VTK function MapDataArrayToMultiTextureAttribute #2291
Conversation
Unfortunately this is incompatible with VTK 5. I know it's super old, but it's still used on Travis. What about this: #if new VTK
const char* tu = mesh.tex_materials[tex_id].tex_name.c_str ();
#else
int tu = VTK_TEXTURE_UNIT_0 + tex_id;
#endif
mapper->MapDataArrayToMultiTextureAttribute(tu,
this_coordinates_name.c_str (),
this_coordinates_name.c_str (),
vtkDataObject::FIELD_ASSOCIATION_POINTS);
vtkDataObject::FIELD_ASSOCIATION_POINTS);
polydata->GetPointData ()->AddArray (coordinates);
polydata->GetPointData ()->AddArray (coordinates);
actor->GetProperty ()->SetTexture (tu, texture);
++tex_id; |
Yeah we can try to add macros to support VTK 5. However, |
Sorry, I did not make it clear, but |
I added |
Please have another look at what I proposed, it is considerably less ugly. The idea is to have a local variable |
@taketwo I actually asked on VTK about how to solve this, and here is his reponse. Kitware/VTK@2f231fb I just force pushed a commit with the code he pasted. Could you take a look and see whether this make sense to you? If you think it is good I will try to add the VTK 5 support onto it. |
I'm fine with the suggestion to drop the "no multi-texturing support" branch. Besides from that, the only thing that is different to your previous attempt is that you now use |
@taketwo Please take a look and see if this is the preferred change. Thanks. |
visualization/src/pcl_visualizer.cpp
Outdated
{ | ||
if ((size_t) 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 (static_cast<int> (mesh.tex_materials.size ()), texture_units); | ||
#if VTK_MAJOR_VERSION > 5 | ||
std::string tu = mesh.tex_materials[0].tex_name.c_str (); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be const char*
? Because this the type that c_str()
returns and also the type that VTK expects? Apart from that looks good.
@taketwo I just fixed the mistake. Please take a look, thanks! |
Why do you create the Also, I've just realized that the |
@taketwo You are right. I just forced push a commit with your suggestion. Please take a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
Hi there, maybe I'm the only one but on my laptop, after this PR the PCL project doesn't compile anymore. I got this error:
I check the prototype of the function in the header virtual void MapDataArrayToMultiTextureAttribute(
int unit,
const char* dataArrayName, int fieldAssociation, int componentno = -1); And in the file
The type of the |
Let's make the version check tighter then, |
I'm pretty far of my laptop these days...
Frozar
Le mer. 16 mai 2018 14:51, Sergey Alexandrov <notifications@github.com> a
écrit :
… Let's make the version check tighter then, #if VTK_MAJOR_VERSION > 8.
Would you mind submitting a PR?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2291 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA-k3JiveEvli8B-moRZtg3m_P0E-rPBks5tzCDCgaJpZM4TrNVL>
.
|
How did you discover the problem?! |
A few hours ago, I have to recompile my project quickly, and I found an
Issue (I'm not a lucky man).
I need to generate some result but currently I'm in holiday...
Le mer. 16 mai 2018 15:14, Sergey Alexandrov <notifications@github.com> a
écrit :
… How did you discover the problem?!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2291 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA-k3Byp9SM9fMBp4BuqhROZATqmJOGlks5tzCY4gaJpZM4TrNVL>
.
|
I see. Well, we have the policy of not merging own pull requests, so I need one of you guys (@jasjuang @frozar) to send a patch, because @SergioRAgostinho is on a... sabbatical. |
No worries. I’ll look at it later today. Just ping me directly whenever you need something more urgent.
…--
On Wednesday, May 16, 2018 at 2:24 PM, Sergey Alexandrov ***@***.*** ***@***.***)> wrote:
I see. Well, we have the policy of not merging own pull requests, so I need one of you guys ***@***.*** (https://github.com/jasjuang) @frozar (https://github.com/frozar)) to send a patch, because @SergioRAgostinho (https://github.com/SergioRAgostinho) is on a... sabbatical.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub (#2291 (comment)), or mute the thread (https://github.com/notifications/unsubscribe-auth/ABoUVssAPWmhjhEpX8WM55QRQAqgdJZwks5tzCh5gaJpZM4TrNVL).
|
Fixes an issue introduced by PointCloudLibrary#2291.
Great, thanks. I've sent a PR. |
fix missing vtkTexture.h, follow up on #2291
Fixes an issue introduced by PointCloudLibrary#2291 and not completely fixed with PointCloudLibrary#2311
VTK removed
MapDataArrayToMultiTextureAttribute
in commit https://gitlab.kitware.com/vtk/vtk/commit/2f231fbd33fd936c23d5b4a375e6a2c542b771d3. This PR uses the newer functions to achieve the same functionality.