// it may be a folder
ObjectPtr aFolder = folder(aRefs->Value(a));
if (aFolder.get()) {
- aResultOutOfFolder.push_back(aFolder);
+ aResult.push_back(aFolder);
+ if (theGroupID != ModelAPI_Folder::group())
+ aResultOutOfFolder.push_back(aFolder);
// get the last feature in the folder
AttributeReferencePtr aLastFeatAttr =
{
if (theIndex == -1)
return ObjectPtr();
+ createHistory(theGroupID);
const std::string& aGroupID = groupNameFoldering(theGroupID, theAllowFolder);
- createHistory(aGroupID);
return myHistory[aGroupID][theIndex];
}
int Model_Objects::size(const std::string& theGroupID, const bool theAllowFolder)
{
+ createHistory(theGroupID);
const std::string& aGroupID = groupNameFoldering(theGroupID, theAllowFolder);
- createHistory(aGroupID);
return int(myHistory[aGroupID].size());
}
myFolders.Bind(aFolderLab, aFolder);
// must be before the event sending: for OB the feature is already added
updateHistory(ModelAPI_Folder::group());
+ updateHistory(ModelAPI_Feature::group());
// must be after binding to the map because of "Box" macro feature that
// creates other features in "initData"
aPoint1Data.string("creation_method").setValue("by_xyz")
aSession.finishOperation()
+assert(aPartSetDoc.size("Features") == 2), "Wrong number of features: {}".format(aPartSetDoc.size("Features"))
+
# Folder before the feature
aSession.startOperation()
aFolder1 = aPartSetDoc.addFolder(aPoint1)
aSession.finishOperation()
-assert(aPartSetDoc.size("Folders") == 1)
+assert(aPartSetDoc.size("Folders") == 1), "Wrong number of folders: {}".format(aPartSetDoc.size("Folders"))
+assert(aPartSetDoc.size("Features") == 3), "Wrong number of features: {}".format(aPartSetDoc.size("Features"))
FOLDER_NAME_EXPECTED = "Folder_1"
assert(aFolder1.name() == FOLDER_NAME_EXPECTED), "Actual name '{}', expected '{}'".format(aFolder1.name(), FOLDER_NAME_EXPECTED)
aPoint2Data.string("creation_method").setValue("by_xyz")
aSession.finishOperation()
+assert(aPartDoc.size("Features") == 1), "Wrong number of features: {}".format(aPartDoc.size("Features"))
+
aSession.startOperation()
aFolder2 = aPartDoc.addFolder(aPoint2)
aSession.finishOperation()
-assert(aPartDoc.size("Folders") == 1)
+assert(aPartDoc.size("Folders") == 1), "Wrong number of folders: {}".format(aPartDoc.size("Folders"))
+assert(aPartDoc.size("Features") == 2), "Wrong number of features: {}".format(aPartDoc.size("Features"))
FOLDER_NAME_EXPECTED = "Folder_1"
assert(aFolder2.name() == FOLDER_NAME_EXPECTED), "Actual name '{}', expected '{}'".format(aFolder2.name(), FOLDER_NAME_EXPECTED)