Open CASCADE Technology 6.6.0
Public Member Functions | Static Public Member Functions
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.

#include <TDataStd_TreeNode.hxx>

Inheritance diagram for TDataStd_TreeNode:
Inheritance graph
[legend]

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

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>

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.

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.

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

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.

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

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.

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.

Standard_Boolean IsRoot () const
 Returns true if this tree node attribute is the
ultimate father in the tree.

Handle_TDataStd_TreeNode Root () const
 Returns the ultimate father of this tree node attribute.

Standard_Boolean IsFather (const Handle< TDataStd_TreeNode > &of) const
 Returns true if this tree node attribute is a father of of.

Standard_Boolean IsChild (const Handle< TDataStd_TreeNode > &of) const
 Returns true if this tree node attribute is a child of of.

Standard_Boolean HasFather () const
 Returns true if this tree node attribute has a father tree node.

Handle_TDataStd_TreeNode Father () const
 Returns the father TreeNode of <me>. Null if root.

Standard_Boolean HasNext () const
 Returns true if this tree node attribute has a next tree node.

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.

Standard_Boolean HasPrevious () const
 Returns true if this tree node attribute has a previous tree node.

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.

Standard_Boolean HasFirst () const
 Returns true if this tree node attribute has a first child tree node.

Handle_TDataStd_TreeNode First () const
 Returns the first child tree node in this tree node object.

Standard_Boolean HasLast () const
 Returns true if this tree node attribute has a last child tree node.

Handle_TDataStd_TreeNode Last ()
 Returns the last child tree node in this tree node object.

Handle_TDataStd_TreeNode FindLast ()
 Returns the last child tree node in this tree node object.
//! to set fields
=============

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:
==================

virtual void AfterAddition ()
 Connect the TreeNode to its father child list

virtual void BeforeForget ()
 Disconnect the TreeNode from its Father child list

virtual void AfterResume ()
 Reconnect the TreeNode to its father child list.

virtual Standard_Boolean BeforeUndo (const Handle< TDF_AttributeDelta > &anAttDelta, const Standard_Boolean forceIt=Standard_False)
 Disconnect the TreeNode, if necessary.

virtual Standard_Boolean AfterUndo (const Handle< TDF_AttributeDelta > &anAttDelta, const Standard_Boolean forceIt=Standard_False)
 Reconnect the TreeNode, if necessary.
//! Implementation of Attribute methods:
===================================

const Standard_GUIDID () const
 Returns the tree ID (default or explicit one depending
onthe Set method used).

virtual void Restore (const Handle< TDF_Attribute > &with)
 Restores the backuped contents from <anAttribute>
into this one. It is used when aborting a
transaction.

virtual void Paste (const Handle< TDF_Attribute > &into, const Handle< TDF_RelocationTable > &RT) const
 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.

virtual Handle_TDF_Attribute NewEmpty () const
 Returns an new empty attribute from the good end
type. It is used by the copy algorithm.

virtual void References (const Handle< TDF_DataSet > &aDataSet) const
 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.

virtual Standard_OStreamDump (Standard_OStream &anOS) const
 Dumps the minimum information about <me> on
<aStream>.


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.

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.

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.

static const Standard_GUIDGetDefaultTreeID ()
 returns a default tree ID. this ID is used by the
<Set> method without explicit tree ID.
//! Instance methods:
================


Constructor & Destructor Documentation

TDataStd_TreeNode::TDataStd_TreeNode ( )

Member Function Documentation

virtual void TDataStd_TreeNode::AfterAddition ( ) [virtual]

Reimplemented from TDF_Attribute.

virtual void TDataStd_TreeNode::AfterResume ( ) [virtual]

Reimplemented from TDF_Attribute.

virtual Standard_Boolean TDataStd_TreeNode::AfterUndo ( const Handle< TDF_AttributeDelta > &  anAttDelta,
const Standard_Boolean  forceIt = Standard_False 
) [virtual]

Reimplemented from TDF_Attribute.

Standard_Boolean TDataStd_TreeNode::Append ( const Handle< TDataStd_TreeNode > &  Child)
virtual void TDataStd_TreeNode::BeforeForget ( ) [virtual]

