SHAPER  9.12.0
PartSet_RootNode Class Reference

Implementation of Root node in data tree. More...

Inheritance diagram for PartSet_RootNode:
Inheritance graph

Public Types

enum  VisibilityState { NoneState , Visible , SemiVisible , Hidden }
 

Public Member Functions

virtual std::string type () const
 
virtual void update ()
 Updates sub-nodes of the node. More...
 
virtual ModuleBase_IWorkshopworkshop () const
 Returns workshop object. Has to be reimplemented in a root node. More...
 
virtual DocumentPtr document () const
 Returns document object of the sub-tree. More...
 
void setWorkshop (ModuleBase_IWorkshop *theWork)
 
virtual QTreeNodesList objectCreated (const QObjectPtrList &theObjects)
 Process creation of objects. More...
 
virtual QTreeNodesList objectsDeleted (const DocumentPtr &theDoc, const QString &theGroup)
 Process deletion of objects. More...
 
virtual ModuleBase_ITreeNodefindParent (const DocumentPtr &theDoc, QString theGroup)
 Returns a node which belongs to the given document and contains objects of the given group. More...
 
virtual QVariant data (int theColumn, int theRole) const
 Returns the node representation according to theRole. More...
 
virtual QColor activeItemColor () const
 
virtual Qt::ItemFlags flags (int theColumn) const
 Returns properties flag of the item. More...
 
ModuleBase_ITreeNodeparent () const
 Returns parent node of the current node. More...
 
QTreeNodesList children () const
 Returns list of the node children. More...
 
ModuleBase_ITreeNodesubNode (int theRow) const
 Returns a children node according to given row (index) More...
 
ModuleBase_ITreeNodesubNode (const ObjectPtr &theObj, bool allLevels=true) const
 Finds a node which contains the referenced object. More...
 
bool hasSubNode (ModuleBase_ITreeNode *theNode, bool allLevels=true) const
 Returns true if the given node is found within children. More...
 
int childrenCount () const
 Returns number of children. More...
 
int nodeRow (ModuleBase_ITreeNode *theNode) const
 
virtual ObjectPtr object () const
 Returns object referenced by the node (can be null) More...
 
virtual ModuleBase_ITreeNodefindRoot (const DocumentPtr &theDoc)
 Returns root node of a data tree of the given document. More...
 
virtual VisibilityState visibilityState () const
 Returns visibilitystate of the node in viewer 3d. More...
 

Static Public Member Functions

static std::string typeId ()
 

Protected Member Functions

virtual ModuleBase_ITreeNodecreateNode (const ObjectPtr &theObj)
 
virtual int numberOfFolders () const
 
virtual void deleteChildren ()
 deletes all children nodes (called in destructor.) More...
 
void sortChildren ()
 

Protected Attributes

ModuleBase_ITreeNodemyParent
 Parent of the node. More...
 
QTreeNodesList myChildren
 Children of the node. More...
 

Detailed Description

Implementation of Root node in data tree.

Member Function Documentation

◆ update()

void PartSet_RootNode::update ( )
virtual

Updates sub-nodes of the node.

Reimplemented from ModuleBase_ITreeNode.

◆ workshop()

virtual ModuleBase_IWorkshop* PartSet_RootNode::workshop ( ) const
inlinevirtual

Returns workshop object. Has to be reimplemented in a root node.

Reimplemented from ModuleBase_ITreeNode.

◆ document()

DocumentPtr PartSet_RootNode::document ( ) const
virtual

Returns document object of the sub-tree.

Reimplemented from ModuleBase_ITreeNode.

◆ objectCreated()

QTreeNodesList PartSet_FeatureFolderNode::objectCreated ( const QObjectPtrList &  theObjects)
virtualinherited

Process creation of objects.

Parameters
theObjectsa list of created objects
Returns
a list of nodes which corresponds to the created objects

Reimplemented from ModuleBase_ITreeNode.

Reimplemented in PartSet_PartRootNode.

◆ objectsDeleted()

QTreeNodesList PartSet_FeatureFolderNode::objectsDeleted ( const DocumentPtr &  theDoc,
const QString &  theGroup 
)
virtualinherited

Process deletion of objects.

Parameters
theDoca document where objects were deleted
theGroupa name of group where objects were deleted

Reimplemented from ModuleBase_ITreeNode.

Reimplemented in PartSet_PartRootNode.

◆ findParent()

ModuleBase_ITreeNode * PartSet_FeatureFolderNode::findParent ( const DocumentPtr &  theDoc,
QString  theGroup 
)
virtualinherited

Returns a node which belongs to the given document and contains objects of the given group.

Parameters
theDoca document
theGroupa name of objects group
Returns
a parent node if it is found

Reimplemented from ModuleBase_ITreeNode.

◆ data()

QVariant PartSet_TreeNode::data ( int  theColumn,
int  theRole 
) const
virtualinherited

Returns the node representation according to theRole.

Reimplemented from ModuleBase_ITreeNode.

Reimplemented in PartSet_StepNode, PartSet_ObjectFolderNode, PartSet_PartRootNode, PartSet_FolderNode, and PartSet_ObjectNode.

◆ flags()

virtual Qt::ItemFlags ModuleBase_ITreeNode::flags ( int  theColumn) const
inlinevirtualinherited

Returns properties flag of the item.

Reimplemented in PartSet_PartRootNode, PartSet_FolderNode, and PartSet_ObjectNode.

◆ parent()

ModuleBase_ITreeNode* ModuleBase_ITreeNode::parent ( ) const
inlineinherited

Returns parent node of the current node.

◆ children()

QTreeNodesList ModuleBase_ITreeNode::children ( ) const
inlineinherited

Returns list of the node children.

◆ subNode() [1/2]

ModuleBase_ITreeNode* ModuleBase_ITreeNode::subNode ( int  theRow) const
inlineinherited

Returns a children node according to given row (index)

◆ subNode() [2/2]

ModuleBase_ITreeNode* ModuleBase_ITreeNode::subNode ( const ObjectPtr &  theObj,
bool  allLevels = true 
) const
inlineinherited

Finds a node which contains the referenced object.

Parameters
theObjan object to find
allLevelsif true then all sub-trees will be processed

◆ hasSubNode()

bool ModuleBase_ITreeNode::hasSubNode ( ModuleBase_ITreeNode theNode,
bool  allLevels = true 
) const
inlineinherited

Returns true if the given node is found within children.

Parameters
theNodea node to find
allLevelsif true then all sub-trees will be processed

◆ childrenCount()

int ModuleBase_ITreeNode::childrenCount ( ) const
inlineinherited

Returns number of children.

◆ object()

virtual ObjectPtr ModuleBase_ITreeNode::object ( ) const
inlinevirtualinherited

Returns object referenced by the node (can be null)

Reimplemented in PartSet_PartRootNode, and PartSet_ObjectNode.

◆ findRoot()

virtual ModuleBase_ITreeNode* ModuleBase_ITreeNode::findRoot ( const DocumentPtr &  theDoc)
inlinevirtualinherited

Returns root node of a data tree of the given document.

Parameters
theDoca document
Returns
a tree node which is a root of the document structure

◆ visibilityState()

virtual VisibilityState ModuleBase_ITreeNode::visibilityState ( ) const
inlinevirtualinherited

Returns visibilitystate of the node in viewer 3d.

Reimplemented in PartSet_StepNode, and PartSet_ObjectNode.

◆ deleteChildren()

virtual void ModuleBase_ITreeNode::deleteChildren ( )
inlineprotectedvirtualinherited

deletes all children nodes (called in destructor.)

Reimplemented in PartSet_PartRootNode.

Field Documentation

◆ myParent

ModuleBase_ITreeNode* ModuleBase_ITreeNode::myParent
protectedinherited

Parent of the node.

◆ myChildren

QTreeNodesList ModuleBase_ITreeNode::myChildren
protectedinherited

Children of the node.