Commit 2974685d authored by Jan Möbius's avatar Jan Möbius

Implemented scripting function in datacontrol to get number of groups in the scene.

Output number in mesh test.

refs #394

git-svn-id: 383ad7c9-94d9-4d36-a494-682f7c89f535
parent d71d0fb5
......@@ -364,6 +364,9 @@ class DataControlPlugin : public QObject, BaseInterface, ToolboxInterface, KeyIn
/// Get all source objects of given type
IdList getSourceObjects(DataType _type);
/// Returns the number of groups
unsigned int groupCount() const;
/// Print information about all open objects to the console
void printObjectInfoToLog();
......@@ -82,6 +82,9 @@ void DataControlPlugin::setDescriptions(){
emit setSlotDescription("groupObjects(idList)",tr("Group given Objects together."),
QStringList(tr("objectIds")), QStringList(tr("List of objects that should be grouped.")));
emit setSlotDescription("groupCount()",tr("Returns the number of group objects."),
QStringList(tr("")), QStringList(tr("")));
emit setSlotDescription("unGroupObject(int)",tr("Remove the given object from its group and append to root node."),
QStringList(tr("ObjectId")), QStringList(tr("Object to be removed from group.")));
......@@ -528,3 +531,20 @@ void DataControlPlugin::printObjectInfoToLog() {
emit log(LOGINFO, tr("Object \"%1\" with ID %2 of type %3 ").arg(o_it->name()).arg(o_it->id()).arg(o_it->dataType().name()));
/** \brief get number of groups
* Returns the number of groups that are in the scene
* @return Number of groups
unsigned int DataControlPlugin::groupCount() const {
unsigned int count = 0;
for ( PluginFunctions::BaseObjectIterator o_it(PluginFunctions::ALL_OBJECTS,DATA_GROUP); o_it != PluginFunctions::objectsEnd(); ++o_it)
return count;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment