return tr("Parameters") + QString(" (%1)").arg(rowCount(theIndex));
case ParamObject:
{
- FeaturePtr aFeature = myDocument->feature(PARAMETERS_GROUP, theIndex.row(), true);
+ FeaturePtr aFeature = myDocument->feature(PARAMETERS_GROUP, theIndex.row());
if (aFeature)
- return aFeature->data()->getName().c_str();
+ return boost::dynamic_pointer_cast<ModelAPI_Object>(aFeature)->getName().c_str();
}
case ConstructFolder:
return tr("Constructions") + QString(" (%1)").arg(rowCount(theIndex));
case ConstructObject:
{
- FeaturePtr aFeature = myDocument->feature(CONSTRUCTIONS_GROUP, theIndex.row(), true);
+ FeaturePtr aFeature = myDocument->feature(CONSTRUCTIONS_GROUP, theIndex.row());
if (aFeature)
- return aFeature->data()->getName().c_str();
+ return boost::dynamic_pointer_cast<ModelAPI_Object>(aFeature)->getName().c_str();
}
}
break;
return QIcon(":pictures/constr_folder.png");
case ConstructObject:
{
- FeaturePtr aFeature = myDocument->feature(CONSTRUCTIONS_GROUP, theIndex.row(), true);
+ FeaturePtr aFeature = myDocument->feature(CONSTRUCTIONS_GROUP, theIndex.row());
if (aFeature)
return QIcon(XGUI_Workshop::featureIcon(aFeature->getKind()));
}
case ConstructFolder:
return FeaturePtr();
case ParamObject:
- return myDocument->feature(PARAMETERS_GROUP, theIndex.row(), true);
+ return myDocument->feature(PARAMETERS_GROUP, theIndex.row());
case ConstructObject:
- return myDocument->feature(CONSTRUCTIONS_GROUP, theIndex.row(), true);
+ return myDocument->feature(CONSTRUCTIONS_GROUP, theIndex.row());
}
return FeaturePtr();
}
int aNb = myDocument->size(aGroup);
int aRow = -1;
for (int i = 0; i < aNb; i++) {
- if (myDocument->feature(aGroup, i, true) == theFeature) {
+ if (myDocument->feature(aGroup, i) == theFeature) {
aRow = i;
break;
}
switch (theIndex.internalId()) {
case MyRoot:
{
- FeaturePtr aFeature = myDocument->feature(PARTS_GROUP, myId, true);
+ FeaturePtr aFeature = myDocument->feature(PARTS_GROUP, myId);
if (aFeature)
- return aFeature->data()->getName().c_str();
+ return boost::dynamic_pointer_cast<ModelAPI_Object>(aFeature)->getName().c_str();
}
case ParamsFolder:
return tr("Parameters") + QString(" (%1)").arg(rowCount(theIndex));
return tr("Bodies") + QString(" (%1)").arg(rowCount(theIndex));
case ParamObject:
{
- FeaturePtr aFeature = featureDocument()->feature(PARAMETERS_GROUP, theIndex.row(), true);
+ FeaturePtr aFeature = featureDocument()->feature(PARAMETERS_GROUP, theIndex.row());
if (aFeature)
- return aFeature->data()->getName().c_str();
+ return boost::dynamic_pointer_cast<ModelAPI_Object>(aFeature)->getName().c_str();
}
case ConstructObject:
{
- FeaturePtr aFeature = featureDocument()->feature(CONSTRUCTIONS_GROUP, theIndex.row(), true);
+ FeaturePtr aFeature = featureDocument()->feature(CONSTRUCTIONS_GROUP, theIndex.row());
if (aFeature)
- return aFeature->data()->getName().c_str();
+ return boost::dynamic_pointer_cast<ModelAPI_Object>(aFeature)->getName().c_str();
}
case HistoryObject:
{
- FeaturePtr aFeature = featureDocument()->feature(FEATURES_GROUP, theIndex.row() - 3, true);
+ FeaturePtr aFeature = featureDocument()->feature(FEATURES_GROUP, theIndex.row() - 3);
if (aFeature)
return aFeature->data()->getName().c_str();
}
return QIcon(":pictures/constr_folder.png");
case ConstructObject:
{
- FeaturePtr aFeature = featureDocument()->feature(CONSTRUCTIONS_GROUP, theIndex.row(), true);
+ FeaturePtr aFeature = featureDocument()->feature(CONSTRUCTIONS_GROUP, theIndex.row());
if (aFeature)
return QIcon(XGUI_Workshop::featureIcon(aFeature->getKind()));
}
case HistoryObject:
{
- FeaturePtr aFeature = featureDocument()->feature(FEATURES_GROUP, theIndex.row() - 3, true);
+ FeaturePtr aFeature = featureDocument()->feature(FEATURES_GROUP, theIndex.row() - 3);
if (aFeature)
return QIcon(XGUI_Workshop::featureIcon(aFeature->getKind()));
}
int XGUI_PartDataModel::rowCount(const QModelIndex& parent) const
{
if (!parent.isValid())
- if (myDocument->feature(PARTS_GROUP, myId, true))
+ if (myDocument->feature(PARTS_GROUP, myId))
return 1;
else
return 0;
{
switch (theIndex.internalId()) {
case MyRoot:
- if (theIndex.row() < 3) {
- return myDocument->feature(PARTS_GROUP, myId, true);
- } else
- return featureDocument()->feature(FEATURES_GROUP, theIndex.row() - 3, true);
+ return myDocument->feature(PARTS_GROUP, myId);
case ParamsFolder:
case ConstructFolder:
case BodiesFolder:
return FeaturePtr();
case ParamObject:
- return featureDocument()->feature(PARAMETERS_GROUP, theIndex.row(), true);
+ return featureDocument()->feature(PARAMETERS_GROUP, theIndex.row());
case ConstructObject:
- return featureDocument()->feature(CONSTRUCTIONS_GROUP, theIndex.row(), true);
+ return featureDocument()->feature(CONSTRUCTIONS_GROUP, theIndex.row());
//case BodiesObject:
- // return featureDocument()->feature(CONSTRUCTIONS_GROUP, theIndex.row(), true);
+ // return featureDocument()->feature(CONSTRUCTIONS_GROUP, theIndex.row());
+ case HistoryObject:
+ return featureDocument()->feature(FEATURES_GROUP, theIndex.row() - 3);
}
return FeaturePtr();
}
int aNb = myDocument->size(aGroup);
int aRow = -1;
for (int i = 0; i < aNb; i++) {
- if (myDocument->feature(aGroup, i, true) == theFeature) {
+ if (myDocument->feature(aGroup, i) == theFeature) {
aRow = i;
break;
}