|
Open CASCADE Technology
6.7.1
|
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>

Public Member Functions | |
| TDataStd_TreeNode () | |
| Standard_Boolean | Append (const Handle< TDataStd_TreeNode > &Child) |
| Insert the TreeNode <Child> as last child of <me>. If the insertion is successful <me> becomes the Father of <Child>. More... | |
| Standard_Boolean | Prepend (const 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> More... | |
| Standard_Boolean | InsertBefore (const Handle< TDataStd_TreeNode > &Node) |
| Inserts the TreeNode <Node> before <me>. If insertion is successful <me> and <Node> belongs to the same Father. More... | |
| Standard_Boolean | InsertAfter (const Handle< TDataStd_TreeNode > &Node) |
| Inserts the TreeNode <Node> after <me>. If insertion is successful <me> and <Node> belongs to the same Father. More... | |
| Standard_Boolean | Remove () |
| Removes this tree node attribute from its father node. The result is that this attribute becomes a root node. More... | |
| Standard_Integer | 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. More... | |
| Standard_Integer | NbChildren (const Standard_Boolean allLevels=Standard_False) const |
| Returns the number of child nodes. If <allLevels> is true, the method counts children of all levels (children of children ...) More... | |
| Standard_Boolean | IsAscendant (const 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. More... | |
| Standard_Boolean | IsDescendant (const 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. More... | |
| Standard_Boolean | IsRoot () const |
| Returns true if this tree node attribute is the ultimate father in the tree. More... | |
| Handle_TDataStd_TreeNode | Root () const |
| Returns the ultimate father of this tree node attribute. More... | |
| Standard_Boolean | IsFather (const Handle< TDataStd_TreeNode > &of) const |
| Returns true if this tree node attribute is a father of of. More... | |
| Standard_Boolean | IsChild (const Handle< TDataStd_TreeNode > &of) const |
| Returns true if this tree node attribute is a child of of. More... | |
| Standard_Boolean | HasFather () const |
| Returns true if this tree node attribute has a father tree node. More... | |
| Handle_TDataStd_TreeNode | Father () const |
| Returns the father TreeNode of <me>. Null if root. More... | |
| Standard_Boolean | HasNext () const |
| Returns true if this tree node attribute has a next tree node. More... | |
| Handle_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. More... | |
| Standard_Boolean | HasPrevious () const |
| Returns true if this tree node attribute has a previous tree node. More... | |
| Handle_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. More... | |
| Standard_Boolean | HasFirst () const |
| Returns true if this tree node attribute has a first child tree node. More... | |
| Handle_TDataStd_TreeNode | First () const |
| Returns the first child tree node in this tree node object. More... | |
| Standard_Boolean | HasLast () const |
| Returns true if this tree node attribute has a last child tree node. More... | |
| Handle_TDataStd_TreeNode | Last () |
| Returns the last child tree node in this tree node object. More... | |
| Handle_TDataStd_TreeNode | FindLast () |
| Returns the last child tree node in this tree node object. //! to set fields ============= More... | |
| void | SetTreeID (const Standard_GUID &explicitID) |
| void | SetFather (const Handle< TDataStd_TreeNode > &F) |
| void | SetNext (const Handle< TDataStd_TreeNode > &F) |
| void | SetPrevious (const Handle< TDataStd_TreeNode > &F) |
| void | SetFirst (const Handle< TDataStd_TreeNode > &F) |
| void | SetLast (const Handle< TDataStd_TreeNode > &F) |
| TreeNode callback: ================== More... | |
| virtual void | AfterAddition () |
| Connect the TreeNode to its father child list More... | |
| virtual void | BeforeForget () |
| Disconnect the TreeNode from its Father child list More... | |
| virtual void | AfterResume () |
| Reconnect the TreeNode to its father child list. More... | |
| virtual Standard_Boolean | BeforeUndo (const Handle< TDF_AttributeDelta > &anAttDelta, const Standard_Boolean forceIt=Standard_False) |
| Disconnect the TreeNode, if necessary. More... | |
| virtual Standard_Boolean | AfterUndo (const Handle< TDF_AttributeDelta > &anAttDelta, const Standard_Boolean forceIt=Standard_False) |
| Reconnect the TreeNode, if necessary. //! Implementation of Attribute methods: =================================== More... | |
| const Standard_GUID & | ID () const |
| Returns the tree ID (default or explicit one depending onthe Set method used). More... | |
| virtual void | Restore (const Handle< TDF_Attribute > &with) |
| Restores the backuped contents from <anAttribute> into this one. It is used when aborting a transaction. More... | |
| virtual void | Paste (const Handle< TDF_Attribute > &into, const Handle< TDF_RelocationTable > &RT) const |
This method is different from the "Copy" one, <br>
because it is used when copying an attribute from <br>
a source structure into a target structure. This <br>
method may paste the contents of <me> into <br>
<intoAttribute>. <br>
| |
| virtual Handle_TDF_Attribute | NewEmpty () const |
| Returns an new empty attribute from the good end type. It is used by the copy algorithm. More... | |
| virtual void | References (const Handle< TDF_DataSet > &aDataSet) const |
Adds the first level referenced attributes and labels <br>
to <aDataSet>. <br>
| |
| virtual Standard_OStream & | Dump (Standard_OStream &anOS) const |
Dumps the minimum information about <me> on <br>
<aStream>. <br>
| |
Public Member Functions inherited from TDF_Attribute | |
| const TDF_Label | Label () const |
Returns the label to which the attribute is <br>
attached. If the label is not included in a DF, <br>
the label is null. See Label. <br>
Warning | |
| Standard_Integer | Transaction () const |
Returns the transaction index in which the <br>
attribute has been created or modified. <br>
| |
| Standard_Integer | 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. More... | |
| Standard_Boolean | IsValid () const |
Returns true if the attribute is valid; i.e. not a <br>
backuped or removed one. <br>
| |
| Standard_Boolean | IsNew () const |
Returns true if the attribute has no backup <br> | |
| Standard_Boolean | IsForgotten () const |
Returns true if the attribute forgotten status is <br>
set. <br>
| |
| Standard_Boolean | IsAttribute (const Standard_GUID &anID) const |
| Returns true if it exists an associated attribute of <me> with <anID> as ID. More... | |
| Standard_Boolean | FindAttribute (const Standard_GUID &anID, Handle< TDF_Attribute > &anAttribute) const |
Finds an associated attribute of <me>, according <br>
to <anID>. the returned <anAttribute> is a valid <br>
one. The method returns True if found, False <br>
otherwise. A removed attribute cannot be found using <br>
this method. | |
| void | AddAttribute (const Handle< TDF_Attribute > &other) const |
| Adds an Attribute <other> to the label of <me>.Raises if there is already one of the same GUID fhan <other>. More... | |
| Standard_Boolean | ForgetAttribute (const Standard_GUID &aguid) const |
| Forgets the Attribute of GUID <aguid> associated to the label of <me>. Be carefull 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. More... | |
| void | ForgetAllAttributes (const Standard_Boolean clearChildren=Standard_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 mecanisms. Be carefull that if <me> will have a null label after this call More... | |
| virtual void | BeforeRemoval () |
| Something to do before removing an Attribute from a label. More... | |
| virtual Standard_Boolean | AfterRetrieval (const Standard_Boolean forceIt=Standard_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. More... | |
| virtual void | BeforeCommitTransaction () |
| A callback. By default does nothing. It is called by TDF_Data::CommitTransaction() method. More... | |
| void | Backup () |
Backups the attribute. The backuped attribute is <br>
flagged "Backuped" and not "Valid". <br>
| |
| Standard_Boolean | IsBackuped () const |
Returns true if the attribute backup status is <br>
set. This status is set/unset by the <br>
Backup() method. <br>
| |
| virtual Handle_TDF_Attribute | BackupCopy () const |
| Copies the attribute contents into a new other attribute. It is used by Backup(). More... | |
| virtual Handle_TDF_DeltaOnAddition | DeltaOnAddition () 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). More... | |
| virtual Handle_TDF_DeltaOnForget | DeltaOnForget () const |
| Makes an AttributeDelta because <me> has been forgotten. More... | |
| virtual Handle_TDF_DeltaOnResume | DeltaOnResume () const |
| Makes an AttributeDelta because <me> has been resumed. More... | |
| virtual Handle_TDF_DeltaOnModification | DeltaOnModification (const Handle< TDF_Attribute > &anOldAttribute) const |
| Makes a DeltaOnModification between <me> and <anOldAttribute. More... | |
| virtual void | DeltaOnModification (const Handle< TDF_DeltaOnModification > &aDelta) |
| Applies a DeltaOnModification to <me>. More... | |
| virtual Handle_TDF_DeltaOnRemoval | DeltaOnRemoval () const |
| Makes a DeltaOnRemoval on <me> because <me> has disappeared from the DS. More... | |
| Standard_OStream & | operator<< (Standard_OStream &anOS) const |
| virtual void | ExtendedDump (Standard_OStream &anOS, const TDF_IDFilter &aFilter, TDF_AttributeIndexedMap &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. More... | |
| void | Forget (const Standard_Integer aTransaction) |
Forgets the attribute. <aTransaction> is the <br>
current transaction in which the forget is done. A <br>
forgotten attribute is also flagged not "Valid". <br>
| |
Public Member Functions inherited from MMgt_TShared | |
| virtual void | Delete () const |
| Memory deallocator for transient classes. More... | |
Public Member Functions inherited from Standard_Transient | |
| Standard_Transient () | |
| Empty constructor. More... | |
| Standard_Transient (const Standard_Transient &) | |
| Copy constructor – does nothing. More... | |
| Standard_Transient & | operator= (const Standard_Transient &) |
| Assignment operator, needed to avoid copying reference counter. More... | |
| virtual | ~Standard_Transient () |
| Destructor must be virtual. More... | |
| virtual void | ShallowDump (Standard_OStream &) const |
| virtual const Handle_Standard_Type & | DynamicType () const |
| Returns a type information object about this object. More... | |
| Standard_Boolean | IsInstance (const Handle_Standard_Type &theType) const |
| Returns a true value if this is an instance of Type. More... | |
| Standard_Boolean | IsInstance (const Standard_CString theTypeName) const |
| Returns a true value if this is an instance of TypeName. More... | |
| Standard_Boolean | IsKind (const 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. More... | |
| Standard_Boolean | IsKind (const Standard_CString 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. More... | |
| virtual Handle_Standard_Transient | This () const |
| Returns a Handle which references this object. Must never be called to objects created in stack. More... | |
| Standard_Integer | GetRefCount () const |
| Get the reference counter of this object. More... | |
Static Public Member Functions | |
| static Standard_Boolean | Find (const TDF_Label &L, Handle< TDataStd_TreeNode > &T) |
| class methods working on the node =================================== //! Returns true if the tree node T is found on the label L. Otherwise, false is returned. More... | |
| static Handle_TDataStd_TreeNode | Set (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. More... | |
| static Handle_TDataStd_TreeNode | Set (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. More... | |
| static const Standard_GUID & | GetDefaultTreeID () |
| returns a default tree ID. this ID is used by the <Set> method without explicit tree ID. //! Instance methods: ================ More... | |
Additional Inherited Members | |
Protected Member Functions inherited from TDF_Attribute | |
| TDF_Attribute () | |
| Initializes fields. More... | |
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.
| TDataStd_TreeNode::TDataStd_TreeNode | ( | ) |
|
virtual |
Connect the TreeNode to its father child list
Reimplemented from TDF_Attribute.
|
virtual |
Reconnect the TreeNode to its father child list.
Reimplemented from TDF_Attribute.
|
virtual |
Reconnect the TreeNode, if necessary.
//! Implementation of Attribute methods:
===================================
Reimplemented from TDF_Attribute.
| Standard_Boolean TDataStd_TreeNode::Append | ( | const Handle< TDataStd_TreeNode > & | Child | ) |
Insert the TreeNode <Child> as last child of <me>. If
the insertion is successful <me> becomes the Father of <Child>.
|
virtual |
Disconnect the TreeNode from its Father child list
Reimplemented from TDF_Attribute.
|
virtual |
Disconnect the TreeNode, if necessary.
Reimplemented from TDF_Attribute.
| Standard_Integer 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.
|
virtual |
| Handle_TDataStd_TreeNode TDataStd_TreeNode::Father | ( | ) | const |
Returns the father TreeNode of <me>. Null if root.
|
static |
class methods working on the node
===================================
//! Returns true if the tree node T is found on the label L.
Otherwise, false is returned.
| Handle_TDataStd_TreeNode TDataStd_TreeNode::FindLast | ( | ) |
Returns the last child tree node in this tree node object.
//! to set fields
=============
| Handle_TDataStd_TreeNode TDataStd_TreeNode::First | ( | ) | const |
Returns the first child tree node in this tree node object.
|
static |
returns a default tree ID. this ID is used by the
<Set> method without explicit tree ID.
//! Instance methods:
================
| Standard_Boolean TDataStd_TreeNode::HasFather | ( | ) | const |
Returns true if this tree node attribute has a father tree node.
| Standard_Boolean TDataStd_TreeNode::HasFirst | ( | ) | const |
Returns true if this tree node attribute has a first child tree node.
| Standard_Boolean TDataStd_TreeNode::HasLast | ( | ) | const |
Returns true if this tree node attribute has a last child tree node.
| Standard_Boolean TDataStd_TreeNode::HasNext | ( | ) | const |
Returns true if this tree node attribute has a next tree node.
| Standard_Boolean TDataStd_TreeNode::HasPrevious | ( | ) | const |
Returns true if this tree node attribute has a previous tree node.
|
virtual |
Returns the tree ID (default or explicit one depending
onthe Set method used).
Implements TDF_Attribute.
| Standard_Boolean TDataStd_TreeNode::InsertAfter | ( | const Handle< TDataStd_TreeNode > & | Node | ) |
Inserts the TreeNode <Node> after <me>. If insertion is successful <me>
and <Node> belongs to the same Father.
| Standard_Boolean TDataStd_TreeNode::InsertBefore | ( | const Handle< TDataStd_TreeNode > & | Node | ) |
Inserts the TreeNode <Node> before <me>. If insertion is successful <me>
and <Node> belongs to the same Father.
| Standard_Boolean TDataStd_TreeNode::IsAscendant | ( | const 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.
| Standard_Boolean TDataStd_TreeNode::IsChild | ( | const Handle< TDataStd_TreeNode > & | of | ) | const |
Returns true if this tree node attribute is a child of of.
| Standard_Boolean TDataStd_TreeNode::IsDescendant | ( | const 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.
| Standard_Boolean TDataStd_TreeNode::IsFather | ( | const Handle< TDataStd_TreeNode > & | of | ) | const |
Returns true if this tree node attribute is a father of of.
| Standard_Boolean TDataStd_TreeNode::IsRoot | ( | ) | const |
Returns true if this tree node attribute is the
ultimate father in the tree.
| Handle_TDataStd_TreeNode TDataStd_TreeNode::Last | ( | ) |
Returns the last child tree node in this tree node object.
| Standard_Integer TDataStd_TreeNode::NbChildren | ( | const Standard_Boolean | allLevels = Standard_False | ) | const |
Returns the number of child nodes.
If <allLevels> is true, the method counts children of all levels
(children of children ...)
|
virtual |
Returns an new empty attribute from the good end
type. It is used by the copy algorithm.
Implements TDF_Attribute.
| 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.
|
virtual |
This method is different from the "Copy" one, <br>
because it is used when copying an attribute from <br>
a source structure into a target structure. This <br>
method may paste the contents of <me> into <br>
<intoAttribute>. <br>
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.
| Standard_Boolean TDataStd_TreeNode::Prepend | ( | const 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>
| 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.
|
virtual |
Adds the first level referenced attributes and labels <br>
to <aDataSet>. <br>
For this, use the AddLabel or AddAttribute of
DataSet.
If there is none, do not implement the method.
Reimplemented from TDF_Attribute.
| Standard_Boolean TDataStd_TreeNode::Remove | ( | ) |
Removes this tree node attribute from its father
node. The result is that this attribute becomes a root node.
|
virtual |
Restores the backuped contents from <anAttribute>
into this one. It is used when aborting a
transaction.
Implements TDF_Attribute.
| Handle_TDataStd_TreeNode TDataStd_TreeNode::Root | ( | ) | const |
Returns the ultimate father of this tree node attribute.
|
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.
|
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.
| void TDataStd_TreeNode::SetFather | ( | const Handle< TDataStd_TreeNode > & | F | ) |
| void TDataStd_TreeNode::SetFirst | ( | const Handle< TDataStd_TreeNode > & | F | ) |
| void TDataStd_TreeNode::SetLast | ( | const Handle< TDataStd_TreeNode > & | F | ) |
TreeNode callback:
==================
| void TDataStd_TreeNode::SetNext | ( | const Handle< TDataStd_TreeNode > & | F | ) |
| void TDataStd_TreeNode::SetPrevious | ( | const Handle< TDataStd_TreeNode > & | F | ) |
| void TDataStd_TreeNode::SetTreeID | ( | const Standard_GUID & | explicitID | ) |
1.8.5