else {
aNode = new PartSet_ObjectNode(aBody, this);
myChildren.append(aNode);
+ aNode->update();
}
}
else if (aFieldRes.get()) {
aObj = subObject(aId);
if (aNode->object() != aObj) {
myChildren.removeAll(aNode);
- aResult.removeAll(aNode);
delete aNode;
isDeleted = true;
}
//ResultCompSolidPtr aCompRes = std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(theObj);
//if (aCompRes.get())
// return new PartSet_CompsolidNode(theObj, this);
- return new PartSet_ObjectNode(theObj, this);
+ ModuleBase_ITreeNode* aNode = new PartSet_ObjectNode(theObj, this);
+ aNode->update();
+ return aNode;
}
void PartSet_FolderNode::update()
aToSort |= ((aIndex != -1) && (aId != aIndex));
if (aIndex == -1) {
myChildren.removeAll(aNode);
- aResult.removeAll(aNode);
delete aNode;
aRemoved = true;
}
aToSort |= ((aIndex != -1) && (aId != (aIndex + aNb)));
if (aIndex == -1) {
myChildren.removeAll(aNode);
- aResult.removeAll(aNode);
delete aNode;
aRemoved = true;
continue;
if (aFeature->getKind() == PartSetPlugin_Part::ID())
return new PartSet_PartRootNode(theObj, this);
- return new PartSet_ObjectNode(theObj, this);
+ PartSet_ObjectNode* aNode = new PartSet_ObjectNode(theObj, this);
+ aNode->update();
+ return aNode;
}
//////////////////////////////////////////////////////////////////////////////////
bool aHasFields = myFieldsFolder->childrenCount() > 0;
bool aHasGroups = myGroupsFolder->childrenCount() > 0;
- if (aHasFields && (!myChildren.contains(myFieldsFolder))) {
- myChildren.insert(3, myFieldsFolder);
- }
- else if (myChildren.contains(myFieldsFolder)) {
+ if (aHasFields) {
+ if (!myChildren.contains(myFieldsFolder)) {
+ myChildren.insert(3, myFieldsFolder);
+ }
+ } else if (myChildren.contains(myFieldsFolder)) {
myChildren.removeAll(myFieldsFolder);
}
- if (aHasGroups && (!myChildren.contains(myGroupsFolder))) {
- myChildren.insert(aHasFields ? 4 : 3, myGroupsFolder);
- }
- else if (myChildren.contains(myGroupsFolder)) {
+ if (aHasGroups) {
+ if (!myChildren.contains(myGroupsFolder)) {
+ myChildren.insert(aHasFields ? 4 : 3, myGroupsFolder);
+ }
+ } else if (myChildren.contains(myGroupsFolder)) {
myChildren.removeAll(myGroupsFolder);
}
{
if (theObj->groupName() == ModelAPI_Folder::group())
return new PartSet_ObjectFolderNode(theObj, this);
- return new PartSet_ObjectNode(theObj, this);
+ PartSet_ObjectNode* aNode = new PartSet_ObjectNode(theObj, this);
+ aNode->update();
+ return aNode;
}
int PartSet_PartRootNode::numberOfFolders() const
if (aObj != myChildren.at(i)->object()) {
aNode = new PartSet_ObjectNode(aObj, this);
myChildren.insert(i, aNode);
+ aNode->update();
}
}
else {
aNode = new PartSet_ObjectNode(aObj, this);
myChildren.append(aNode);
+ aNode->update();
}
}
}
aNode = new PartSet_ObjectNode(aObj, this);
myChildren.insert(i, aNode);
aResult.append(aNode);
+ aNode->update();
}
} else {
aNode = new PartSet_ObjectNode(aObj, this);
myChildren.append(aNode);
aResult.append(aNode);
+ aNode->update();
}
}
return aResult;
if ((aFirst + aId) < aNbOfFeatures) {
if (aNode->object() != aDoc->object(ModelAPI_Feature::group(), aFirst + aId)) {
myChildren.removeAll(aNode);
- aResult.removeAll(aNode);
delete aNode;
aRemoved = true;
continue;