void mouseEventOccurred (const pcl::visualization::MouseEvent &event, void* viewer_void) { boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer = *static_cast<boost::shared_ptr<pcl::visualization::PCLVisualizer> *> (viewer_void); if (event.getButton () == pcl::visualization::MouseEvent::LeftButton && event.getType () == pcl::visualization::MouseEvent::MouseButtonRelease) { std::cout << "Left mouse button released at position (" << event.getX () << ", " << event.getY () << ")" << std::endl; char str[512]; sprintf (str, "text#%03d", text_id ++); viewer->addText ("clicked here", event.getX (), event.getY (), str); } }
void mouse_callback (const pcl::visualization::MouseEvent& mouse_event, void* cookie) { string* message = (string*) cookie; if (mouse_event.getType() == pcl::visualization::MouseEvent::MouseButtonPress && mouse_event.getButton() == pcl::visualization::MouseEvent::LeftButton) { cout << (*message) << " :: " << mouse_event.getX () << " , " << mouse_event.getY () << endl; } }
void mouse_callback (const pcl::visualization::MouseEvent& mouse_event, void*) { if (mouse_event.getType () == pcl::visualization::MouseEvent::MouseButtonPress && mouse_event.getButton () == pcl::visualization::MouseEvent::LeftButton) { cout << "left button pressed @ " << mouse_event.getX () << " , " << mouse_event.getY () << endl; } }
void mouseEventOccurred (const pcl::visualization::MouseEvent &event, void* viewer_void) { pcl::visualization::PCLVisualizer *viewer = static_cast<pcl::visualization::PCLVisualizer*> (viewer_void); if (event.getButton () == pcl::visualization::MouseEvent::LeftButton && event.getType () == pcl::visualization::MouseEvent::MouseButtonRelease) { std::cout << "Left mouse button released at position (" << event.getX () << ", " << event.getY () << ")" << std::endl; //char str[512]; //viewer->addText ("clicked here", event.getX (), event.getY (), str); } }
void mouseCallback(const pcl::visualization::MouseEvent &mouse_event, void *) { if (mouse_event.getType() == pcl::visualization::MouseEvent::MouseButtonPress && mouse_event.getButton() == pcl::visualization::MouseEvent::LeftButton) { Logger::log(Logger::INFO, "Left button pressed @ (%i, %i).\n", mouse_event.getX(), mouse_event.getY()); } }