Hi, Denial
I want to implement a simple function in my plugin.
When I click my mouse, I want to get the index of the closest point in the cloud. I think there must be some functions in the cloudcompare that I could use, please tell me.
Could you tell me how to get the closest point in cloud when I click my mouse?
-
- Posts: 16
- Joined: Mon Sep 26, 2016 12:46 am
Re: Could you tell me how to get the closest point in cloud when I click my mouse?
You have to use the point picking mechanism. The best way now is to use the 'PickingHub' class (see how it is used in various places in the code: camera parameters dialog, plane edit dialog, etc.).
EDIT: to see how it's integrated in a plugin more specifically, see the QCompass plugin
EDIT: to see how it's integrated in a plugin more specifically, see the QCompass plugin
Daniel, CloudCompare admin
-
- Posts: 16
- Joined: Mon Sep 26, 2016 12:46 am
Re: Could you tell me how to get the closest point in cloud when I click my mouse?
Thanks for your reply, but I am still a little confused.daniel wrote:You have to use the point picking mechanism. The best way now is to use the 'PickingHub' class (see how it is used in various places in the code: camera parameters dialog, plane edit dialog, etc.).
EDIT: to see how it's integrated in a plugin more specifically, see the QCompass plugin
Firstly, I do not see any class called "PickingHub", so did "plane edit dialog". Besides, I find a function called "processPickedItem" in ccCameraParamEditDlg, is it the function that could get the point which is the closest to where my mouse click in cloud or just let me get the point where my mouse click?
Re: Could you tell me how to get the closest point in cloud when I click my mouse?
You have to work on the latest version of the sources (the picking hub and plane edit dialog have been introduced several months ago). Simply pull the head version. This is all the interest of working with git(hub) ;)
Daniel, CloudCompare admin