Bulid newgroup

Any question about the main GUI application (frontend)
Post Reply
snfge
Posts: 72
Joined: Thu Nov 20, 2014 4:12 am

Bulid newgroup

Post by snfge »

Hi
When I run my code , I want to bulid a newgroup with my own name, and add the objects to the newgroup, or add the objects to the exist group, how can do it with code? thank you.
snfge
Posts: 72
Joined: Thu Nov 20, 2014 4:12 am

Re: Bulid newgroup

Post by snfge »

Hi
For another problem, how can I traverse all the objects in the DBtree and list the names?
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Bulid newgroup

Post by daniel »

A group is simple a ccHObject:

Code: Select all

ccHObject* group = new ccHObject("Group name");
Then add the entities to this group as children (addChild).

And to access the DB tree objects from a plugin, see the qPCV plugin (qPCV.cpp, line 132). There's no example of how to traverse the whole set of entities, but it shouldn't be too hard to implement.
Daniel, CloudCompare admin
Post Reply