SHAPER  9.12.0
PartSet_StepNode Class Reference

Implementation of a node for compsolid representation. More...

Inheritance diagram for PartSet_StepNode:
Inheritance graph

Public Types

enum  VisibilityState { NoneState , Visible , SemiVisible , Hidden }
 

Public Member Functions

 PartSet_StepNode (const ObjectPtr &theObj, ModuleBase_ITreeNode *theParent)
 
virtual std::string type () const
 
virtual QVariant data (int theColumn, int theRole) const
 Returns the node representation according to theRole. More...
 
virtual VisibilityState visibilityState () const
 Returns visibilitystate of the node in viewer 3d. More...
 
virtual Qt::ItemFlags flags (int theColumn) const
 Returns properties flag of the item. More...
 
virtual ObjectPtr object () const
 Returns object referenced by the node (can be null) More...
 
void setObject (ObjectPtr theObj)
 Sets an object to the node theObj a new object. More...
 
virtual void update ()
 Updates sub-nodes of the node. 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 int numberOfSubs () const
 Returns number of sub-objects of the current object. More...
 
virtual ObjectPtr subObject (int theId) const
 
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 DocumentPtr document () const
 Returns document object of the sub-tree. Has to be reimplemented in sub-tree root object. 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 ModuleBase_ITreeNodefindRoot (const DocumentPtr &theDoc)
 Returns root node of a data tree of the given document. More...
 

Static Public Member Functions

static std::string typeId ()
 

Protected Member Functions

virtual void deleteChildren ()
 deletes all children nodes (called in destructor.) More...
 
void sortChildren ()
 

Protected Attributes

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

Detailed Description

Implementation of a node for compsolid representation.

Member Function Documentation

◆ data()

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

Returns the node representation according to theRole.

Reimplemented from PartSet_ObjectNode.

◆ visibilityState()

ModuleBase_ITreeNode::VisibilityState PartSet_StepNode::visibilityState ( ) const
virtual

Returns visibilitystate of the node in viewer 3d.

Reimplemented from PartSet_ObjectNode.

◆ flags()

Qt::ItemFlags PartSet_ObjectNode::flags ( int  theColumn) const
virtualinherited

Returns properties flag of the item.

Reimplemented from ModuleBase_ITreeNode.

◆ object()

virtual ObjectPtr PartSet_ObjectNode::object ( ) const
inlinevirtualinherited

Returns object referenced by the node (can be null)

Reimplemented from ModuleBase_ITreeNode.

◆ setObject()

void PartSet_ObjectNode::setObject ( ObjectPtr  theObj)
inlineinherited

Sets an object to the node theObj a new object.

◆ update()

void PartSet_ObjectNode::update ( )
virtualinherited

Updates sub-nodes of the node.

Reimplemented from ModuleBase_ITreeNode.

Reimplemented in PartSet_ObjectFolderNode.

◆ objectCreated()

QTreeNodesList PartSet_ObjectNode::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_ObjectFolderNode.

◆ objectsDeleted()

QTreeNodesList PartSet_ObjectNode::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_ObjectFolderNode.

◆ numberOfSubs()

int PartSet_ObjectNode::numberOfSubs ( ) const
virtualinherited

Returns number of sub-objects of the current object.

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

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

◆ findParent()

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

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 in PartSet_FeatureFolderNode, and PartSet_FolderNode.

◆ 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

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