From: vsv Date: Fri, 30 Nov 2018 11:37:37 +0000 (+0300) Subject: Issue #2811: Update content of Object node on creation moment X-Git-Tag: End2018~127 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=673296bc24d8a9f9edaf46edf481a76b9fc72d8b;p=modules%2Fshaper.git Issue #2811: Update content of Object node on creation moment --- diff --git a/src/PartSet/PartSet_TreeNodes.cpp b/src/PartSet/PartSet_TreeNodes.cpp index 4e2787487..b8434fbff 100644 --- a/src/PartSet/PartSet_TreeNodes.cpp +++ b/src/PartSet/PartSet_TreeNodes.cpp @@ -270,6 +270,7 @@ void PartSet_ObjectNode::update() else { aNode = new PartSet_ObjectNode(aBody, this); myChildren.append(aNode); + aNode->update(); } } else if (aFieldRes.get()) { @@ -482,7 +483,9 @@ ModuleBase_ITreeNode* PartSet_FolderNode::createNode(const ObjectPtr& theObj) //ResultCompSolidPtr aCompRes = std::dynamic_pointer_cast(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() @@ -813,7 +816,9 @@ ModuleBase_ITreeNode* PartSet_RootNode::createNode(const ObjectPtr& theObj) 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; } ////////////////////////////////////////////////////////////////////////////////// @@ -968,7 +973,9 @@ ModuleBase_ITreeNode* PartSet_PartRootNode::createNode(const ObjectPtr& theObj) { 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 @@ -1074,11 +1081,13 @@ void PartSet_ObjectFolderNode::update() 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(); } } } @@ -1106,11 +1115,13 @@ QTreeNodesList PartSet_ObjectFolderNode::objectCreated(const QObjectPtrList& the 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;