Hello, how i can append own properties to object in my plugin?
With help m_app?
Own properties in plugin
Re: Own properties in plugin
I try to add object to database in my plugin, for exampledaniel wrote:Could you be more specific?
Code: Select all
ccHObject *group = new ccHObject("GroupName");
m_app->addToDB(group);
m_app->refreshAll();
-Name GroupName
-Show name
-Info Object ID:...
-Current Display 3D View 1
My question is:
How can i create object of db with its own properties, for example
-Filename filename.txt
-Dir /usr/lib
-Special_field special_information
Re: Own properties in plugin
Hum, I don't think it's possible right now as everything is managed in ccPropertiesTreeDelegate which is a component of the CloudCompare project (and it's not aware of the plugins).
The only thing you can do is add these pieces of information as 'meta-data' (in which case they will appear at the end of the properties list, with one row per meta-data).
The only thing you can do is add these pieces of information as 'meta-data' (in which case they will appear at the end of the properties list, with one row per meta-data).
Daniel, CloudCompare admin
Re: Own properties in plugin
Daniel, thank you for your answer.daniel wrote:Hum, I don't think it's possible right now as everything is managed in ccPropertiesTreeDelegate which is a component of the CloudCompare project (and it's not aware of the plugins).
The only thing you can do is add these pieces of information as 'meta-data' (in which case they will appear at the end of the properties list, with one row per meta-data).
Must i use setMetaData(QString key, QVariant data)?
For example:
Code: Select all
ccHObject *group = new ccHObject("GroupName");
group->setMetaData("Filename", "text.txt" );
m_app->addToDB(group);
m_app->refreshAll();
Re: Own properties in plugin
Ah! It's because it's only displayed for point clouds, meshes, facets, polylines and sensors for now ;)
I can extend it to groups if you wish?
I can extend it to groups if you wish?
Daniel, CloudCompare admin
Re: Own properties in plugin
It would be great to extend it with custom Object(ccCustomHObject). So there won't be fields required by object type(like width, height etc in image) , only from setmetadata.daniel wrote:Ah! It's because it's only displayed for point clouds, meshes, facets, polylines and sensors for now ;)
I can extend it to groups if you wish?
Re: Own properties in plugin
Okay, to make things simpler, all objects meta-data are now displayed, whatever the object. The github repo has been updated.
Daniel, CloudCompare admin
Re: Own properties in plugin
Daniel, thank you for your answers!
Re: Own properties in plugin
Is it possible now to show metadata of a ccCustomHObject?
I found a workaround like this,
CC_CLASS_ENUM ccTestObj::getClassID() const
{
auto id = ccHObject::getClassID();
id |= CC_TYPES::SENSOR;
return id;
}
but my ccTestObj is not a SENSOR, so is there any other way to do that?
I found a workaround like this,
CC_CLASS_ENUM ccTestObj::getClassID() const
{
auto id = ccHObject::getClassID();
id |= CC_TYPES::SENSOR;
return id;
}
but my ccTestObj is not a SENSOR, so is there any other way to do that?