SHAPER  9.12.0
PartSet_FeatureFolderNode Class Referenceabstract

A base class for root folders. More...

Inheritance diagram for PartSet_FeatureFolderNode:
Inheritance graph

Public Types

enum  VisibilityState { NoneState , Visible , SemiVisible , Hidden }
 

Public Member Functions

 PartSet_FeatureFolderNode (ModuleBase_ITreeNode *theParent=0)
 
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 std::string type () const =0
 
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 void update ()
 Updates all sub-nodes of the node (checks whole sub-tree) 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. Has to be reimplemented in sub-tree root object. 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...
 

Protected Member Functions

virtual ModuleBase_ITreeNodecreateNode (const ObjectPtr &theObj)=0
 
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

A base class for root folders.

Member Function Documentation

◆ objectCreated()

QTreeNodesList PartSet_FeatureFolderNode::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 ModuleBase_ITreeNode.

Reimplemented in PartSet_PartRootNode.

◆ objectsDeleted()

QTreeNodesList PartSet_FeatureFolderNode::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 ModuleBase_ITreeNode.

Reimplemented in PartSet_PartRootNode.

◆ findParent()

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

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.

◆ update()

virtual void ModuleBase_ITreeNode::update ( )
inlinevirtualinherited

Updates all sub-nodes of the node (checks whole sub-tree)

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

◆ workshop()

virtual ModuleBase_IWorkshop* ModuleBase_ITreeNode::workshop ( ) const
inlinevirtualinherited

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

Reimplemented in PartSet_RootNode.

◆ document()

virtual DocumentPtr ModuleBase_ITreeNode::document ( ) const
inlinevirtualinherited

Returns document object of the sub-tree. Has to be reimplemented in sub-tree root object.

Reimplemented in PartSet_PartRootNode, and 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.

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