Open CASCADE Technology 7.8.0
Public Member Functions
TDF_RelocationTable Class Reference

This is a relocation dictionary between source and target labels, attributes or any transient(useful for copy or paste actions). Note that one target value may be the relocation value of more than one source object. More...

#include <TDF_RelocationTable.hxx>

Inheritance diagram for TDF_RelocationTable:
Inheritance graph
[legend]

Public Member Functions

 TDF_RelocationTable (const Standard_Boolean selfRelocate=Standard_False)
 Creates an relocation table. <selfRelocate> says if a value without explicit relocation is its own relocation.
 
void SelfRelocate (const Standard_Boolean selfRelocate)
 Sets <mySelfRelocate> to <selfRelocate>.
 
Standard_Boolean SelfRelocate () const
 Returns <mySelfRelocate>.
 
void AfterRelocate (const Standard_Boolean afterRelocate)
 
Standard_Boolean AfterRelocate () const
 Returns <myAfterRelocate>.
 
void SetRelocation (const TDF_Label &aSourceLabel, const TDF_Label &aTargetLabel)
 Sets the relocation value of <aSourceLabel> to <aTargetLabel>.
 
Standard_Boolean HasRelocation (const TDF_Label &aSourceLabel, TDF_Label &aTargetLabel) const
 Finds the relocation value of <aSourceLabel> and returns it into <aTargetLabel>.
 
void SetRelocation (const Handle< TDF_Attribute > &aSourceAttribute, const Handle< TDF_Attribute > &aTargetAttribute)
 Sets the relocation value of <aSourceAttribute> to <aTargetAttribute>.
 
Standard_Boolean HasRelocation (const Handle< TDF_Attribute > &aSourceAttribute, Handle< TDF_Attribute > &aTargetAttribute) const
 Finds the relocation value of <aSourceAttribute> and returns it into <aTargetAttribute>.
 
template<class T >
Standard_Boolean HasRelocation (const Handle< TDF_Attribute > &theSource, Handle< T > &theTarget) const
 Safe variant for arbitrary type of argument.
 
void SetTransientRelocation (const Handle< Standard_Transient > &aSourceTransient, const Handle< Standard_Transient > &aTargetTransient)
 Sets the relocation value of <aSourceTransient> to <aTargetTransient>.
 
Standard_Boolean HasTransientRelocation (const Handle< Standard_Transient > &aSourceTransient, Handle< Standard_Transient > &aTargetTransient) const
 Finds the relocation value of <aSourceTransient> and returns it into <aTargetTransient>.
 
void Clear ()
 Clears the relocation dictionary, but lets the self relocation flag to its current value.
 
void TargetLabelMap (TDF_LabelMap &aLabelMap) const
 Fills <aLabelMap> with target relocation labels. <aLabelMap> is not cleared before use.
 
void TargetAttributeMap (TDF_AttributeMap &anAttributeMap) const
 Fills <anAttributeMap> with target relocation attributes. <anAttributeMap> is not cleared before use.
 
TDF_LabelDataMapLabelTable ()
 Returns <myLabelTable> to be used or updated.
 
TDF_AttributeDataMapAttributeTable ()
 Returns <myAttributeTable> to be used or updated.
 
TColStd_IndexedDataMapOfTransientTransientTransientTable ()
 Returns <myTransientTable> to be used or updated.
 
Standard_OStreamDump (const Standard_Boolean dumpLabels, const Standard_Boolean dumpAttributes, const Standard_Boolean dumpTransients, Standard_OStream &anOS) const
 Dumps the relocation table.
 
- 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 ()
 Destructor must be virtual.
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object.
 
Standard_Boolean IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type.
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName.
 
Standard_Boolean 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.
 
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.
 
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.
 
Standard_Integer GetRefCount () const noexcept
 Get the reference counter of this object.
 
void IncrementRefCounter () noexcept
 Increments the reference counter of this object.
 
Standard_Integer DecrementRefCounter () noexcept
 Decrements the reference counter of this object; returns the decremented value.
 
virtual void Delete () const
 Memory deallocator for transient classes.
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object.
 
- Static Public Member Functions inherited from Standard_Transient
static constexpr const charget_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.
 

Detailed Description

This is a relocation dictionary between source and target labels, attributes or any transient(useful for copy or paste actions). Note that one target value may be the relocation value of more than one source object.

Common behaviour: it returns true and the found relocation value as target object; false otherwise.

Look at SelfRelocate method for more explanation about self relocation behavior of this class.

Constructor & Destructor Documentation

◆ TDF_RelocationTable()

TDF_RelocationTable::TDF_RelocationTable ( const Standard_Boolean  selfRelocate = Standard_False)

