OCCT3D OCCT 8.0.1
OCCT documentation

Search guides and API reference

Enter at least two characters.

    Open CASCADE Technology Reference Manual 8.0.1
    TDataStd_TreeNode Class Reference

    Allows you to define an explicit tree of labels which you can also edit. Without this class, the data structure cannot be fully edited. This service is required if for presentation purposes, you want to create an application with a tree which allows you to organize and link data as a function of application features. More...

    #include <TDataStd_TreeNode.hxx>

    Inheritance diagram for TDataStd_TreeNode:

    Public Member Functions

     TDataStd_TreeNode ()
    bool Append (const occ::handle< TDataStd_TreeNode > &Child)
     Insert the TreeNode <Child> as last child of <me>. If the insertion is successful <me> becomes the Father of <Child>.
    bool Prepend (const occ::handle< TDataStd_TreeNode > &Child)
     Insert the the TreeNode <Child> as first child of <me>. If the insertion is successful <me> becomes the Father of <Child>.
    bool InsertBefore (const occ::handle< TDataStd_TreeNode > &Node)
     Inserts the TreeNode <Node> before <me>. If insertion is successful <me> and <Node> belongs to the same Father.
    bool InsertAfter (const occ::handle< TDataStd_TreeNode > &Node)
     Inserts the TreeNode <Node> after <me>. If insertion is successful <me> and <Node> belongs to the same Father.
    bool Remove ()
     Removes this tree node attribute from its father node. The result is that this attribute becomes a root node.
    int Depth () const
     Returns the depth of this tree node in the overall tree node structure. In other words, the number of father tree nodes of this one is returned.
    int NbChildren (const bool allLevels=false) const
     Returns the number of child nodes. If <allLevels> is true, the method counts children of all levels (children of children ...).
    bool IsAscendant (const occ::handle< TDataStd_TreeNode > &of) const
     Returns true if this tree node attribute is an ascendant of of. In other words, if it is a father or the father of a father of of.
    bool IsDescendant (const occ::handle< TDataStd_TreeNode > &of) const
     Returns true if this tree node attribute is a descendant of of. In other words, if it is a child or the child of a child of of.
    bool IsRoot () const
     Returns true if this tree node attribute is the ultimate father in the tree.
    occ::handle< TDataStd_TreeNodeRoot () const
     Returns the ultimate father of this tree node attribute.
    bool IsFather (const occ::handle< TDataStd_TreeNode > &of) const
     Returns true if this tree node attribute is a father of of.
    bool IsChild (const occ::handle< TDataStd_TreeNode > &of) const
     Returns true if this tree node attribute is a child of of.
    bool HasFather () const
     Returns true if this tree node attribute has a father tree node.
    occ::handle< TDataStd_TreeNodeFather () const
     Returns the father TreeNode of <me>. Null if root.
    bool HasNext () const
     Returns true if this tree node attribute has a next tree node.
    occ::handle< TDataStd_TreeNodeNext () const
     Returns the next tree node in this tree node attribute. Warning This tree node is null if it is the last one in this tree node attribute.Returns the next TreeNode of <me>. Null if last.
    bool HasPrevious () const
     Returns true if this tree node attribute has a previous tree node.
    occ::handle< TDataStd_TreeNodePrevious () const
     Returns the previous tree node of this tree node attribute. Warning This tree node is null if it is the first one in this tree node attribute.
    bool HasFirst () const
     Returns true if this tree node attribute has a first child tree node.
    occ::handle< TDataStd_TreeNodeFirst () const
     Returns the first child tree node in this tree node object.
    bool HasLast () const
     Returns true if this tree node attribute has a last child tree node.
    occ::handle< TDataStd_TreeNodeLast ()
     Returns the last child tree node in this tree node object.
    occ::handle< TDataStd_TreeNodeFindLast ()
     Returns the last child tree node in this tree node object.
    void SetTreeID (const Standard_GUID &explicitID)
    void SetFather (const occ::handle< TDataStd_TreeNode > &F)
    void SetNext (const occ::handle< TDataStd_TreeNode > &F)
    void SetPrevious (const occ::handle< TDataStd_TreeNode > &F)
    void SetFirst (const occ::handle< TDataStd_TreeNode > &F)
    void SetLast (const occ::handle< TDataStd_TreeNode > &F)
    void AfterAddition () override
     Connect the TreeNode to its father child list.
    void BeforeForget () override
     Disconnect the TreeNode from its Father child list.
    void AfterResume () override
     Reconnect the TreeNode to its father child list.
    bool BeforeUndo (const occ::handle< TDF_AttributeDelta > &anAttDelta, const bool forceIt=false) override
     Disconnect the TreeNode, if necessary.
    bool AfterUndo (const occ::handle< TDF_AttributeDelta > &anAttDelta, const bool forceIt=false) override
     Reconnect the TreeNode, if necessary.
    const Standard_GUIDID () const override
     Returns the tree ID (default or explicit one depending on the Set method used).
    void Restore (const occ::handle< TDF_Attribute > &with) override
     Restores the backuped contents from <anAttribute> into this one. It is used when aborting a transaction.
    void Paste (const occ::handle< TDF_Attribute > &into, const occ::handle< TDF_RelocationTable > &RT) const override
     This method is different from the "Copy" one, because it is used when copying an attribute from a source structure into a target structure. This method may paste the contents of <me> into <intoAttribute>.
    occ::handle< TDF_AttributeNewEmpty () const override
     Returns an new empty attribute from the good end type. It is used by the copy algorithm.
    void References (const occ::handle< TDF_DataSet > &aDataSet) const override
     Adds the first level referenced attributes and labels to <aDataSet>.
    Standard_OStreamDump (Standard_OStream &anOS) const override
     Dumps the minimum information about <me> on <aStream>.
    void DumpJson (Standard_OStream &theOStream, int theDepth=-1) const override
     Dumps the content of me into the stream.
    Public Member Functions inherited from TDF_Attribute
    virtual void SetID (const Standard_GUID &)
     Sets specific ID of the attribute (supports several attributes of one type at the same label feature).
    virtual void SetID ()
     Sets default ID defined in nested class (to be used for attributes having User ID feature).
    const TDF_Label Label () const
     Returns the label to which the attribute is attached. If the label is not included in a DF, the label is null. See Label. Warning: If the label is not included in a data framework, it is null. This function should not be redefined inline.
    int Transaction () const
     Returns the transaction index in which the attribute has been created or modified.
    int UntilTransaction () const
     Returns the upper transaction index until which the attribute is/was valid. This number may vary. A removed attribute validity range is reduced to its transaction index.
    bool IsValid () const
     Returns true if the attribute is valid; i.e. not a backuped or removed one.
    bool IsNew () const
     Returns true if the attribute has no backup.
    bool IsForgotten () const
     Returns true if the attribute forgotten status is set.
    bool IsAttribute (const Standard_GUID &anID) const
     Returns true if it exists an associated attribute of <me> with <anID> as ID.
    bool FindAttribute (const Standard_GUID &anID, occ::handle< TDF_Attribute > &anAttribute) const
     Finds an associated attribute of <me>, according to <anID>. the returned <anAttribute> is a valid one. The method returns True if found, False otherwise. A removed attribute cannot be found using this method.
    template<class T>
    bool FindAttribute (const Standard_GUID &theID, occ::handle< T > &theAttr) const
     Safe variant for arbitrary type of argument.
    void AddAttribute (const occ::handle< TDF_Attribute > &other) const
     Adds an Attribute <other> to the label of <me>. Raises if there is already one of the same GUID than <other>.
    bool ForgetAttribute (const Standard_GUID &aguid) const
     Forgets the Attribute of GUID <aguid> associated to the label of <me>. Be careful that if <me> is the attribute of <guid>, <me> will have a null label after this call. If the attribute doesn't exist returns False. Otherwise returns True.
    void ForgetAllAttributes (const bool clearChildren=true) const
     Forgets all the attributes attached to the label of <me>. Does it on the sub-labels if <clearChildren> is set to true. Of course, this method is compatible with Transaction & Delta mechanisms. Be careful that if <me> will have a null label after this call.
    virtual void BeforeRemoval ()
     Something to do before removing an Attribute from a label.
    virtual bool AfterRetrieval (const bool forceIt=false)
     Something to do AFTER creation of an attribute by persistent-transient translation. The returned status says if AfterUndo has been performed (true) or if this callback must be called once again further (false). If <forceIt> is set to true, the method MUST perform and return true. Does nothing by default and returns true.
    virtual void BeforeCommitTransaction ()
     A callback. By default does nothing. It is called by TDF_Data::CommitTransaction() method.
    void Backup ()
     Backups the attribute. The backuped attribute is flagged "Backuped" and not "Valid".
    bool IsBackuped () const
     Returns true if the attribute backup status is set. This status is set/unset by the Backup() method.
    virtual occ::handle< TDF_AttributeBackupCopy () const
     Copies the attribute contents into a new other attribute. It is used by Backup().
    virtual occ::handle< TDF_DeltaOnAdditionDeltaOnAddition () const
     Makes an AttributeDelta because <me> appeared. The only known use of a redefinition of this method is to return a null handle (no delta).
    virtual occ::handle< TDF_DeltaOnForgetDeltaOnForget () const
     Makes an AttributeDelta because <me> has been forgotten.
    virtual occ::handle< TDF_DeltaOnResumeDeltaOnResume () const
     Makes an AttributeDelta because <me> has been resumed.
    virtual occ::handle< TDF_DeltaOnModificationDeltaOnModification (const occ::handle< TDF_Attribute > &anOldAttribute) const
     Makes a DeltaOnModification between <me> and.
    virtual void DeltaOnModification (const occ::handle< TDF_DeltaOnModification > &aDelta)
     Applies a DeltaOnModification to <me>.
    virtual occ::handle< TDF_DeltaOnRemovalDeltaOnRemoval () const
     Makes a DeltaOnRemoval on <me> because <me> has disappeared from the DS.
    Standard_OStreamoperator<< (Standard_OStream &anOS) const
    virtual void ExtendedDump (Standard_OStream &anOS, const TDF_IDFilter &aFilter, NCollection_IndexedMap< occ::handle< TDF_Attribute > > &aMap) const
     Dumps the attribute content on <aStream>, using <aMap> like this: if an attribute is not in the map, first put add it to the map and then dump it. Use the map rank instead of dumping each attribute field.
    void Forget (const int aTransaction)
     Forgets the attribute. <aTransaction> is the current transaction in which the forget is done. A forgotten attribute is also flagged not "Valid".
    Public Member Functions inherited from Standard_Transient
     Standard_Transient ()
     Empty constructor.
     Standard_Transient (const Standard_Transient &)
     Copy constructor – does nothing.
    Standard_Transientoperator= (const Standard_Transient &)
     Assignment operator, needed to avoid copying reference counter.
    virtual ~Standard_Transient ()=default
     Destructor must be virtual.
    virtual const opencascade::handle< Standard_Type > & DynamicType () const
     Returns a type descriptor about this object.
    bool IsInstance (const opencascade::handle< Standard_Type > &theType) const
     Returns a true value if this is an instance of Type.
    bool IsInstance (const char *const theTypeName) const
     Returns a true value if this is an instance of TypeName.
    bool IsKind (const opencascade::handle< Standard_Type > &theType) const
     Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism.
    bool IsKind (const char *const theTypeName) const
     Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism.
    Standard_TransientThis () const
     Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero.
    int GetRefCount () const noexcept
     Get the reference counter of this object.
    void IncrementRefCounter () noexcept
     Increments the reference counter of this object. Uses relaxed memory ordering since incrementing only requires atomicity, not synchronization with other memory operations.
    int DecrementRefCounter () noexcept
     Decrements the reference counter of this object; returns the decremented value. Uses release ordering for the decrement to ensure all writes to the object are visible before the count reaches zero. An acquire fence is added only when the count reaches zero, ensuring proper synchronization before deletion. This is more efficient than using acq_rel for every decrement.
    virtual void Delete () const
     Memory deallocator for transient classes.

    Static Public Member Functions

    static bool Find (const TDF_Label &L, occ::handle< TDataStd_TreeNode > &T)
    static occ::handle< TDataStd_TreeNodeSet (const TDF_Label &L)
     Finds or Creates a TreeNode attribute on the label <L> with the default tree ID, returned by the method <GetDefaultTreeID>. Returns the created/found TreeNode attribute.
    static occ::handle< TDataStd_TreeNodeSet (const TDF_Label &L, const Standard_GUID &ExplicitTreeID)
     Finds or Creates a TreeNode attribute on the label <L>, with an explicit tree ID. <ExplicitTreeID> is the ID returned by <TDF_Attribute::ID> method. Returns the found/created TreeNode attribute.
    static const Standard_GUIDGetDefaultTreeID ()
     returns a default tree ID. this ID is used by the <Set> method without explicit tree ID.
    static constexpr const char * get_type_name ()
     Returns a type descriptor about this object.
    static const opencascade::handle< Standard_Type > & get_type_descriptor ()
     Returns type descriptor of Standard_Transient class.

    Additional Inherited Members

    typedef void base_type
     Returns a type descriptor about this object.
    Protected Member Functions inherited from TDF_Attribute
     TDF_Attribute ()
     Initializes fields.

    Detailed Description

    Allows you to define an explicit tree of labels which you can also edit. Without this class, the data structure cannot be fully edited. This service is required if for presentation purposes, you want to create an application with a tree which allows you to organize and link data as a function of application features.

    Constructor & Destructor Documentation

    ◆ TDataStd_TreeNode()

    TDataStd_TreeNode::TDataStd_TreeNode ( )

    Member Function Documentation

    ◆ AfterAddition()

    void TDataStd_TreeNode::AfterAddition ( )
    overridevirtual

    Connect the TreeNode to its father child list.

    Reimplemented from TDF_Attribute.

    ◆ AfterResume()

    void TDataStd_TreeNode::AfterResume ( )
    overridevirtual

    Reconnect the TreeNode to its father child list.

    Reimplemented from TDF_Attribute.

    ◆ AfterUndo()

    bool TDataStd_TreeNode::AfterUndo ( const occ::handle< TDF_AttributeDelta > & anAttDelta,
    const bool forceIt = false )
    overridevirtual

    Reconnect the TreeNode, if necessary.

    Implementation of Attribute methods:

    Reimplemented from TDF_Attribute.

    ◆ Append()

    bool TDataStd_TreeNode::Append ( const occ::handle< TDataStd_TreeNode > & Child)

    Insert the TreeNode <Child> as last child of <me>. If the insertion is successful <me> becomes the Father of <Child>.

    ◆ BeforeForget()

    void TDataStd_TreeNode::BeforeForget ( )
    overridevirtual

    Disconnect the TreeNode from its Father child list.

    Reimplemented from TDF_Attribute.

    ◆ BeforeUndo()

    bool TDataStd_TreeNode::BeforeUndo ( const occ::handle< TDF_AttributeDelta > & anAttDelta,
    const bool forceIt = false )
    overridevirtual

    Disconnect the TreeNode, if necessary.

    Reimplemented from TDF_Attribute.

    ◆ Depth()

    int TDataStd_TreeNode::Depth ( ) const

    Returns the depth of this tree node in the overall tree node structure. In other words, the number of father tree nodes of this one is returned.

    ◆ Dump()

    Standard_OStream & TDataStd_TreeNode::Dump ( Standard_OStream & anOS) const
    overridevirtual

    Dumps the minimum information about <me> on <aStream>.

    Reimplemented from TDF_Attribute.

    ◆ DumpJson()

    void TDataStd_TreeNode::DumpJson ( Standard_OStream & theOStream,
    int theDepth = -1 ) const
    overridevirtual

    Dumps the content of me into the stream.

    Reimplemented from TDF_Attribute.

    ◆ Father()

    occ::handle< TDataStd_TreeNode > TDataStd_TreeNode::Father ( ) const

    Returns the father TreeNode of <me>. Null if root.

    ◆ Find()

    bool TDataStd_TreeNode::Find ( const TDF_Label & L,
    occ::handle< TDataStd_TreeNode > & T )
    static

    class methods working on the node

    Returns true if the tree node T is found on the label L. Otherwise, false is returned.

    ◆ FindLast()

    occ::handle< TDataStd_TreeNode > TDataStd_TreeNode::FindLast ( )

    Returns the last child tree node in this tree node object.

    to set fields

    ◆ First()

    occ::handle< TDataStd_TreeNode > TDataStd_TreeNode::First ( ) const

    Returns the first child tree node in this tree node object.

    ◆ GetDefaultTreeID()

    const Standard_GUID & TDataStd_TreeNode::GetDefaultTreeID ( )
    static

    returns a default tree ID. this ID is used by the <Set> method without explicit tree ID.

    Instance methods:

    ◆ HasFather()

    bool TDataStd_TreeNode::HasFather ( ) const

    Returns true if this tree node attribute has a father tree node.

    ◆ HasFirst()

    bool TDataStd_TreeNode::HasFirst ( ) const

    Returns true if this tree node attribute has a first child tree node.

    ◆ HasLast()

    bool TDataStd_TreeNode::HasLast ( ) const

    Returns true if this tree node attribute has a last child tree node.

    ◆ HasNext()

    bool TDataStd_TreeNode::HasNext ( ) const

    Returns true if this tree node attribute has a next tree node.

    ◆ HasPrevious()

    bool TDataStd_TreeNode::HasPrevious ( ) const

    Returns true if this tree node attribute has a previous tree node.

    ◆ ID()

    const Standard_GUID & TDataStd_TreeNode::ID ( ) const
    overridevirtual

    Returns the tree ID (default or explicit one depending on the Set method used).

    Implements TDF_Attribute.

    ◆ InsertAfter()

    bool TDataStd_TreeNode::InsertAfter ( const occ::handle< TDataStd_TreeNode > & Node)

    Inserts the TreeNode <Node> after <me>. If insertion is successful <me> and <Node> belongs to the same Father.

    ◆ InsertBefore()

    bool TDataStd_TreeNode::InsertBefore ( const occ::handle< TDataStd_TreeNode > & Node)

    Inserts the TreeNode <Node> before <me>. If insertion is successful <me> and <Node> belongs to the same Father.

    ◆ IsAscendant()

    bool TDataStd_TreeNode::IsAscendant ( const occ::handle< TDataStd_TreeNode > & of) const

    Returns true if this tree node attribute is an ascendant of of. In other words, if it is a father or the father of a father of of.

    ◆ IsChild()

    bool TDataStd_TreeNode::IsChild ( const occ::handle< TDataStd_TreeNode > & of) const

    Returns true if this tree node attribute is a child of of.

    ◆ IsDescendant()

    bool TDataStd_TreeNode::IsDescendant ( const occ::handle< TDataStd_TreeNode > & of) const

    Returns true if this tree node attribute is a descendant of of. In other words, if it is a child or the child of a child of of.

    ◆ IsFather()

    bool TDataStd_TreeNode::IsFather ( const occ::handle< TDataStd_TreeNode > & of) const

    Returns true if this tree node attribute is a father of of.

    ◆ IsRoot()

    bool TDataStd_TreeNode::IsRoot ( ) const

    Returns true if this tree node attribute is the ultimate father in the tree.

    ◆ Last()

    occ::handle< TDataStd_TreeNode > TDataStd_TreeNode::Last ( )

    Returns the last child tree node in this tree node object.

    ◆ NbChildren()

    int TDataStd_TreeNode::NbChildren ( const bool allLevels = false) const

    Returns the number of child nodes. If <allLevels> is true, the method counts children of all levels (children of children ...).

    ◆ NewEmpty()

    occ::handle< TDF_Attribute > TDataStd_TreeNode::NewEmpty ( ) const
    overridevirtual

    Returns an new empty attribute from the good end type. It is used by the copy algorithm.

    Implements TDF_Attribute.

    ◆ Next()

    occ::handle< TDataStd_TreeNode > TDataStd_TreeNode::Next ( ) const

    Returns the next tree node in this tree node attribute. Warning This tree node is null if it is the last one in this tree node attribute.Returns the next TreeNode of <me>. Null if last.

    ◆ Paste()

    void TDataStd_TreeNode::Paste ( const occ::handle< TDF_Attribute > & intoAttribute,
    const occ::handle< TDF_RelocationTable > & aRelocationTable ) const
    overridevirtual

    This method is different from the "Copy" one, because it is used when copying an attribute from a source structure into a target structure. This method may paste the contents of <me> into <intoAttribute>.

    The given pasted attribute can be full or empty of its contents. But don't make a NEW! Just set the contents!

    It is possible to use <aRelocationTable> to get/set the relocation value of a source attribute.

    Implements TDF_Attribute.

    ◆ Prepend()

    bool TDataStd_TreeNode::Prepend ( const occ::handle< TDataStd_TreeNode > & Child)

    Insert the the TreeNode <Child> as first child of <me>. If the insertion is successful <me> becomes the Father of <Child>.

    ◆ Previous()

    occ::handle< TDataStd_TreeNode > TDataStd_TreeNode::Previous ( ) const

    Returns the previous tree node of this tree node attribute. Warning This tree node is null if it is the first one in this tree node attribute.

    ◆ References()

    void TDataStd_TreeNode::References ( const occ::handle< TDF_DataSet > & aDataSet) const
    overridevirtual

    Adds the first level referenced attributes and labels to <aDataSet>.

    For this, use the AddLabel or AddAttribute of DataSet.

    If there is none, do not implement the method.

    Reimplemented from TDF_Attribute.

    ◆ Remove()

    bool TDataStd_TreeNode::Remove ( )

    Removes this tree node attribute from its father node. The result is that this attribute becomes a root node.

    ◆ Restore()

    void TDataStd_TreeNode::Restore ( const occ::handle< TDF_Attribute > & anAttribute)
    overridevirtual

    Restores the backuped contents from <anAttribute> into this one. It is used when aborting a transaction.

    Implements TDF_Attribute.

    ◆ Root()

    occ::handle< TDataStd_TreeNode > TDataStd_TreeNode::Root ( ) const

    Returns the ultimate father of this tree node attribute.

    ◆ Set() [1/2]

    occ::handle< TDataStd_TreeNode > TDataStd_TreeNode::Set ( const TDF_Label & L)
    static

    Finds or Creates a TreeNode attribute on the label <L> with the default tree ID, returned by the method <GetDefaultTreeID>. Returns the created/found TreeNode attribute.

    ◆ Set() [2/2]

    occ::handle< TDataStd_TreeNode > TDataStd_TreeNode::Set ( const TDF_Label & L,
    const Standard_GUID & ExplicitTreeID )
    static

    Finds or Creates a TreeNode attribute on the label <L>, with an explicit tree ID. <ExplicitTreeID> is the ID returned by <TDF_Attribute::ID> method. Returns the found/created TreeNode attribute.

    ◆ SetFather()

    void TDataStd_TreeNode::SetFather ( const occ::handle< TDataStd_TreeNode > & F)

    ◆ SetFirst()

    void TDataStd_TreeNode::SetFirst ( const occ::handle< TDataStd_TreeNode > & F)

    ◆ SetLast()

    void TDataStd_TreeNode::SetLast ( const occ::handle< TDataStd_TreeNode > & F)

    TreeNode callback:

    ◆ SetNext()

    void TDataStd_TreeNode::SetNext ( const occ::handle< TDataStd_TreeNode > & F)

    ◆ SetPrevious()

    void TDataStd_TreeNode::SetPrevious ( const occ::handle< TDataStd_TreeNode > & F)

    ◆ SetTreeID()

    void TDataStd_TreeNode::SetTreeID ( const Standard_GUID & explicitID)

    The documentation for this class was generated from the following file: