{"action":"created","issue":{"url":"https://api.github.com/repos/PointCloudLibrary/pcl/issues/1149","labels_url":"https://api.github.com/repos/PointCloudLibrary/pcl/issues/1149/labels{/name}","comments_url":"https://api.github.com/repos/PointCloudLibrary/pcl/issues/1149/comments","events_url":"https://api.github.com/repos/PointCloudLibrary/pcl/issues/1149/events","html_url":"https://github.com/PointCloudLibrary/pcl/issues/1149","id":57437944,"number":1149,"title":"Point index is specified regardless to Point Cloud id in PCLVisualizer Picking events","user":{"login":"mshafiei","id":234477,"avatar_url":"https://avatars.githubusercontent.com/u/234477?v=3","gravatar_id":"","url":"https://api.github.com/users/mshafiei","html_url":"https://github.com/mshafiei","followers_url":"https://api.github.com/users/mshafiei/followers","following_url":"https://api.github.com/users/mshafiei/following{/other_user}","gists_url":"https://api.github.com/users/mshafiei/gists{/gist_id}","starred_url":"https://api.github.com/users/mshafiei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mshafiei/subscriptions","organizations_url":"https://api.github.com/users/mshafiei/orgs","repos_url":"https://api.github.com/users/mshafiei/repos","events_url":"https://api.github.com/users/mshafiei/events{/privacy}","received_events_url":"https://api.github.com/users/mshafiei/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-12T09:47:16Z","updated_at":"2015-02-12T15:38:20Z","closed_at":null,"body":"Brief:\r\n   When you have two or more point clouds in PCLVisualizer, and assign point picking callback function, you cannot tell the point cloud ID when the event has occured.\r\n\r\nReproduce:\r\n   Running the code below, picking a point from each point cloud, gives you the index between 0-n (n = number of points in the corresponding point cloud).\r\n\r\nSuggestion:\r\n   The problem will be solved if there would a getter in PointPickingEvent returning the ID of corresponding point cloud of the picked point.\r\n\r\nTest Case:\r\n```c++\r\n#include <pcl/visualization/pcl_visualizer.h>\r\n#include <pcl/pcl_base.h>\r\n#include <iostream>\r\n#include <Windows.h>\r\nusing namespace std;\r\nusing namespace pcl;\r\n\r\ntypedef pcl::PointXYZRGBA PointT;\r\ntypedef pcl::PointCloud<PointT> CloudT;\r\ntypedef CloudT::Ptr ptrCloudT;\r\n\r\n\r\nvoid PointSelection_callback(const pcl::visualization::PointPickingEvent &event, void*)\r\n{\r\n    cout << \" point index: \" << event.getPointIndex() << endl;\r\n}\r\n\r\nptrCloudT GeneratePlanePointCloudXWithShift(int NumberOfPoints, float EdgeLength, int XShift)\r\n{\r\n    ptrCloudT Surface(new CloudT);\r\n    int len = sqrt(NumberOfPoints);\r\n    float step = EdgeLength / len;\r\n    for (float x = 0; x < EdgeLength; x += step)\r\n        for (float y = 0; y < EdgeLength; y += step)\r\n        {\r\n            PointT p;\r\n            p.x = x + XShift; p.y = y;\r\n            p.r = 255; p.g = 255; p.b = 255; p.a = 0;\r\n            Surface->insert(Surface->end(), p);\r\n        }\r\n\r\n    return Surface;\r\n}\r\n\r\n\r\nint main()\r\n{\r\n    pcl::visualization::PCLVisualizer::Ptr m_PCLVisualization(new pcl::visualization::PCLVisualizer(\"view\", true));\r\n    m_PCLVisualization->registerPointPickingCallback(PointSelection_callback);\r\n    ptrCloudT cloud = GeneratePlanePointCloudXWithShift(1000, 10,0);\r\n    ptrCloudT ShiftedCloud = GeneratePlanePointCloudXWithShift(1000, 10,40);\r\n    \r\n    m_PCLVisualization->addPointCloud(cloud,\"Cloud1\"); \r\n    m_PCLVisualization->addPointCloud(ShiftedCloud, \"Cloud2\");\r\n    m_PCLVisualization->spin();\r\n}\r\n```\r\nReported on [the mailing list] (http://www.pcl-users.org/Point-picking-from-two-point-clouds-in-PCLVisualizer-td4036575.html)"},"comment":{"url":"https://api.github.com/repos/PointCloudLibrary/pcl/issues/comments/74091361","html_url":"https://github.com/PointCloudLibrary/pcl/issues/1149#issuecomment-74091361","issue_url":"https://api.github.com/repos/PointCloudLibrary/pcl/issues/1149","id":74091361,"user":{"login":"taketwo","id":1241736,"avatar_url":"https://avatars.githubusercontent.com/u/1241736?v=3","gravatar_id":"","url":"https://api.github.com/users/taketwo","html_url":"https://github.com/taketwo","followers_url":"https://api.github.com/users/taketwo/followers","following_url":"https://api.github.com/users/taketwo/following{/other_user}","gists_url":"https://api.github.com/users/taketwo/gists{/gist_id}","starred_url":"https://api.github.com/users/taketwo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taketwo/subscriptions","organizations_url":"https://api.github.com/users/taketwo/orgs","repos_url":"https://api.github.com/users/taketwo/repos","events_url":"https://api.github.com/users/taketwo/events{/privacy}","received_events_url":"https://api.github.com/users/taketwo/received_events","type":"User","site_admin":false},"created_at":"2015-02-12T15:38:20Z","updated_at":"2015-02-12T15:38:20Z","body":"Hi, I think everyone who used point picking with several clouds displayed will agree that providing IDs of picked clouds would be a really valuable addition to PCL. Therefore I will be happy to merge a pull request if you find a good way to implement it. As for the proposals, I think that we should definitely go with returning ID strings."}}