Open CASCADE Technology  6.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions
TDF_Label Class Reference

This class provides basic operations to define
a label in a data structure.
A label is a feature in the feature hierarchy. A
label is always connected to a Data from TDF.
To a label is attached attributes containing the
software components information.

Label information:

It is possible to know the tag, the father, the
depth in the tree of the label, if the label is
root, null or equal to another label.

Comfort methods:
Some methods useful on a label.

Attributes:

It is possible to get an attribute in accordance
to an ID, or the yougest previous version of a
current attribute.
More...

#include <TDF_Label.hxx>

Public Member Functions

 TDF_Label ()
 Constructs an empty label object.
More...
 
void Nullify ()
 
 Nullifies the label. <br>


More...

 
Handle_TDF_Data Data () const
 
 Returns the Data owning <me>. <br>


More...

 
Standard_Integer Tag () const
 
 Returns the tag of the label. <br>

This is the integer assigned randomly to a label
in a data framework. This integer is used to
identify this label in an entry.

More...

 
const TDF_Label Father () const
 
 Returns the label father. This label may be null <br>
     if the label is root. <br>


More...

 
Standard_Boolean IsNull () const
 
 Returns True if the <aLabel> is null, i.e. it has <br>
     not been included in the data framework. <br>


More...

 
void Imported (const Standard_Boolean aStatus) const
 Sets or unsets <me> and all its descendants as
imported label, according to <aStatus>.
More...
 
Standard_Boolean IsImported () const
 
 Returns True if the <aLabel> is imported. <br>


More...

 
Standard_Boolean IsEqual (const TDF_Label &aLabel) const
 Returns True if the <aLabel> is equal to me (same
LabelNode*).
More...
 
Standard_Boolean operator== (const TDF_Label &aLabel) const
 
Standard_Boolean IsDifferent (const TDF_Label &aLabel) const
 
Standard_Boolean operator!= (const TDF_Label &aLabel) const
 
Standard_Boolean IsRoot () const
 
Standard_Boolean IsAttribute (const Standard_GUID &anID) const
 Returns true if <me> owns an attribute with <anID> as ID.
More...
 
void AddAttribute (const Handle< TDF_Attribute > &anAttribute) const
 Adds an Attribute to the current label. Raises if
there is already one.
More...
 
void ForgetAttribute (const Handle< TDF_Attribute > &anAttribute) const
 Forgets an Attribute from the current label,
setting its forgotten status true and its valid
status false. Raises if the attribute is not in
the structure.
More...
 
Standard_Boolean ForgetAttribute (const Standard_GUID &aguid) const
 Forgets the Attribute of GUID <aguid> from the
current label . 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. Does it on also on the
sub-labels if <clearChildren> is set to true. Of
course, this method is compatible with Transaction
& Delta mecanisms.
More...
 
void ResumeAttribute (const Handle< TDF_Attribute > &anAttribute) const
 Undo Forget action, setting its forgotten status
false and its valid status true. Raises if the
attribute is not in the structure.
More...
 
Standard_Boolean FindAttribute (const Standard_GUID &anID, Handle< TDF_Attribute > &anAttribute) const
 
 Finds an attribute of the current label, according <br>
     to <anID>. <br>

If anAttribute is not a valid one, false is returned.

The method returns True if found, False otherwise.

A removed attribute cannot be found.
More...

 
Standard_Boolean FindAttribute (const Standard_GUID &anID, const Standard_Integer aTransaction, Handle< TDF_Attribute > &anAttribute) const
 
 Finds an attribute of the current label, according <br>
     to <anID> and <aTransaction>. This attribute <br>
     has/had to be a valid one for the given <br>
     transaction index . So, this attribute is not <br>
     necessary a valid one. <br>


The method returns True if found, False otherwise.

A removed attribute cannot be found nor a backuped
attribute of a removed one.
More...

 
Standard_Boolean MayBeModified () const
 
 Returns true if <me> or a DESCENDANT of <me> owns <br>
     attributes not yet available in transaction 0. It <br>
     means at least one of their attributes is new, <br>
     modified or deleted. <br>


More...

 
Standard_Boolean AttributesModified () const
 
 Returns true if <me> owns attributes not yet <br>
     available in transaction 0. It means at least one <br>
     attribute is new, modified or deleted. <br>


More...

 
Standard_Boolean HasAttribute () const
 Returns true if this label has at least one attribute.
More...
 
Standard_Integer NbAttributes () const
 Returns the number of attributes.
More...
 
Standard_Integer Depth () const
 
 Returns the depth of the label in the data framework. <br>

This corresponds to the number of fathers which
this label has, and is used in determining
whether a label is root, null or equivalent to another label.
Exceptions:
Standard_NullObject if this label is null. This is
because a null object can have no depth.
More...

 
Standard_Boolean IsDescendant (const TDF_Label &aLabel) const
 Returns True if <me> is a descendant of
