-
-
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
vtkSmartPointer<vtkPolyDataMapper>::New () return NULL #3484
Comments
I solved the problem, you should add the and add the opengl32.lib in the linker |
Are the changes in PCL code or your code? |
vtkSmartPointer textMapper = vtkSmartPointer::New () textMapper is if not |
I'm sorry @liudongminghaha It's still not clear to me. If the change is in PCL, please submit a PR, else the solution so others can benefit from it. |
This problem is usually caused when then VTK definitions are not passed in. It is very likely that this was caused my wrongly constructed CMake file. |
Thanks for your help very much!! it works well as you said.
finally, I could see a 3D text displaying on the screen, that is cool! |
I think @SergioRAgostinho is right. So its not a bug in PCL, but user error when setting projects up. Another vote for better/updated install tutorials. Lets close it. |
Hi, you add these code in which header file? And you add the opennGL in VS linker, how to do that? |
vtkSmartPointer::New () Failed
My Environment
Context
addText3D and addSphere() crashed (maybe more).
When drawing 3d text on screen, I find the addText3D does not work! Then I find the key is
vtkSmartPointer<vtkPolyDataMapper> textMapper = vtkSmartPointer<vtkPolyDataMapper>::New ();
failed. I thought maybe it only crash by this way or my code is wrong. However, It also failed when I try to run example code from test_shapes.cpp.at line 34:
p.addSphere<PointXYZ> (cloud->points[0], 1, 0.0, 1.0, 0.0);
, it crashed again, and I find the reason is same asaddText3D
.New() function always returns NULL, so next linetextMapper->SetInputConnection (textSource->GetOutputPort ());
crashed due to empty pointier.Expected Behavior
Current Behavior
If I do not change
pcl_visualizer.hpp
, It crashed just because of empty pointer.Code to Reproduce
For better understand, below are part of my code:
Possible Solution
Because of the problem of empty pointer, I judge the NULL before next code, like this
The good news is yeah it works, but ... you know, there is no text3d text showing on screen but the text2d is OK(test_shapes.cpp). Now I have no idea how to deal with it.
The text was updated successfully, but these errors were encountered: