-// Copyright (C) 2014-2017 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "PartSet_TreeNodes.h"
+#include "PartSet_Tools.h"
#include <ModuleBase_IconFactory.h>
#include <ModuleBase_IWorkshop.h>
+#include <ModuleBase_Tools.h>
#include <PartSetPlugin_Part.h>
#include <ModelAPI_Folder.h>
#include <ModelAPI_AttributeReference.h>
+#include <Config_PropManager.h>
+
#include <QBrush>
#include <QMap>
+#include <QPalette>
#define ACTIVE_COLOR QColor(Qt::black)
return QBrush(DISABLED_COLOR);
if (!aFlags.testFlag(Qt::ItemIsEditable))
return QBrush(SELECTABLE_COLOR);
- return ACTIVE_COLOR;
+ return activeItemColor();
}
return ModuleBase_ITreeNode::data(theColumn, theRole);
}
+QColor PartSet_TreeNode::activeItemColor() const
+{
+ // instead of ACTIVE_COLOR (black),
+ // use the color text of the current theme (white or black or other)
+ // to make it readable in dark theme (and light theme as well)
+ QColor color = QPalette().text().color() ;
+ return color;
+}
+
//////////////////////////////////////////////////////////////////////////////////
QVariant PartSet_ObjectNode::data(int theColumn, int theRole) const
AttributeDoublePtr aValueAttribute =
aParam->data()->real(ModelAPI_ResultParameter::VALUE());
QString aVal = QString::number(aValueAttribute->value());
- QString aTitle = QString(myObject->data()->name().c_str());
+ QString aTitle = QString::fromStdWString(myObject->data()->name());
return aTitle + " = " + aVal;
}
- return myObject->data()->name().c_str();
+ return QString::fromStdWString(myObject->data()->name());
}
break;
case Qt::DecorationRole:
return QIcon(":pictures/eyeclosed.png");
}
case 1:
- if (myObject->groupName() == ModelAPI_Folder::group())
- return QIcon(":pictures/features_folder.png");
- else
- return ModuleBase_IconFactory::get()->getIcon(myObject);
+ return ModuleBase_IconFactory::get()->getIcon(myObject);
case 2:
if (isCurrentFeature(myObject))
return QIcon(":pictures/arrow.png");
+ else
+ return QIcon();
}
}
return PartSet_TreeNode::data(theColumn, theRole);
}
+QColor PartSet_ObjectNode::activeItemColor() const
+{
+ if (myObject.get() && myObject->groupName() == ModelAPI_Feature::group()) {
+ std::vector<int> aColor =
+ Config_PropManager::color("Visualization", "feature_objectbrowser_color");
+ return QColor(aColor[0], aColor[1], aColor[2]);
+ }
+ return PartSet_TreeNode::activeItemColor();
+}
+
+
Qt::ItemFlags PartSet_ObjectNode::flags(int theColumn) const
{
if (myObject->isDisabled()) {
} else {
DocumentPtr aDoc = myObject->document();
SessionPtr aSession = ModelAPI_Session::get();
+
+ FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(myObject);
+ if (aFeature.get() && aFeature->getKind() == "Group")
+ {
+ std::shared_ptr<ModelAPI_CompositeFeature> anOwner =
+ ModelAPI_Tools::compositeOwner (aFeature);
+
+ if (anOwner.get() && anOwner->getKind() == "ImportResult")
+ return aDefaultFlag;
+ }
+
if (aSession->activeDocument() == aDoc)
return aEditingFlag;
}
// If the object is a field result then delete extra sub-objects
if (aFieldRes.get()) {
+ // Call shape in order to update content of Field.
+ // It is necessary to do for cases when field was created by script when module is inactive.
+ aFieldRes->shape();
while (myChildren.size() > aNb) {
ModuleBase_ITreeNode* aNode = myChildren.last();
myChildren.removeAll(aNode);
else {
aNode = new PartSet_ObjectNode(aBody, this);
myChildren.append(aNode);
+ aNode->update();
}
}
else if (aFieldRes.get()) {
- ModelAPI_ResultField::ModelAPI_FieldStep* aStep = aFieldRes->step(i);
- if (i < myChildren.size()) {
- PartSet_StepNode* aStepNode = static_cast<PartSet_StepNode*>(myChildren.at(i));
- if (aStepNode->entity() != aStep) {
- aStepNode->setEntity(aStep);
+ FieldStepPtr aStep = aFieldRes->step(i);
+ if (aStep.get()) {
+ if (i < myChildren.size()) {
+ PartSet_StepNode* aStepNode = static_cast<PartSet_StepNode*>(myChildren.at(i));
+ if (aStepNode->object() != aStep) {
+ aStepNode->setObject(aStep);
+ }
+ }
+ else {
+ aNode = new PartSet_StepNode(aStep, this);
+ myChildren.append(aNode);
}
- }
- else {
- aNode = new PartSet_StepNode(aStep, this);
- myChildren.append(aNode);
}
}
}
aNode = myChildren.takeLast();
delete aNode;
}
- foreach(ModuleBase_ITreeNode* aNode, myChildren) {
- aNode->update();
+ foreach(ModuleBase_ITreeNode* aChildNode, myChildren) {
+ aChildNode->update();
}
}
else {
ResultFieldPtr aFieldRes = std::dynamic_pointer_cast<ModelAPI_ResultField>(myObject);
ObjectPtr aBody;
int i;
+ // Call shape in order to update content of Field.
+ // It is necessary to do for cases when field was created by script when module is inactive.
+ if (aFieldRes.get())
+ aFieldRes->shape();
for (i = 0; i < aNb; i++) {
aBody = subObject(i);
if (aBody.get()) {
}
}
else {
- ModelAPI_ResultField::ModelAPI_FieldStep* aStep = aFieldRes->step(i);
- if (i < myChildren.size()) {
- PartSet_StepNode* aStepNode = static_cast<PartSet_StepNode*>(myChildren.at(i));
- if (aStepNode->entity() != aStep) {
- aStepNode->setEntity(aStep);
+ FieldStepPtr aStep = aFieldRes->step(i);
+ if (aStep.get()) {
+ if (i < myChildren.size()) {
+ PartSet_StepNode* aStepNode = static_cast<PartSet_StepNode*>(myChildren.at(i));
+ if (aStepNode->object() != aStep) {
+ aStepNode->setObject(aStep);
+ }
+ }
+ else {
+ aNode = new PartSet_StepNode(aStep, this);
+ myChildren.append(aNode);
}
- }
- else {
- aNode = new PartSet_StepNode(aStep, this);
- myChildren.append(aNode);
}
}
}
- foreach(ModuleBase_ITreeNode* aNode, myChildren) {
- aResult.append(aNode->objectCreated(theObjects));
+ foreach(ModuleBase_ITreeNode* aChildNode, myChildren) {
+ aResult.append(aChildNode->objectCreated(theObjects));
}
}
return aResult;
aResult.append(this);
int i = 0;
ObjectPtr aBody;
- foreach(ModuleBase_ITreeNode* aNode, myChildren) {
+ foreach(ModuleBase_ITreeNode* aChildNode, myChildren) {
aBody = subObject(i);
- ((PartSet_ObjectNode*)aNode)->setObject(aBody);
- aResult.append(aNode->objectsDeleted(theDoc, theGroup));
+ ((PartSet_ObjectNode*)aChildNode)->setObject(aBody);
+ aResult.append(aChildNode->objectsDeleted(theDoc, theGroup));
i++;
}
}
}
}
}
+ if ((theColumn == 2) && (theRole == Qt::DecorationRole)) {
+ if (document().get()) {
+ SessionPtr aSession = ModelAPI_Session::get();
+ if (document() != aSession->activeDocument())
+ return QIcon();
+
+ FeaturePtr aFeature = document()->currentFeature(true);
+ if (!aFeature.get()) { // There is no current feature
+ ModuleBase_ITreeNode* aLastFolder = 0;
+ foreach(ModuleBase_ITreeNode* aNode, parent()->children()) {
+ if (aNode->type() == PartSet_FolderNode::typeId())
+ aLastFolder = aNode;
+ else
+ break;
+ }
+ if (aLastFolder == this)
+ return QIcon(":pictures/arrow.png");
+ else
+ return QIcon();
+ }
+ }
+ }
return PartSet_TreeNode::data(theColumn, theRole);
}
//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()
}
}
// Add nodes in correct order
- int i;
- for (i = 0; i < myChildren.size(); i++) {
- if (aNewNodes.contains(i)) {
- myChildren.insert(i, aNewNodes[i]);
+ if (aNewNodes.size() > 0) {
+ int i;
+ for (i = 0; i < myChildren.size(); i++) {
+ if (aNewNodes.contains(i)) {
+ myChildren.insert(i, aNewNodes[i]);
+ aNewNodes.remove(i);
+ }
+ }
+ while (aNewNodes.size()) {
+ i = myChildren.size();
+ myChildren.append(aNewNodes[i]);
aNewNodes.remove(i);
}
}
- while (aNewNodes.size()) {
- i = myChildren.size();
- myChildren.append(aNewNodes[i]);
- aNewNodes.remove(i);
- }
foreach(ModuleBase_ITreeNode* aNode, myChildren) {
aResult.append(aNode->objectCreated(theObjects));
}
int aIndex;
int aId = 0;
bool aRemoved = false;
+ bool aToSort = false;
while (aId < myChildren.size()) {
ModuleBase_ITreeNode* aNode = myChildren.at(aId);
aIndex = aDoc->index(aNode->object(), true);
- if ((aIndex == -1) || (aId != aIndex)) {
+ aToSort |= ((aIndex != -1) && (aId != aIndex));
+ if (aIndex == -1) {
myChildren.removeAll(aNode);
delete aNode;
aRemoved = true;
- } else
+ }
+ else
aId++;
}
if (aRemoved)
aResult.append(this);
-
+ if (aToSort)
+ sortChildren();
foreach(ModuleBase_ITreeNode* aNode, myChildren) {
aResult.append(aNode->objectsDeleted(theDoc, theGroup));
}
}
}
// To add in correct order
- int i;
- for (i = 0; i < myChildren.size(); i++) {
- if (aNewNodes.contains(i)) {
- myChildren.insert(i, aNewNodes[i]);
- aNewNodes.remove(i);
+ if (aNewNodes.size() > 0) {
+ int i;
+ for (i = 0; i < myChildren.size(); i++) {
+ if (aNewNodes.contains(i)) {
+ myChildren.insert(i, aNewNodes[i]);
+ aNewNodes.remove(i);
+ }
+ }
+ while (aNewNodes.size()) {
+ i = myChildren.size();
+ if (aNewNodes.contains(i)) {
+ myChildren.append(aNewNodes[i]);
+ aNewNodes.remove(i);
+ }
}
}
- while (aNewNodes.size()) {
- i = myChildren.size();
- myChildren.append(aNewNodes[i]);
- aNewNodes.remove(i);
- }
-
// Update sub-folders
foreach(ModuleBase_ITreeNode* aNode, myChildren) {
aResult.append(aNode->objectCreated(theObjects));
int aIndex;
int aId = 0;
bool aRemoved = false;
+ bool aToSort = false;
while (aId < myChildren.size()) {
ModuleBase_ITreeNode* aNode = myChildren.at(aId);
if (aNode->object().get()) {
aIndex = aDoc->index(aNode->object(), true);
- if ((aIndex == -1) || (aId != (aIndex + aNb))) {
+ aToSort |= ((aIndex != -1) && (aId != (aIndex + aNb)));
+ if (aIndex == -1) {
myChildren.removeAll(aNode);
delete aNode;
aRemoved = true;
}
if (aRemoved)
aResult.append(this);
+ if (aToSort)
+ sortChildren();
}
return aResult;
}
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);
+ 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);
+ if (aHasGroups) {
+ if (!myChildren.contains(myGroupsFolder)) {
+ myChildren.insert(aHasFields ? 4 : 3, myGroupsFolder);
+ }
+ } else if (myChildren.contains(myGroupsFolder)) {
+ myChildren.removeAll(myGroupsFolder);
}
// Update features content
// Remove extra sub-nodes
int aIndex = -1;
- int aId = 0;
+ int aId = aRows;
+ QMap<int, ModuleBase_ITreeNode*> aExistingNodes;
while (aId < myChildren.size()) {
ModuleBase_ITreeNode* aNode = myChildren.at(aId);
if (aNode->object().get()) {
aIndex = aDoc->index(aNode->object(), true);
if ((aIndex == -1) || (aId != (aIndex + aRows))) {
myChildren.removeAll(aNode);
- delete aNode;
+ if (aIndex == -1)
+ delete aNode;
+ else
+ aExistingNodes[aIndex + aRows] = aNode;
continue;
}
}
aId = i + aRows; // Take into account existing folders
if (aId < myChildren.size()) {
if (myChildren.at(aId)->object() != aObj) {
- ModuleBase_ITreeNode* aNode = createNode(aObj);
- myChildren.insert(aId, aNode);
+ if (aExistingNodes.contains(aId)) {
+ myChildren.insert(aId, aExistingNodes[aId]);
+ aExistingNodes.remove(aId);
+ }
+ else {
+ myChildren.insert(aId, createNode(aObj));
+ }
}
} else {
- ModuleBase_ITreeNode* aNode = createNode(aObj);
- myChildren.append(aNode);
+ if (aExistingNodes.contains(myChildren.size()))
+ myChildren.append(aExistingNodes[myChildren.size()]);
+ else
+ myChildren.append(createNode(aObj));
}
}
// Update sub-folders
case 1:
switch (theRole) {
case Qt::DisplayRole:
- return QString(myObject->data()->name().c_str());
+ {
+ ResultPartPtr aPartRes = getPartResult(myObject);
+ if (aPartRes.get()) {
+ if (aPartRes->partDoc().get() == NULL)
+ return QString::fromStdWString(myObject->data()->name()) + " (Not loaded)";
+ }
+ return QString::fromStdWString(myObject->data()->name());
+ }
case Qt::DecorationRole:
return ModuleBase_IconFactory::get()->getIcon(myObject);
}
case 2:
- if (theRole == Qt::DecorationRole)
+ if (theRole == Qt::DecorationRole) {
if (isCurrentFeature(myObject))
return QIcon(":pictures/arrow.png");
+ else
+ return QIcon();
+ }
}
return PartSet_TreeNode::data(theColumn, theRole);
}
Qt::ItemFlags PartSet_PartRootNode::flags(int theColumn) const
{
+ if (myObject->isDisabled())
+ return (theColumn == 2) ? Qt::ItemIsSelectable : aNullFlag;
+
SessionPtr aSession = ModelAPI_Session::get();
DocumentPtr aActiveDoc = aSession->activeDocument();
if ((aActiveDoc == document()) || (myObject->document() == aActiveDoc))
{
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
//////////////////////////////////////////////////////////////////////////////////
void PartSet_ObjectFolderNode::update()
{
- int aFirst, aLast;
- getFirstAndLastIndex(aFirst, aLast);
+ int aFirst = -1, aLast = -1;
+ PartSet_Tools::getFirstAndLastIndexInFolder(myObject, aFirst, aLast);
if ((aFirst == -1) || (aLast == -1)) {
deleteChildren();
return;
}
DocumentPtr aDoc = myObject->document();
- // Delete obsolete nodes
- int aId = 0;
- while (aId < myChildren.size()) {
- ModuleBase_ITreeNode* aNode = myChildren.at(aId);
- if ((aFirst + aId) < aDoc->size(ModelAPI_Feature::group(), true)) {
- if (aNode->object() != aDoc->object(ModelAPI_Feature::group(), aFirst + aId)) {
+ if (aNbItems < myChildren.size()) {
+ // Delete obsolete nodes
+ int aId = 0;
+ int aNbOfFeatures = aDoc->size(ModelAPI_Feature::group(), true);
+ while (aId < myChildren.size()) {
+ ModuleBase_ITreeNode* aNode = myChildren.at(aId);
+ if ((aId < aNbItems) && ((aFirst + aId) < aNbOfFeatures)) {
+ if (aNode->object() != aDoc->object(ModelAPI_Feature::group(), aFirst + aId)) {
+ myChildren.removeAll(aNode);
+ delete aNode;
+ continue;
+ }
+ }
+ else {
myChildren.removeAll(aNode);
delete aNode;
continue;
}
+ aId++;
}
- aId++;
}
-
- // Add new nodes
- ModuleBase_ITreeNode* aNode;
- for (int i = 0; i < aNbItems; i++) {
- ObjectPtr aObj = aDoc->object(ModelAPI_Feature::group(), aFirst + i);
- if (i < myChildren.size()) {
- if (aObj != myChildren.at(i)->object()) {
+ if (aNbItems > myChildren.size()) {
+ // Add new nodes
+ ModuleBase_ITreeNode* aNode;
+ for (int i = 0; i < aNbItems; i++) {
+ ObjectPtr aObj = aDoc->object(ModelAPI_Feature::group(), aFirst + i);
+ if (i < myChildren.size()) {
+ 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.insert(i, aNode);
+ myChildren.append(aNode);
+ aNode->update();
}
- } else {
- aNode = new PartSet_ObjectNode(aObj, this);
- myChildren.append(aNode);
}
}
}
-QTreeNodesList PartSet_ObjectFolderNode::objectCreated(const QObjectPtrList& theObjects)
+QTreeNodesList PartSet_ObjectFolderNode::objectCreated(const QObjectPtrList& /*theObjects*/)
{
QTreeNodesList aResult;
- int aFirst, aLast;
- getFirstAndLastIndex(aFirst, aLast);
+ int aFirst = -1, aLast = -1;
+ PartSet_Tools::getFirstAndLastIndexInFolder(myObject, aFirst, aLast);
if ((aFirst == -1) || (aLast == -1)) {
return aResult;
}
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;
}
-QTreeNodesList PartSet_ObjectFolderNode::objectsDeleted(const DocumentPtr& theDoc,
- const QString& theGroup)
+QTreeNodesList PartSet_ObjectFolderNode::objectsDeleted(const DocumentPtr& /*theDoc*/,
+ const QString& /*theGroup*/)
{
QTreeNodesList aResult;
- int aFirst, aLast;
- getFirstAndLastIndex(aFirst, aLast);
+ int aFirst = -1, aLast = -1;
+ PartSet_Tools::getFirstAndLastIndexInFolder(myObject, aFirst, aLast);
if ((aFirst == -1) || (aLast == -1)) {
return aResult;
}
if (!aNbItems) {
return aResult;
}
+ if (aNbItems >= myChildren.size()) // Nothing was deleted here
+ return aResult;
+
DocumentPtr aDoc = myObject->document();
// Delete obsolete nodes
bool aRemoved = false;
int aId = 0;
+ int aNbOfFeatures = aDoc->size(ModelAPI_Feature::group(), true);
while (aId < myChildren.size()) {
ModuleBase_ITreeNode* aNode = myChildren.at(aId);
- if ((aFirst + aId) < aDoc->size(ModelAPI_Feature::group(), true)) {
+ if ((aFirst + aId) < aNbOfFeatures) {
if (aNode->object() != aDoc->object(ModelAPI_Feature::group(), aFirst + aId)) {
myChildren.removeAll(aNode);
delete aNode;
continue;
}
}
+ else {
+ myChildren.removeAll(aNode);
+ aResult.removeAll(aNode);
+ delete aNode;
+ aRemoved = true;
+ continue;
+ }
aId++;
}
if (aRemoved) {
return aResult;
}
-FeaturePtr PartSet_ObjectFolderNode::getFeature(const std::string& theId) const
-{
- FolderPtr aFolder = std::dynamic_pointer_cast<ModelAPI_Folder>(myObject);
- AttributeReferencePtr aFeatAttr = aFolder->data()->reference(theId);
- if (aFeatAttr)
- return ModelAPI_Feature::feature(aFeatAttr->value());
- return FeaturePtr();
-}
-
-void PartSet_ObjectFolderNode::getFirstAndLastIndex(int& theFirst, int& theLast) const
+QVariant PartSet_ObjectFolderNode::data(int theColumn, int theRole) const
{
- DocumentPtr aDoc = myObject->document();
- FolderPtr aFolder = std::dynamic_pointer_cast<ModelAPI_Folder>(myObject);
-
- FeaturePtr aFirstFeatureInFolder = getFeature(ModelAPI_Folder::FIRST_FEATURE_ID());
- if (!aFirstFeatureInFolder.get()) {
- theFirst = -1;
- return;
- }
- FeaturePtr aLastFeatureInFolder = getFeature(ModelAPI_Folder::LAST_FEATURE_ID());
- if (!aLastFeatureInFolder.get()) {
- theLast = -1;
- return;
+ if (theRole == Qt::ForegroundRole) {
+ if (!myObject->isDisabled()) {
+ std::vector<int> aColor =
+ Config_PropManager::color("Visualization", "feature_objectbrowser_color");
+ return QColor(aColor[0], aColor[1], aColor[2]);
+ }
}
+ return PartSet_ObjectNode::data(theColumn, theRole);
- theFirst = aDoc->index(aFirstFeatureInFolder);
- theLast = aDoc->index(aLastFeatureInFolder);
}
-
//////////////////////////////////////////////////////////////////////////////////
QVariant PartSet_StepNode::data(int theColumn, int theRole) const
{
if ((theColumn == 1) && (theRole == Qt::DisplayRole)) {
- ModelAPI_ResultField::ModelAPI_FieldStep* aStep =
- dynamic_cast<ModelAPI_ResultField::ModelAPI_FieldStep*>(myEntity);
+ FieldStepPtr aStep =
+ std::dynamic_pointer_cast<ModelAPI_ResultField::ModelAPI_FieldStep>(myObject);
return "Step " + QString::number(aStep->id() + 1) + " " +
aStep->field()->textLine(aStep->id()).c_str();
}
- return PartSet_TreeNode::data(theColumn, theRole);
+ return PartSet_ObjectNode::data(theColumn, theRole);
+}
+
+ModuleBase_ITreeNode::VisibilityState PartSet_StepNode::visibilityState() const
+{
+ Qt::ItemFlags aFlags = flags(1);
+ if (aFlags == Qt::ItemFlags())
+ return NoneState;
+
+ ModuleBase_IWorkshop* aWork = workshop();
+ if (aWork->isVisible(myObject))
+ return Visible;
+ else
+ return Hidden;
}