SHAPER  9.12.0
PartSet_PartRootNode Class Reference

Implementation of Root node of a Part document in data tree. More...

Inheritance diagram for PartSet_PartRootNode:
Inheritance graph

Public Types

enum  VisibilityState { NoneState , Visible , SemiVisible , Hidden }
 

Public Member Functions

 PartSet_PartRootNode (const ObjectPtr &theObj, ModuleBase_ITreeNode *theParent)
 
virtual std::string type () const
 
virtual ObjectPtr object () const
 Returns object referenced by the node (can be null) More...
 
virtual DocumentPtr document () const
 Returns document object of the sub-tree. More...
 
virtual void update ()
 Updates sub-nodes of the node. More...
 
virtual QVariant data (int theColumn, int theRole) const
 Returns the node representation according to theRole. More...
 
virtual Qt::ItemFlags flags (int theColumn) const
 Returns properties flag of the item. More...
 
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 QColor activeItemColor () const
 
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 ModuleBase_IWorkshopworkshop () const
 Returns workshop object. Has to be reimplemented in a root node. 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 of a Part document in data tree.

Member Function Documentation

◆ object()

virtual ObjectPtr PartSet_PartRootNode::object ( ) const
inlinevirtual

Returns object referenced by the node (can be null)

Reimplemented from ModuleBase_ITreeNode.

◆ document()

DocumentPtr PartSet_PartRootNode::document ( ) const
virtual

Returns document object of the sub-tree.

Reimplemented from ModuleBase_ITreeNode.

◆ update()

void PartSet_PartRootNode::update ( )
virtual

Updates sub-nodes of the node.

Reimplemented from ModuleBase_ITreeNode.

◆ data()

QVariant PartSet_PartRootNode::data ( int  theColumn,
int  theRole 
) const
virtual

Returns the node representation according to theRole.

Reimplemented from PartSet_TreeNode.

◆ flags()

Qt::ItemFlags PartSet_PartRootNode::flags ( int  theColumn) const
virtual

Returns properties flag of the item.

Reimplemented from ModuleBase_ITreeNode.

◆ objectCreated()

QTreeNodesList PartSet_PartRootNode::objectCreated ( const QObjectPtrList &  theObjects)
virtual

Process creation of objects.

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

Reimplemented from PartSet_FeatureFolderNode.

◆ objectsDeleted()

QTreeNodesList PartSet_PartRootNode::objectsDeleted ( const DocumentPtr &  theDoc,
const QString &  theGroup 
)
virtual

Process deletion of objects.

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

Reimplemented from PartSet_FeatureFolderNode.

◆ deleteChildren()

void PartSet_PartRootNode::deleteChildren ( )
protectedvirtual

deletes all children nodes (called in destructor.)

Reimplemented from ModuleBase_ITreeNode.

◆ 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.

◆ 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.

◆ workshop()

virtual ModuleBase_IWorkshop* ModuleBase_ITreeNode::workshop ( ) const
inlinevirtualinherited

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

Reimplemented in PartSet_RootNode.

◆ 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.

Field Documentation

◆ myParent

ModuleBase_ITreeNode* ModuleBase_ITreeNode::myParent
protectedinherited

Parent of the node.

◆ myChildren

QTreeNodesList ModuleBase_ITreeNode::myChildren
protectedinherited

Children of the node.