Page 2 of 2

Re: Batch synchronize process

Posted: Wed Jul 03, 2013 9:57 am
by burcarjo
Finally I used hDlg->exec(); to keep opened the histogram window.

I'm looking a way to delete points out of a custom defined box (from center).
What method can I use to directly remove a point of my cloudPoint object ?

CCVector3 P;
dataCloudcut->getPoint(i,P);
float dx = std::abs(P.x - C.x);
float dy = std::abs(P.y - C.y);
float dz = std::abs(P.z - C.z);
if (dx>1.0 || dy>1.0 || dz>1.0) {
dataCloudcut-> ..... (remove point)
}


David.

Re: Batch synchronize process

Posted: Wed Jul 03, 2013 11:20 am
by daniel
In fact there's no method to delete a given point (as we use internally specific memory structures that don't handle this well at all).

The best way is to create a new point cloud with the points you want to keep. Either you do this really simply (create a new cloud and 'add' points to it) or if you want to keep all the other pieces of information (color, scalar fields, normals, etc.) you must use a 'CCLib::ReferenceCloud' (in which you only push the indexes of the points you want to keep) and eventually you can create a new cloud based on this selection (with the ccPointCloud::partialClone). You have multiple example of this wherever partialClone is used in the code.