Hello.
I'm building a plugin. I'm going to save and load the picked points using this plugin.
The information for a picked point must be only x, y, z. And the plugin should load the x, y, z info and show the saved points on the scene.
I can get the x, y, z of the picked points when save, but I cannot get the point from the x, y, z value when load.
If I save the point index with x, y, z, I can correctly load and show the saved point, but I mustn't save point index.
Please help me!
Thanks a lot!
Save/Load picked points
Re: Save/Load picked points
Do you mean that you want to find a point in a cloud knowing its 3 coordinates but not its index?but I cannot get the point from the x, y, z value when load
Either you make a brute-force comparison on all the points (with OpenMP in addition, it can be pretty quick). Just be sure to allow for some inaccuracies in the coordinates if you load them from a file.
Another option is to rely on the octree (with the 'closest point' determination algorithm). It may be worth the cost if you want to do that multiple times.
Daniel, CloudCompare admin
-
- Posts: 8
- Joined: Thu Mar 19, 2020 7:21 am
Re: Save/Load picked points
Thanks for your quick reply!
But seems OpenMP is a good option. I'm using 2.10.2(current stable version) source code.
How I can enable the OpenMP in it? And can you let me know the correct class or function to get the point index from x, y, z?
And I'm going to get 10~20 point indexes from those x, y, z. So will it be worth the cost? And which kind of cost do you mean?
Sorry for bothering you! Thanks again, Daniel!
Exactly! My main goal is to get point index from x,y,z.
brute-force comparison is not a good option for my goal I think.
But seems OpenMP is a good option. I'm using 2.10.2(current stable version) source code.
How I can enable the OpenMP in it? And can you let me know the correct class or function to get the point index from x, y, z?
Sorry but I don't know how to use the 'closest point' determination algorithm in octree. Can you let me know the correct class or function?
And I'm going to get 10~20 point indexes from those x, y, z. So will it be worth the cost? And which kind of cost do you mean?
Sorry for bothering you! Thanks again, Daniel!
Re: Save/Load picked points
Brute force might be surprisingly fast sometimes... and OpenMP is just a simply way to make this brute force comparison faster by making the computation parallel (see "#pragma pmp" in the code).
And why are you using the 2.10 code and not the latest version? (master branch)
And the octree function you can use is 'DgmOctree::findPointNeighbourhood'. See how it's used in the Canupo or Compass plugins (their sources are on the main repository as well).
And why are you using the 2.10 code and not the latest version? (master branch)
And the octree function you can use is 'DgmOctree::findPointNeighbourhood'. See how it's used in the Canupo or Compass plugins (their sources are on the main repository as well).
Daniel, CloudCompare admin
-
- Posts: 8
- Joined: Thu Mar 19, 2020 7:21 am
Re: Save/Load picked points
Thanks a lot, Daniel!
I've solved this problem using the Compass plugin source.
I really appreciate for your help. Regards!
I've solved this problem using the Compass plugin source.
I really appreciate for your help. Regards!
-
- Posts: 8
- Joined: Thu Mar 19, 2020 7:21 am
Re: Save/Load picked points
One more question!
Can I change the color of picked points?
That is, the color of firstly picked point is default color and the second is red, third is green....
How can I change the color per point?
Can I change the color of picked points?
That is, the color of firstly picked point is default color and the second is red, third is green....
How can I change the color per point?
Re: Save/Load picked points
You have to first initialize (resize) the set of RGB colors if the cloud doesn't have colors yet (ccPointCloud::resizeTheRGBTable).
Then set each point color (ccPointCloud::setPointColor).
Another option is to use a scalar field (but controlling the colors may be more tricky).
Then set each point color (ccPointCloud::setPointColor).
Another option is to use a scalar field (but controlling the colors may be more tricky).
Daniel, CloudCompare admin
-
- Posts: 8
- Joined: Thu Mar 19, 2020 7:21 am
Re: Save/Load picked points
Sorry for my bad writing. The point I wrote was not the point of point cloud, but the mark of selected point.
Re: Save/Load picked points
Ah! Then currently I don't think it's possible to change it.
You would have to change the 'label' code slightly (but this contribution would probably be welcome!)
You would have to change the 'label' code slightly (but this contribution would probably be welcome!)
Daniel, CloudCompare admin
-
- Posts: 8
- Joined: Thu Mar 19, 2020 7:21 am
Re: Save/Load picked points
I see. I'll try more by myself.
Thanks anyway.
Thanks anyway.