Iterate throug ccPointCloud Object
Posted: Wed Jan 22, 2020 10:24 pm
Hi,
first of all nice to meet you, it is my first time writing on this forum and I'm not really sure to be asking in the right place.
By the wy:
I am trying to implement a plug in in CC and there is the need to iterate through a ccPointCloud Object to store points coordinates and scalar fields to an array. The pointcloud I got from this pice of code:
This is needed since I have a dialog window on which thereis a ComboBox with wich i select the point cloud.
I have seen that the SimpleCloud object has the possibility to iterate throug the points and get coordinates as well as scalar field value, but the #include <SimplePointCloud.h> isn't there anymore... Furthermore I do not know if there is a way to convert a ccPointCloud to a SimplePointCloud object.
Do you have any suggestion on how to proceed?
Thank you very much in advance for your kind attention.
Simone
first of all nice to meet you, it is my first time writing on this forum and I'm not really sure to be asking in the right place.
By the wy:
I am trying to implement a plug in in CC and there is the need to iterate through a ccPointCloud Object to store points coordinates and scalar fields to an array. The pointcloud I got from this pice of code:
Code: Select all
ccPointCloud* qMLtrainingTools::GetCloudFromCombo(QComboBox* comboBox, ccHObject* dbRoot)
{
assert(comboBox && dbRoot);
if (!comboBox || !dbRoot)
{
assert(false);
return nullptr;
}
//return the cloud currently selected in the combox box
int index = comboBox->currentIndex();
if (index < 0)
{
assert(false);
return nullptr;
}
unsigned uniqueID = comboBox->itemData(index).toUInt();
ccHObject* item = dbRoot->find(uniqueID);
if (!item || !item->isA(CC_TYPES::POINT_CLOUD))
{
assert(false);
return nullptr;
}
return static_cast<ccPointCloud*>(item);
}
I have seen that the SimpleCloud object has the possibility to iterate throug the points and get coordinates as well as scalar field value, but the #include <SimplePointCloud.h> isn't there anymore... Furthermore I do not know if there is a way to convert a ccPointCloud to a SimplePointCloud object.
Do you have any suggestion on how to proceed?
Thank you very much in advance for your kind attention.
Simone