FeaturePtr aFeature = (*aIt);
DocumentPtr aDoc = aFeature->document();
if (aDoc == aRootDoc) { // If root objects
- if (aFeature->getGroup().compare(PARTS_GROUP) == 0) { // Update only Parts group
+ if (aFeature->getGroup().compare(ModelAPI_Document::PARTS_GROUP()) == 0) { // Update only Parts group
// Add a new part
int aStart = myPartModels.size();
XGUI_PartDataModel* aModel = new XGUI_PartDataModel(this);
for (aIt = aGroups.begin(); aIt != aGroups.end(); ++aIt) {
std::string aGroup = (*aIt);
if (aDoc == aRootDoc) { // If root objects
- if (aGroup.compare(PARTS_GROUP) == 0) { // Updsate only Parts group
+ if (aGroup.compare(ModelAPI_Document::PARTS_GROUP()) == 0) { // Updsate only Parts group
int aStart = myPartModels.size() - 1;
removeSubModel(aStart);
removeRow(aStart, partFolderNode());
beginResetModel();
clearModelIndexes();
- int aNbParts = aRootDoc->size(PARTS_GROUP);
+ int aNbParts = aRootDoc->size(ModelAPI_Document::PARTS_GROUP());
if (myPartModels.size() != aNbParts) { // resize internal models
while (myPartModels.size() > aNbParts) {
delete myPartModels.last();
{
int aOffset = historyOffset();
DocumentPtr aRootDoc = ModelAPI_PluginManager::get()->rootDocument();
- FeaturePtr aFeature = aRootDoc->feature(FEATURES_GROUP, theIndex.row() - aOffset);
+ FeaturePtr aFeature = aRootDoc->feature(ModelAPI_Document::FEATURES_GROUP(), theIndex.row() - aOffset);
if (!aFeature)
return QVariant();
switch (theRole) {
// Size of external models
int aVal = historyOffset();
// Plus history size
- aVal += aRootDoc->size(FEATURES_GROUP);
+ aVal += aRootDoc->size(ModelAPI_Document::FEATURES_GROUP());
return aVal;
}
if (theParent.internalId() == PartsFolder) {
if (theIndex.internalId() == HistoryNode) {
DocumentPtr aRootDoc = ModelAPI_PluginManager::get()->rootDocument();
int aOffset = historyOffset();
- return aRootDoc->feature(FEATURES_GROUP, theIndex.row() - aOffset);
+ return aRootDoc->feature(ModelAPI_Document::FEATURES_GROUP(), theIndex.row() - aOffset);
}
QModelIndex* aIndex = toSourceModelIndex(theIndex);
if (!isSubModel(aIndex->model()))
// This feature belongs to histrory or top model
if (theFeature->isInHistory()) {
int aId;
- for (aId = 0; aId < aRootDoc->size(FEATURES_GROUP); aId++) {
- if (theFeature == aRootDoc->feature(FEATURES_GROUP, aId))
+ for (aId = 0; aId < aRootDoc->size(ModelAPI_Document::FEATURES_GROUP()); aId++) {
+ if (theFeature == aRootDoc->feature(ModelAPI_Document::FEATURES_GROUP(), aId))
break;
}
return index(aId + historyOffset(), 0, QModelIndex());
}
}
return QModelIndex();
-}
\ No newline at end of file
+}