Reimplemented from TDF_Attribute.

virtual Standard_Boolean TDataStd_TreeNode::BeforeUndo ( const Handle< TDF_AttributeDelta > &  anAttDelta,
const Standard_Boolean  forceIt = Standard_False 
) [virtual]

Reimplemented from TDF_Attribute.

Standard_Integer TDataStd_TreeNode::Depth ( ) const
virtual Standard_OStream& TDataStd_TreeNode::Dump ( Standard_OStream anOS) const [virtual]

Reimplemented from TDF_Attribute.

Handle_TDataStd_TreeNode TDataStd_TreeNode::Father ( ) const
static Standard_Boolean TDataStd_TreeNode::Find ( const TDF_Label L,
Handle< TDataStd_TreeNode > &  T 
) [static]
Handle_TDataStd_TreeNode TDataStd_TreeNode::FindLast ( )
Handle_TDataStd_TreeNode TDataStd_TreeNode::First ( ) const
static const Standard_GUID& TDataStd_TreeNode::GetDefaultTreeID ( ) [static]
Standard_Boolean TDataStd_TreeNode::HasFather ( ) const
Standard_Boolean TDataStd_TreeNode::HasFirst ( ) const
Standard_Boolean TDataStd_TreeNode::HasLast ( ) const
Standard_Boolean TDataStd_TreeNode::HasNext ( ) const
Standard_Boolean TDataStd_TreeNode::HasPrevious ( ) const
const Standard_GUID& TDataStd_TreeNode::ID ( ) const [virtual]

Implements TDF_Attribute.

Standard_Boolean TDataStd_TreeNode::InsertAfter ( const Handle< TDataStd_TreeNode > &  Node)
Standard_Boolean TDataStd_TreeNode::InsertBefore ( const Handle< TDataStd_TreeNode > &  Node)
Standard_Boolean TDataStd_TreeNode::IsAscendant ( const Handle< TDataStd_TreeNode > &  of) const
Standard_Boolean TDataStd_TreeNode::IsChild ( const Handle< TDataStd_TreeNode > &  of) const
Standard_Boolean TDataStd_TreeNode::IsDescendant ( const Handle< TDataStd_TreeNode > &  of) const
Standard_Boolean TDataStd_TreeNode::IsFather ( const Handle< TDataStd_TreeNode > &  of) const
Standard_Boolean TDataStd_TreeNode::IsRoot ( ) const
Handle_TDataStd_TreeNode TDataStd_TreeNode::Last ( )
Standard_Integer TDataStd_TreeNode::NbChildren ( const Standard_Boolean  allLevels = Standard_False) const
virtual Handle_TDF_Attribute TDataStd_TreeNode::NewEmpty ( ) const [virtual]

Implements TDF_Attribute.

Handle_TDataStd_TreeNode TDataStd_TreeNode::Next ( ) const
virtual void TDataStd_TreeNode::Paste ( const Handle< TDF_Attribute > &  intoAttribute,
const Handle< TDF_RelocationTable > &  aRelocationTable 
) const [virtual]

Implements TDF_Attribute.

Standard_Boolean TDataStd_TreeNode::Prepend ( const Handle< TDataStd_TreeNode > &  Child)
Handle_TDataStd_TreeNode TDataStd_TreeNode::Previous ( ) const
virtual void TDataStd_TreeNode::References ( const Handle< TDF_DataSet > &  aDataSet) const [virtual]

Reimplemented from TDF_Attribute.

Standard_Boolean TDataStd_TreeNode::Remove ( )
virtual void TDataStd_TreeNode::Restore ( const Handle< TDF_Attribute > &  anAttribute) [virtual]

Implements TDF_Attribute.

Handle_TDataStd_TreeNode TDataStd_TreeNode::Root ( ) const
static Handle_TDataStd_TreeNode TDataStd_TreeNode::Set ( const TDF_Label L) [static]
static Handle_TDataStd_TreeNode TDataStd_TreeNode::Set ( const TDF_Label L,
const Standard_GUID ExplicitTreeID 
) [static]
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)
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)

The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines