diff --git a/doc/tutorials/content/sources/pcl_visualizer/pcl_visualizer_demo.cpp b/doc/tutorials/content/sources/pcl_visualizer/pcl_visualizer_demo.cpp index 25c3a4c2ec8..200cc36d923 100644 --- a/doc/tutorials/content/sources/pcl_visualizer/pcl_visualizer_demo.cpp +++ b/doc/tutorials/content/sources/pcl_visualizer/pcl_visualizer_demo.cpp @@ -177,7 +177,7 @@ unsigned int text_id = 0; void keyboardEventOccurred (const pcl::visualization::KeyboardEvent &event, void* viewer_void) { - boost::shared_ptr viewer = *static_cast *> (viewer_void); + pcl::visualization::PCLVisualizer *viewer = static_cast (viewer_void); if (event.getKeySym () == "r" && event.keyDown ()) { std::cout << "r was pressed => removing all text" << std::endl; @@ -195,7 +195,7 @@ void keyboardEventOccurred (const pcl::visualization::KeyboardEvent &event, void mouseEventOccurred (const pcl::visualization::MouseEvent &event, void* viewer_void) { - boost::shared_ptr viewer = *static_cast *> (viewer_void); + pcl::visualization::PCLVisualizer *viewer = static_cast (viewer_void); if (event.getButton () == pcl::visualization::MouseEvent::LeftButton && event.getType () == pcl::visualization::MouseEvent::MouseButtonRelease) { @@ -213,8 +213,8 @@ boost::shared_ptr interactionCustomizationVis viewer->setBackgroundColor (0, 0, 0); viewer->addCoordinateSystem (1.0); - viewer->registerKeyboardCallback (keyboardEventOccurred, (void*)&viewer); - viewer->registerMouseCallback (mouseEventOccurred, (void*)&viewer); + viewer->registerKeyboardCallback (keyboardEventOccurred, (void*)viewer.get ()); + viewer->registerMouseCallback (mouseEventOccurred, (void*)viewer.get ()); return (viewer); }