Page 1 of 1

[Done] Center of Bbox

Posted: Wed Sep 14, 2011 3:15 pm
by maximeseguin
I've had this code in : "ccPropertiesTreeDelegate.cpp", at the end of : "void ccPropertiesTreeDelegate::fillWithHObject(ccHObject* _obj)"

Code: Select all

    model->setRowCount(++curRow+1);
    item = new QStandardItem("Box Center");
    item->setFlags(Qt::ItemIsEnabled);
    model->setItem(curRow,0,item);

    CCVector3 bboxCenter = box.getCenter();
    item = new QStandardItem(QString("(%1; %2; %3)").arg(bbosCenter.x,0,'f',3).arg(bbosCenter.y,0,'f',3).arg(bbosCenter.z,0,'f',3));
    item->setFlags(Qt::ItemIsEnabled);
    model->setItem(curRow,1,item);
The aim is to show on the Properties, the center of the bounding box.

Is it possible to add this functionality to the next release of CloudCompare?

--
Maxime SEGUIN
Ecole Nationale des Sciences Géographiques

Re: Center of Bbox

Posted: Wed Sep 14, 2011 3:59 pm
by daniel
Yeah, no problem. It's already in the trunk version. It will appear in the next release.

I just had to strip the ",0,'f',3" arguments of the QString 'arg' methods, as it depends too much on your cloud dimensions/units. I prefer let QString choose automatically (it does this well generally).

Anyway thanks for the contribution!

Re: Center of Bbox

Posted: Wed Sep 14, 2011 4:58 pm
by maximeseguin
Ok, but I'm working with Lambert coordinates and I need millimeter precision...
So, is it possible to show the coordinates of the center of the bounding box with three digits? (Perhaps show this information in the console?)

--
Maxime SEGUIN
École Nationale des Sciences Géographiques