- FeaturePtr aFeature = aRootDoc->feature(CONSTRUCTIONS_GROUP, theIndex.row());
- if (aFeature)
- return boost::dynamic_pointer_cast<ModelAPI_Object>(aFeature)->getName().c_str();
+ ObjectPtr aObject = aRootDoc->object(ModelAPI_ResultConstruction::group(), theIndex.row());
+ if (aObject)
+ return aObject->data()->name().c_str();
+ }
+ break;
+ case BodiesFolder:
+ return tr("Bodies") + QString(" (%1)").arg(rowCount(theIndex));
+ case BodiesObject:
+ {
+ DocumentPtr aRootDoc = ModelAPI_PluginManager::get()->rootDocument();
+ ObjectPtr aObject = aRootDoc->object(ModelAPI_ResultBody::group(), theIndex.row());
+ if (aObject)
+ return aObject->data()->name().c_str();