<aLabel>. Attention: every label is its own
descendant.
More...
 
const TDF_Label Root () const
 
 Returns the root label Root of the data structure. <br>

This has a depth of 0.
Exceptions:
Standard_NullObject if this label is null. This is
because a null object can have no depth.
More...

 
Standard_Boolean HasChild () const
 Returns true if this label has at least one child.
More...
 
Standard_Integer NbChildren () const
 Returns the number of children.
More...
 
TDF_Label FindChild (const Standard_Integer aTag, const Standard_Boolean create=Standard_True) const
 
 Finds a child label having <aTag> as tag. Creates <br>

The tag aTag identifies the label which will be the parent.
If create is true and no child label is found, a new one is created.
Example:
//creating a label with tag 10 at Root
TDF_Label lab1 = aDF->Root().FindChild(10);
//creating labels 7 and 2 on label 10
TDF_Label lab2 = lab1.FindChild(7);
TDF_Label lab3 = lab1.FindChild(2);
More...

 
TDF_Label NewChild () const
 Create a new child label of me using autoamtic
delivery tags provided by TagSource.
More...
 
Standard_Integer Transaction () const
 Returns the current transaction index.
More...
 
Standard_Boolean HasLowerNode (const TDF_Label &otherLabel) const
 
 Returns true if node address of <me> is lower than <br>
     <otherLabel> one. Used to quickly sort labels (not <br>
     on entry criterion). <br>


-C++: inline
More...

 
Standard_Boolean HasGreaterNode (const TDF_Label &otherLabel) const
 
 Returns true if node address of <me> is greater <br>
     than <otherLabel> one. Used to quickly sort labels <br>
     (not on entry criterion). <br>


-C++: inline
More...

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


More...

 
Standard_OStreamoperator<< (Standard_OStream &anOS) const
 
void ExtendedDump (Standard_OStream &anOS, const TDF_IDFilter &aFilter, TDF_AttributeIndexedMap &aMap) const
 Dumps the label on <aStream> and its attributes
rank in <aMap> if their IDs are kept by <IDFilter>.
More...
 
void EntryDump (Standard_OStream &anOS) const
 Dumps the label entry.
More...
 

Detailed Description

This class provides basic operations to define
a label in a data structure.
A label is a feature in the feature hierarchy. A
label is always connected to a Data from TDF.
To a label is attached attributes containing the
software components information.

Label information:

It is possible to know the tag, the father, the
depth in the tree of the label, if the label is
root, null or equal to another label.

Comfort methods:
Some methods useful on a label.

Attributes:

It is possible to get an attribute in accordance
to an ID, or the yougest previous version of a
current attribute.

Constructor & Destructor Documentation

TDF_Label::TDF_Label ( )

Constructs an empty label object.

Member Function Documentation

void TDF_Label::AddAttribute ( const Handle< TDF_Attribute > &  anAttribute) const

Adds an Attribute to the current label. Raises if
there is already one.

Standard_Boolean TDF_Label::AttributesModified ( ) const

 Returns true if <me> owns attributes not yet <br>
     available in transaction 0. It means at least one <br>
     attribute is new, modified or deleted. <br>


Handle_TDF_Data TDF_Label::Data ( ) const

 Returns the Data owning <me>. <br>


Standard_Integer TDF_Label::Depth ( ) const

 Returns the depth of the label in the data framework. <br>

This corresponds to the number of fathers which
this label has, and is used in determining
whether a label is root, null or equivalent to another label.
Exceptions:
Standard_NullObject if this label is null. This is
because a null object can have no depth.

Standard_OStream& TDF_Label::Dump ( Standard_OStream anOS) const

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


void TDF_Label::EntryDump ( Standard_OStream anOS) const

Dumps the label entry.

void TDF_Label::ExtendedDump ( Standard_OStream anOS,
const TDF_IDFilter aFilter,
TDF_AttributeIndexedMap aMap 
) const

Dumps the label on <aStream> and its attributes
rank in <aMap> if their IDs are kept by <IDFilter>.

const TDF_Label TDF_Label::Father ( ) const

 Returns the label father. This label may be null <br>
     if the label is root. <br>


Standard_Boolean TDF_Label::FindAttribute ( const Standard_GUID anID,
Handle< TDF_Attribute > &  anAttribute 
) const

 Finds an attribute of the current label, according <br>
     to <anID>. <br>

If anAttribute is not a valid one, false is returned.

The method returns True if found, False otherwise.

A removed attribute cannot be found.

Standard_Boolean TDF_Label::FindAttribute ( const Standard_GUID anID,
const Standard_Integer  aTransaction,
Handle< TDF_Attribute > &  anAttribute 
) const

 Finds an attribute of the current label, according <br>
     to <anID> and <aTransaction>. This attribute <br>
     has/had to be a valid one for the given <br>
     transaction index . So, this attribute is not <br>
     necessary a valid one. <br>


