예제 #1
0
void mouse_callback (const pcl::visualization::MouseEvent& mouse_event, void* cookie)
{
  std::string* message = static_cast<std::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;
  }
}
예제 #2
0
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);
    }
}
예제 #3
0
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);
  }
}
예제 #4
0
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)
  {
    //TF Begin cutomization to print out xyz of point

    //Scrapping this event structure and going to the pp_callback

   //End TF customization
  }
}
예제 #5
0
파일: pcltest.cpp 프로젝트: zehdeh/pcl_test
void mouseEventOccurred(const pcl::visualization::MouseEvent &event, void* viewer_void) {
	if(event.getButton() == pcl::visualization::MouseEvent::RightButton && event.getType() == pcl::visualization::MouseEvent::MouseButtonRelease) {
		boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer = *static_cast<boost::shared_ptr<pcl::visualization::PCLVisualizer> *> (viewer_void);
		std::cout << "Right mouse button released!" << std::endl;

		viewer->removeAllPointClouds();
		if(displayFiltered) {
			viewer->addPointCloud<pcl::PointNormal>(input, "sample cloud");
			viewer->addPointCloudNormals<pcl::PointNormal, pcl::PointNormal>(input,input,1,2.0f);
		} else {
			viewer->addPointCloud<pcl::PointNormal>(demeaned, "sample cloud");
			viewer->addPointCloudNormals<pcl::PointNormal, pcl::PointNormal>(demeaned,demeaned,1,2.0f);
		}
		displayFiltered = !displayFiltered;
	}
}
예제 #6
0
 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;
   }
 }
예제 #7
0
 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)
   {
     trigger_ = true;
   }
 }
 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());
     }
 }