DgmOctree methods in QtParallelMap
Posted: Fri Dec 14, 2018 3:45 pm
Hi,
I'm writing a plugin for CC to calculate some local cloud parameters along a 3D surface.
For that I sample the surface, then query the octree at each sampled point to get cylindrical neighbourhood (using DgmOctree::getPointsInCylindricalNeighbourhood) along the normal of the surface at the point. Then calculate local parameters as a function of returned points.
The algorithm works as intended, but is expectedly slow. So I'm trying to reimplement it using QtConcurrent::mapped and getting very strange results: most of the getPointsInCylindricalNeighbourhood calls return 0 points.
From this I suspect that calls use some shared state inside the octree; but hard as I try (reading DgmOctree code), I cannot figure out what it is and how to circumvent it, if at all possible.
So my questions are:
1) why getPointsInCylindricalNeighbourhood works incorrectly in parallel execution?
2) is there any way to use it properly?
3) if not, would you suggest other means to parallelize such computation?
Thanks in advance!
I'm writing a plugin for CC to calculate some local cloud parameters along a 3D surface.
For that I sample the surface, then query the octree at each sampled point to get cylindrical neighbourhood (using DgmOctree::getPointsInCylindricalNeighbourhood) along the normal of the surface at the point. Then calculate local parameters as a function of returned points.
The algorithm works as intended, but is expectedly slow. So I'm trying to reimplement it using QtConcurrent::mapped and getting very strange results: most of the getPointsInCylindricalNeighbourhood calls return 0 points.
From this I suspect that calls use some shared state inside the octree; but hard as I try (reading DgmOctree code), I cannot figure out what it is and how to circumvent it, if at all possible.
So my questions are:
1) why getPointsInCylindricalNeighbourhood works incorrectly in parallel execution?
2) is there any way to use it properly?
3) if not, would you suggest other means to parallelize such computation?
Thanks in advance!