The method returns True if found, False otherwise.

A removed attribute cannot be found nor a backuped
attribute of a removed one.

TDF_Label TDF_Label::FindChild ( const Standard_Integer  aTag,
const Standard_Boolean  create = Standard_True 
) const

 Finds a child label having <aTag> as tag. Creates <br>

The tag aTag identifies the label which will be the parent.
If create is true and no child label is found, a new one is created.
Example:
//creating a label with tag 10 at Root
TDF_Label lab1 = aDF->Root().FindChild(10);
//creating labels 7 and 2 on label 10
TDF_Label lab2 = lab1.FindChild(7);
TDF_Label lab3 = lab1.FindChild(2);

void TDF_Label::ForgetAllAttributes ( const Standard_Boolean  clearChildren = Standard_True) const

Forgets all the attributes. Does it on also on the
sub-labels if <clearChildren> is set to true. Of
course, this method is compatible with Transaction
& Delta mecanisms.

void TDF_Label::ForgetAttribute ( const Handle< TDF_Attribute > &  anAttribute) const

Forgets an Attribute from the current label,
setting its forgotten status true and its valid
status false. Raises if the attribute is not in
the structure.

Standard_Boolean TDF_Label::ForgetAttribute ( const Standard_GUID aguid) const

Forgets the Attribute of GUID <aguid> from the
current label . If the attribute doesn't exist
returns False. Otherwise returns True.

Standard_Boolean TDF_Label::HasAttribute ( ) const

Returns true if this label has at least one attribute.

Standard_Boolean TDF_Label::HasChild ( ) const

Returns true if this label has at least one child.

Standard_Boolean TDF_Label::HasGreaterNode ( const TDF_Label otherLabel) const

 Returns true if node address of <me> is greater <br>
     than <otherLabel> one. Used to quickly sort labels <br>
     (not on entry criterion). <br>


-C++: inline

Standard_Boolean TDF_Label::HasLowerNode ( const TDF_Label otherLabel) const

 Returns true if node address of <me> is lower than <br>
     <otherLabel> one. Used to quickly sort labels (not <br>
     on entry criterion). <br>


-C++: inline

void TDF_Label::Imported ( const Standard_Boolean  aStatus) const

Sets or unsets <me> and all its descendants as
imported label, according to <aStatus>.

Standard_Boolean TDF_Label::IsAttribute ( const Standard_GUID anID) const

Returns true if <me> owns an attribute with <anID> as ID.

Standard_Boolean TDF_Label::IsDescendant ( const TDF_Label aLabel) const

Returns True if <me> is a descendant of
<aLabel>. Attention: every label is its own
descendant.

Standard_Boolean TDF_Label::IsDifferent ( const TDF_Label aLabel) const
Standard_Boolean TDF_Label::IsEqual ( const TDF_Label aLabel) const

Returns True if the <aLabel> is equal to me (same
LabelNode*).

Standard_Boolean TDF_Label::IsImported ( ) const

 Returns True if the <aLabel> is imported. <br>


Standard_Boolean TDF_Label::IsNull ( ) const

 Returns True if the <aLabel> is null, i.e. it has <br>
     not been included in the data framework. <br>


Standard_Boolean TDF_Label::IsRoot ( ) const
Standard_Boolean TDF_Label::MayBeModified ( ) const

 Returns true if <me> or a DESCENDANT of <me> owns <br>
     attributes not yet available in transaction 0. It <br>
     means at least one of their attributes is new, <br>
     modified or deleted. <br>


Standard_Integer TDF_Label::NbAttributes ( ) const

Returns the number of attributes.

Standard_Integer TDF_Label::NbChildren ( ) const

Returns the number of children.

TDF_Label TDF_Label::NewChild ( ) const

Create a new child label of me using autoamtic
delivery tags provided by TagSource.

void TDF_Label::Nullify ( )

 Nullifies the label. <br>


Standard_Boolean TDF_Label::operator!= ( const TDF_Label aLabel) const
inline
Standard_OStream& TDF_Label::operator<< ( Standard_OStream anOS) const
inline
Standard_Boolean TDF_Label::operator== ( const TDF_Label aLabel) const
inline
void TDF_Label::ResumeAttribute ( const Handle< TDF_Attribute > &  anAttribute) const

Undo Forget action, setting its forgotten status
false and its valid status true. Raises if the
attribute is not in the structure.

const TDF_Label TDF_Label::Root ( ) const

 Returns the root label Root of the data structure. <br>

This has a depth of 0.
Exceptions:
Standard_NullObject if this label is null. This is
because a null object can have no depth.

Standard_Integer TDF_Label::Tag ( ) const

 Returns the tag of the label. <br>

This is the integer assigned randomly to a label
in a data framework. This integer is used to
identify this label in an entry.

Standard_Integer TDF_Label::Transaction ( ) const

Returns the current transaction index.


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