if (aObject)
return boost::dynamic_pointer_cast<ModelAPI_Object>(aObject)->data()->name().c_str();
}
+ case BodiesObject:
+ {
+ ObjectPtr aObject = partDocument()->object(ModelAPI_ResultBody::group(), theIndex.row());
+ if (aObject)
+ return aObject->data()->name().c_str();
+ }
case HistoryObject:
{
ObjectPtr aObject = partDocument()->object(ModelAPI_Feature::group(), theIndex.row() - 3);
case BodiesFolder:
return QIcon(":pictures/constr_folder.png");
case ConstructObject:
+ case BodiesObject:
return QIcon(":pictures/constr_object.png");
- //{
- // ObjectPtr aObject = partDocument()->object(ModelAPI_ResultConstruction::group(), theIndex.row());
- // if (aObject)
- // return QIcon(XGUI_Workshop::featureIcon(aObject->getKind()));
- //}
case HistoryObject:
{
ObjectPtr aObject = partDocument()->object(ModelAPI_Feature::group(), theIndex.row() - 3);
case ConstructFolder:
return partDocument()->size(ModelAPI_ResultConstruction::group());
case BodiesFolder:
- return 0;
+ return partDocument()->size(ModelAPI_ResultBody::group());
}
return 0;
}
return createIndex(0, 0, (qint32) ParamsFolder);
case ConstructObject:
return createIndex(1, 0, (qint32) ConstructFolder);
+ case BodiesObject:
+ return createIndex(2, 0, (qint32) BodiesFolder);
}
return QModelIndex();
}
return partDocument()->object(ModelAPI_ResultParameters::group(), theIndex.row());
case ConstructObject:
return partDocument()->object(ModelAPI_ResultConstruction::group(), theIndex.row());
- //case BodiesObject:
- // return partDocument()->feature(ModelAPI_ResultConstruction::group(), theIndex.row());
+ case BodiesObject:
+ return partDocument()->object(ModelAPI_ResultBody::group(), theIndex.row());
case HistoryObject:
return partDocument()->object(ModelAPI_Feature::group(), theIndex.row() - 3);
}
return createIndex(0, 0, (qint32) ParamsFolder);
if (theGroup.compare(ModelAPI_ResultConstruction::group()) == 0)
return createIndex(1, 0, (qint32) ConstructFolder);
+ if (theGroup.compare(ModelAPI_ResultBody::group()) == 0)
+ return createIndex(2, 0, (qint32) BodiesFolder);
return QModelIndex();
}
if (part() == theObject)
return aIndex;
- //std::string aGroup = theFeature->getGroup();
+ std::string aGroup = theObject->groupName();
DocumentPtr aDoc = theObject->document();
- int aNb = aDoc->size(ModelAPI_Feature::group());
+ int aNb = aDoc->size(aGroup);
int aRow = -1;
for (int i = 0; i < aNb; i++) {
- if (aDoc->object(ModelAPI_Feature::group(), i) == theObject) {
+ if (aDoc->object(aGroup, i) == theObject) {
aRow = i;
break;
}
}
- if (aRow != -1) {
- return createIndex(aRow + 3, 0, (qint32) HistoryObject);
-/* if (aGroup.compare(ModelAPI_ResultParameters::group()) == 0)
+ if (aRow == -1)
+ return aIndex;
+ if (aGroup == ModelAPI_ResultParameters::group())
return createIndex(aRow, 0, (qint32) ParamObject);
- if (aGroup.compare(ModelAPI_ResultConstruction::group()) == 0)
- return createIndex(aRow, 0, (qint32) ConstructObject);*/
- }
+ else if (aGroup == ModelAPI_ResultConstruction::group())
+ return createIndex(aRow, 0, (qint32) ConstructObject);
+ else if (aGroup == ModelAPI_ResultBody::group())
+ return createIndex(aRow, 0, (qint32) BodiesObject);
+ else
+ return createIndex(aRow + 3, 0, (qint32) HistoryObject);
}
return aIndex;
}