Creates an relocation table. <selfRelocate> says if a value without explicit relocation is its own relocation.

Member Function Documentation

◆ AfterRelocate() [1/2]

Standard_Boolean TDF_RelocationTable::AfterRelocate ( ) const

Returns <myAfterRelocate>.

◆ AfterRelocate() [2/2]

void TDF_RelocationTable::AfterRelocate ( const Standard_Boolean  afterRelocate)

◆ AttributeTable()

TDF_AttributeDataMap & TDF_RelocationTable::AttributeTable ( )

Returns <myAttributeTable> to be used or updated.

◆ Clear()

void TDF_RelocationTable::Clear ( )

Clears the relocation dictionary, but lets the self relocation flag to its current value.

◆ Dump()

Standard_OStream & TDF_RelocationTable::Dump ( const Standard_Boolean  dumpLabels,
const Standard_Boolean  dumpAttributes,
const Standard_Boolean  dumpTransients,
Standard_OStream anOS 
) const

Dumps the relocation table.

◆ HasRelocation() [1/3]

Standard_Boolean TDF_RelocationTable::HasRelocation ( const Handle< TDF_Attribute > &  aSourceAttribute,
Handle< TDF_Attribute > &  aTargetAttribute 
) const

Finds the relocation value of <aSourceAttribute> and returns it into <aTargetAttribute>.

(See above SelfRelocate method for more explanation about the method behavior)

◆ HasRelocation() [2/3]

template<class T >
Standard_Boolean TDF_RelocationTable::HasRelocation ( const Handle< TDF_Attribute > &  theSource,
Handle< T > &  theTarget 
) const
inline

Safe variant for arbitrary type of argument.

◆ HasRelocation() [3/3]

Standard_Boolean TDF_RelocationTable::HasRelocation ( const TDF_Label aSourceLabel,
TDF_Label aTargetLabel 
) const

Finds the relocation value of <aSourceLabel> and returns it into <aTargetLabel>.

(See above SelfRelocate method for more explanation about the method behavior)

◆ HasTransientRelocation()

Standard_Boolean TDF_RelocationTable::HasTransientRelocation ( const Handle< Standard_Transient > &  aSourceTransient,
Handle< Standard_Transient > &  aTargetTransient 
) const

Finds the relocation value of <aSourceTransient> and returns it into <aTargetTransient>.

(See above SelfRelocate method for more explanation about the method behavior)

◆ LabelTable()

TDF_LabelDataMap & TDF_RelocationTable::LabelTable ( )

Returns <myLabelTable> to be used or updated.

◆ SelfRelocate() [1/2]

Standard_Boolean TDF_RelocationTable::SelfRelocate ( ) const

Returns <mySelfRelocate>.

◆ SelfRelocate() [2/2]

void TDF_RelocationTable::SelfRelocate ( const Standard_Boolean  selfRelocate)

Sets <mySelfRelocate> to <selfRelocate>.

This flag affects the HasRelocation method behavior like this:

<mySelfRelocate> == False:

If no relocation object is found in the map, a null object is returned

<mySelfRelocate> == True:

If no relocation object is found in the map, the method assumes the source object is relocation value; so the source object is returned as target object.

◆ SetRelocation() [1/2]

void TDF_RelocationTable::SetRelocation ( const Handle< TDF_Attribute > &  aSourceAttribute,
const Handle< TDF_Attribute > &  aTargetAttribute 
)

Sets the relocation value of <aSourceAttribute> to <aTargetAttribute>.

◆ SetRelocation() [2/2]

void TDF_RelocationTable::SetRelocation ( const TDF_Label aSourceLabel,
const TDF_Label aTargetLabel 
)

Sets the relocation value of <aSourceLabel> to <aTargetLabel>.

◆ SetTransientRelocation()

void TDF_RelocationTable::SetTransientRelocation ( const Handle< Standard_Transient > &  aSourceTransient,
const Handle< Standard_Transient > &  aTargetTransient 
)

Sets the relocation value of <aSourceTransient> to <aTargetTransient>.

◆ TargetAttributeMap()

void TDF_RelocationTable::TargetAttributeMap ( TDF_AttributeMap anAttributeMap) const

Fills <anAttributeMap> with target relocation attributes. <anAttributeMap> is not cleared before use.

◆ TargetLabelMap()

void TDF_RelocationTable::TargetLabelMap ( TDF_LabelMap aLabelMap) const

Fills <aLabelMap> with target relocation labels. <aLabelMap> is not cleared before use.

◆ TransientTable()

TColStd_IndexedDataMapOfTransientTransient & TDF_RelocationTable::TransientTable ( )

Returns <myTransientTable> to be used or updated.


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