highlighting/selecting a point in cloud

Any question about the main GUI application (frontend)
vinayan
Posts: 21
Joined: Thu Nov 03, 2016 4:11 pm

highlighting/selecting a point in cloud

Postby vinayan » Wed May 17, 2017 3:41 pm

hi,

I managed to highlight and zoom to a line object referring the centerAndZoom functionality in mainwindow.

Code: Select all

ccHObject* lineObj = getLineObj();
bbox = lineObj->getOwnBB();
m_app->setSelectedInDB(lineObj, true);
glWindow->updateConstellationCenterAndZoom(&bbox);


but the same code for point does not show a bounding box on screen for selection. Is there any way to add this box to a point? Since there was no bounding box for point, I added a one unit bbox like shown below and it is zooming to the point box. Is there some way I can show that selection box there?

Code: Select all

ccHObject* pointObj = pcloud->getChild(pointIndex);
m_app->setSelectedInDB(pointObj, true);
bbox = ccBBox(CCVector3(point->x - 1, point->y - 1, point->z - 1), CCVector3(point->x + 1, point->y + 1, point->z + 1));
glWindow->updateConstellationCenterAndZoom(&bbox);

daniel
Site Admin
Posts: 2985
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: highlighting/selecting a point in cloud

Postby daniel » Wed May 17, 2017 5:45 pm

I'm not sure about the call to

Code: Select all

ccHObject* pointObj = pcloud->getChild(pointIndex);


Well, assuming it's the case, then indeed the bounding-box of a cloud with a single point inside has a null dimension (this is why the zoom doesn't work, and this is why you can't see it in the 3D view). Therefore you are right to 'enlarge' the bounding-box so as to provide a scale for the 'updateConstellationCenterAndZoom' method.

One clean way to fix this would be to create a child class of ccPointCloud, that only re-implements the 'getOwnBB' method and returns a box with a fixed size in the case there's only one point in the cloud. This way you won't have to enlarge the box yourself, and the selection box would be visible. Of course this only works if you create the clouds yourself (in your plugin).
Daniel, CloudCompare admin

vinayan
Posts: 21
Joined: Thu Nov 03, 2016 4:11 pm

Re: highlighting/selecting a point in cloud

Postby vinayan » Thu May 18, 2017 3:17 am

thanks..i will give this a try..I am creating the clouds myself. This is just a plugin to let user capture a few points from cloud.

returns a box with a fixed size in the case there's only one point in the cloud.

does this mean I need to create a temporary cloud just for zooming to a point?

Code: Select all

ccHObject* pointObj = pcloud->getChild(pointIndex);


Suppose I subclass the ccPointCloud. Now is there anything that I can override so that it will return a box for the ccHObject* obtained above in the case the bbox is null?

daniel
Site Admin
Posts: 2985
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: highlighting/selecting a point in cloud

Postby daniel » Thu May 18, 2017 6:05 am

No you don't need to create a cloud only for zooming. Instead of creating ccPointCloud instances for each point the user has picked, you would create your own point cloud instance that you have subclassed from ccPointCloud. And this subclass only needs to re-implement the 'getOwnBB' method.

P.S.: just to be sure: you know the 'Point list picking' tool, don't you?
Daniel, CloudCompare admin

vinayan
Posts: 21
Joined: Thu Nov 03, 2016 4:11 pm

Re: highlighting/selecting a point in cloud

Postby vinayan » Thu May 18, 2017 7:08 am

okay it is clear now. I will try it out. Of course i know the point list picking tool :)


Return to “CloudCompare”

Who is online

Users browsing this forum: No registered users and 1 guest