Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions
TObj_Object Class Reference

Basis class for transient objects in OCAF-based models. More...

#include <TObj_Object.hxx>

Inheritance diagram for TObj_Object:
Inheritance graph
[legend]

Public Types

enum  TypeFlags { Visible = 0x0001 }
 < Flags that define type-specific behaviour of objects More...
 
enum  ObjectState {
  ObjectState_Hidden = 0x0001 , ObjectState_Saved = 0x0002 , ObjectState_Imported = 0x0004 , ObjectState_ImportedByFile = 0x0008 ,
  ObjectState_Ordered = 0x0010
}
 enumeration describing various object state bit flags (see Set/GetFlags()) More...
 
- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object.
 

Public Member Functions

virtual occ::handle< TObj_ModelGetModel () const
 Returns the model to which the object belongs.
 
virtual occ::handle< TObj_ObjectIteratorGetChildren (const occ::handle< Standard_Type > &theType=nullptr) const
 Returns iterator for the child objects. This method provides tree-like view of the objects hierarchy. The references to other objects are not considered as children. theType narrows a variety of iterated objects The default implementation search for children on 1 sublavel of the children sub label.
 
TDF_Label GetChildLabel () const
 Returns the label under which children are stored.
 
TDF_Label getChildLabel (const int theRank) const
 Returns the label for child with rank.
 
TDF_Label GetLabel () const
 Returns the OCAF label on which object`s data are stored.
 
TDF_Label GetDataLabel () const
 Returns the label which is the root for data OCAF sub-tree.
 
TDF_Label GetReferenceLabel () const
 Returns the label which is the root for reference OCAF sub-tree.
 
virtual occ::handle< TObj_TNameContainerGetDictionary () const
 Returns the map of names of the objects Default implementation returns global Dictionary of the model.
 
virtual occ::handle< TCollection_HExtendedStringGetName () const
 Returns the name of the object (empty string if object has no name)
 
bool GetName (TCollection_ExtendedString &theName) const
 Returns the true is object has name and returns name to theName.
 
bool GetName (TCollection_AsciiString &theName) const
 Returns the true is object has name and returns name to theName.
 
virtual bool SetName (const occ::handle< TCollection_HExtendedString > &theName) const
 Sets name of the object. Returns False if theName is not unique.
 
bool SetName (const occ::handle< TCollection_HAsciiString > &theName) const
 Sets name of the object. Returns False if theName is not unique.
 
bool SetName (const char *const theName) const
 Sets name of the object. Returns False if theName is not unique.
 
virtual occ::handle< TCollection_HExtendedStringGetNameForClone (const occ::handle< TObj_Object > &) const
 Returns name for copy default implementation returns the same name.
 
virtual bool HasReference (const occ::handle< TObj_Object > &theObject) const
 Returns True if object has reference to indicated object.
 
virtual occ::handle< TObj_ObjectIteratorGetReferences (const occ::handle< Standard_Type > &theType=nullptr) const
 Returns an Iterator containing objects that compose the this one theType narrows a variety of iterated objects.
 
virtual void RemoveAllReferences ()
 Remove all references to other objects, by removing all reference attributes.
 
virtual occ::handle< TObj_ObjectIteratorGetBackReferences (const occ::handle< Standard_Type > &theType=nullptr) const
 Returns iterator for the objects which depend on this one. These referring objects may belong to other models. theType narrows a variety of iterated objects.
 
virtual void AddBackReference (const occ::handle< TObj_Object > &theObject)
 Registers another object as being dependent on this one. Stores back references under sublabel 2 (purely transient data, not subject to persistency).
 
virtual void RemoveBackReference (const occ::handle< TObj_Object > &theObject, const bool theSingleOnly=true)
 Removes information on dependent object (back reference). If theSingleOnly is true only the first back reference is removed in the case of duplicate items.
 
virtual bool RemoveBackReferences (const TObj_DeletingMode theMode=TObj_FreeOnly)
 Removes all back reference by removing references from other to me.
 
virtual void ClearBackReferences ()
 The default implementation just clear the back references container.
 
bool HasBackReferences () const
 Returns TRUE if object has 1 or more back references.
 
virtual void ReplaceReference (const occ::handle< TObj_Object > &theOldObject, const occ::handle< TObj_Object > &theNewObject)
 Replace reference from old object to new object. If it is not possible, may raise exception. If new object is null then simple remove reference to old object.
 
virtual bool GetBadReference (const TDF_Label &theRoot, TDF_Label &theBadReference) const
 Return True if this refers to the model theRoot belongs to and a referred label is not a descendant of theRoot. In this case theBadReference returns the currently referred label.
 
virtual bool RelocateReferences (const TDF_Label &theFromRoot, const TDF_Label &theToRoot, const bool theUpdateBackRefs=true)
 Make that each reference pointing to a descendant label of theFromRoot to point to an equivalent label under theToRoot. Return False if a resulting reference does not point to an TObj_Object Example: a referred object label = 0:3:24:7:2:7 theFromRoot = 0:3:24 theToRoot = 0:2 a new referred label = 0:2:7:2:7.
 
virtual bool CanRemoveReference (const occ::handle< TObj_Object > &theObject) const
 Returns True if the referred object theObject can be deleted without deletion of this object. Default implementation does nothing and returns False.
 
virtual void RemoveReference (const occ::handle< TObj_Object > &theObject)
 Removes reference to the object by replace reference to NULL object.
 
virtual void BeforeForgetReference (const TDF_Label &)
 Invokes from TObj_TReference::BeforeForget(). theLabel - label on that reference become removed Default implementation is empty.
 
virtual bool CanDetach (const TObj_DeletingMode theMode=TObj_FreeOnly)
 Checks if object can be detached with specified mode.
 
virtual bool Detach (const TObj_DeletingMode theMode=TObj_FreeOnly)
 Deletes the object from the model. The dependent objects are either deleted or modified when possible (see description of TObj_DeletingMode enumeration for more details) Returns True if deletion was successful. Checks if object can be deleted. Should be redefined for each specific kind of object.
 
occ::handle< TObj_ObjectGetFatherObject (const occ::handle< Standard_Type > &theType=nullptr) const
 Returns the father object, which may be NULL theType gives type of father object to search.
 
virtual bool IsAlive () const
 Checks that object alive in model Default implementation checks that object has TObject attribute at own label.
 
virtual occ::handle< TObj_ObjectClone (const TDF_Label &theTargetLabel, occ::handle< TDF_RelocationTable > theRelocTable=nullptr)
 Copy me to other label theTargetLabel New object will not have all the reference that has me. Coping object with data and childs, but change name by adding string "_copy" As result return handle of new object (null handle is something wrong) NOTE: BackReferences not coping. After cloning all objects it is necessary to call copy references with the same relocation table.
 
virtual void CopyReferences (const occ::handle< TObj_Object > &theTargetObject, const occ::handle< TDF_RelocationTable > &theRelocTable)
 Coping the references. return false is Target object is different type.
 
virtual void CopyChildren (TDF_Label &theTargetLabel, const occ::handle< TDF_RelocationTable > &theRelocTable)
 Coping the children from source label to the target.
 
virtual int GetOrder () const
 returns order of object (or tag of their label if order is not initialised)
 
virtual bool SetOrder (const int &theIndx)
 sets order of object
 
bool HasModifications () const
 Returns true if object attributes or its children were modified in the current open transaction.
 
virtual int GetTypeFlags () const
 Returns flags (bitmask) that define properties of objects of that type By default returns flag Visible.
 
int GetFlags () const
 Returns mask of seted flags.
 
void SetFlags (const int theMask)
 Sets flags with defined mask.
 
bool TestFlags (const int theMask) const
 tests flags by the mask.
 
void ClearFlags (const int theMask=~0)
 clears flags by the mask.
 
virtual void AfterRetrieval ()
 Performs updating the links and dependences of the object which are not stored in persistence. Should be redefined if necessary.
 
virtual void BeforeStoring ()
 Performs storing the objects transient fields in OCAF document which were outside transaction mechanism. Default implementation does nothing.
 
- 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 Detach (const TDF_Label &theLabel, const TObj_DeletingMode theMode=TObj_FreeOnly)
 Deletes the object from the label. Checks if object can be deleted. Finds object on the label and detaches it by calling previous method. Returns true if there is no object on the label after detaching.
 
static bool GetObj (const TDF_Label &theLabel, occ::handle< TObj_Object > &theResult, const bool isSuper=false)
 Returns the Object attached to a given label. Returns False if no object of type TObj_Object is stored on the specified label. If isSuper is true tries to find on the super labels.
 
- 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.
 

Protected Types

enum  DataTag { DataTag_First = 0 , DataTag_Flags , DataTag_Order , DataTag_Last = DataTag_First + 100 }
 enumeration for the ranks of label under Data section. More...
 
enum  ChildTag { ChildTag_First = 0 , ChildTag_Last = ChildTag_First }
 enumeration for the ranks of label under Child section. More...
 
enum  RefTag { RefTag_First = 0 , RefTag_Last = RefTag_First }
 enumeration for the ranks of label under Reference section. More...
 

Protected Member Functions

 TObj_Object (const TDF_Label &theLabel, const bool theSetName=true)
 Constructor of a new object interface: requires label, which should be one of the labels in model's data structure. This creates a new object and attaches it to a given label. The initialisation of the object's data and their integrity is to be ensured by implementations and by persistence mechanism. If the flag theSetName is true (default) the object is assign the default name that is generated using the father partition object if any.
 
 TObj_Object (const TObj_Persistence *, const TDF_Label &theLabel)
 The special constructor intended for implementation of persistence mechanism. See class TObj_Persistence for more details. The first argument is used only to avoid confusion with other constructors.
 
void initFields ()
 This method is called from persistence to initialize the object fields, so successors that have transient fields must initialize them in initFields(), and call the same method of parent.
 
virtual bool copyData (const occ::handle< TObj_Object > &theTargetObject)
 Coping the data of me to Target object. return false is Target object is different type.
 
void copyReferences (const TDF_Label &theSourceLabel, TDF_Label &theTargetLabel, const occ::handle< TDF_RelocationTable > &theRelocTable)
 Coping the references from source label to the target.
 
TDF_Label getDataLabel (const int theRank1, const int theRank2=0) const
 Returns the theRank2-th sub label of the theRank1-th sublabel of the Data label of the object. If theRank2 is 0 (default), sub label theRank1 of Data label is returned. If requested label does not exist, it is created.
 
TDF_Label getReferenceLabel (const int theRank1, const int theRank2=0) const
 Returns the theRank2-th sub label of the theRank1-th sublabel of the Reference label of the object. If theRank2 is 0 (default), sub label theRank1 of Reference label is returned. If requested label does not exist, it is created.
 
bool isDataAttribute (const Standard_GUID &theGUID, const int theRank1, const int theRank2=0) const
 Returns True if there is an attribute having theGUID on the theRank2-th sublabel of theRank1-th sublabel of the Data label of the object. If theRank2 is 0 (default), label theRank1 is supposed, not its sublabel.
 
double getReal (const int theRank1, const int theRank2=0) const
 Returns the real value from theRank2-th sublabel of theRank1-th sublabel of the Data label of the object. If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel). Returns 0.0 if no real value is stored on that label.
 
bool setReal (const double theValue, const int theRank1, const int theRank2=0, const double theTolerance=0.) const
 Sets the real value for theRank2-th sublabel of theRank1-th sublabel of the Data label of the object. If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel). Returns True if new value is actually different from previous one (with specified tolerance)
 
int getInteger (const int theRank1, const int theRank2=0) const
 Returns the integer value from theRank2-th sublabel of theRank1-th sublabel of the Data label of the object. If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel). Returns 0 if no integer value is stored on that label.
 
bool setInteger (const int theValue, const int theRank1, const int theRank2=0) const
 Sets the integer value for theRank2-th sublabel of theRank1-th sublabel of the Data label of the object. If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel). Returns True if new value is actually different from previous one.
 
occ::handle< NCollection_HArray1< double > > getRealArray (const int theLength, const int theRank1, const int theRank2=0, const double theInitialValue=0.0) const
 Returns an existing or create a new real array on theRank2-th sublabel of theRank1-th sublabel of the Data label of the object. If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel). A newly created array has 1 and theLength bounds and is initialized with theInitialValue.
 
occ::handle< NCollection_HArray1< int > > getIntegerArray (const int theLength, const int theRank1, const int theRank2=0, const int theInitialValue=0) const
 Returns an existing or create a new integer array on theRank2-th sublabel of theRank1-th sublabel of the Data label of the object. If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel). A newly created array has 1 and theLength bounds and is initialized with theInitialValue.
 
occ::handle< NCollection_HArray1< TCollection_ExtendedString > > getExtStringArray (const int theLength, const int theRank1, const int theRank2=0) const
 Returns an existing or create a new string array on theRank2-th sublabel of theRank1-th sublabel of the Data label of the object. If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel). A newly created array has 1 and theLength bounds NOTE: new created array is NOT initialized.
 
void setArray (const occ::handle< NCollection_HArray1< double > > &theArray, const int theRank1, const int theRank2=0)
 Store theArray on theRank2-th sublabel of theRank1-th sublabel of the Data label of the object. If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel). If theArray is null then array attribute if any is removed.
 
void setArray (const occ::handle< NCollection_HArray1< int > > &theArray, const int theRank1, const int theRank2=0)
 Store theArray on theRank2-th sublabel of theRank1-th sublabel of the Data label of the object. If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel). If theArray is null then array attribute if any is removed.
 
void setArray (const occ::handle< NCollection_HArray1< TCollection_ExtendedString > > &theArray, const int theRank1, const int theRank2=0)
 Store theArray on theRank2-th sublabel of theRank1-th sublabel of the Data label of the object. If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel). If theArray is null then array attribute if any is removed.
 
void setExtString (const occ::handle< TCollection_HExtendedString > &theValue, const int theRank1, const int theRank2=0) const
 Sets the string value for theRank2-th sublabel of theRank1-th sublabel of the Data label of the object. If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
 
occ::handle< TCollection_HExtendedStringgetExtString (const int theRank1, const int theRank2=0) const
 Returns the string value from theRank2-th sublabel of theRank1-th sublabel of the Data label of the object. If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
 
void setAsciiString (const occ::handle< TCollection_HAsciiString > &theValue, const int theRank1, const int theRank2=0) const
 Sets the ascii string value for theRank2-th sublabel of theRank1-th sublabel of the Data label of the object. If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
 
occ::handle< TCollection_HAsciiStringgetAsciiString (const int theRank1, const int theRank2=0) const
 Returns the string value from theRank2-th sublabel of theRank1-th sublabel of the Data label of the object. If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
 
occ::handle< TObj_ObjectgetReference (const int theRank1, const int theRank2=0) const
 Returns the reference attribute from theRank2-th sublabel of theRank1-th sublabel of the References label of the object. If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
 
bool setReference (const occ::handle< TObj_Object > &theObject, const int theRank1, const int theRank2=0)
 Sets the reference to theObject on theRank2-th sublabel of theRank1-th sublabel of the References label of the object. If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel). Returns True if new value is actually different from previous one If Object is NULL, reference is deleted.
 
TDF_Label addReference (const int theRank1, const occ::handle< TObj_Object > &theObject)
 Adds the reference to theObject on next free sublabel of theRank1-th sublabel of the References label of the object and returns the Label.
 

Detailed Description

Basis class for transient objects in OCAF-based models.

Member Enumeration Documentation

◆ ChildTag

enumeration for the ranks of label under Child section.

Enumerator
ChildTag_First 
ChildTag_Last 

No children.

◆ DataTag

enumeration for the ranks of label under Data section.

Enumerator
DataTag_First 
DataTag_Flags 

stores flags of object

DataTag_Order 

stores order of object

DataTag_Last 

Reserved for possible future use.

◆ ObjectState

enumeration describing various object state bit flags (see Set/GetFlags())

Enumerator
ObjectState_Hidden 

object is hidden in tree browser

ObjectState_Saved 

object has (or should have) corresponding saved file on disk

ObjectState_Imported 

object's data are just imported from somewhere

ObjectState_ImportedByFile 

a model imported by file may need a sophisticated update of external references

ObjectState_Ordered 

flag that partition contains ordered objects

◆ RefTag

enumeration for the ranks of label under Reference section.

Enumerator
RefTag_First 
RefTag_Last 

No children.

◆ TypeFlags

< Flags that define type-specific behaviour of objects

Enumerator
Visible 

Is visible in DataViewer.

Constructor & Destructor Documentation

◆ TObj_Object() [1/2]

TObj_Object::TObj_Object ( const TDF_Label & theLabel,
const bool theSetName = true )
protected

Constructor of a new object interface: requires label, which should be one of the labels in model's data structure. This creates a new object and attaches it to a given label. The initialisation of the object's data and their integrity is to be ensured by implementations and by persistence mechanism. If the flag theSetName is true (default) the object is assign the default name that is generated using the father partition object if any.

Constructors

◆ TObj_Object() [2/2]

TObj_Object::TObj_Object ( const TObj_Persistence * ,
const TDF_Label & theLabel )
inlineprotected

The special constructor intended for implementation of persistence mechanism. See class TObj_Persistence for more details. The first argument is used only to avoid confusion with other constructors.

Member Function Documentation

◆ AddBackReference()

virtual void TObj_Object::AddBackReference ( const occ::handle< TObj_Object > & theObject)
virtual

Registers another object as being dependent on this one. Stores back references under sublabel 2 (purely transient data, not subject to persistency).

◆ addReference()

TDF_Label TObj_Object::addReference ( const int theRank1,
const occ::handle< TObj_Object > & theObject )
protected

Adds the reference to theObject on next free sublabel of theRank1-th sublabel of the References label of the object and returns the Label.

◆ AfterRetrieval()

virtual void TObj_Object::AfterRetrieval ( )
virtual

Performs updating the links and dependences of the object which are not stored in persistence. Should be redefined if necessary.

Method for updating object after restoring

Reimplemented in TObj_Partition.

◆ BeforeForgetReference()

virtual void TObj_Object::BeforeForgetReference ( const TDF_Label & )
inlinevirtual

Invokes from TObj_TReference::BeforeForget(). theLabel - label on that reference become removed Default implementation is empty.

◆ BeforeStoring()

virtual void TObj_Object::BeforeStoring ( )
virtual

Performs storing the objects transient fields in OCAF document which were outside transaction mechanism. Default implementation does nothing.

◆ CanDetach()

virtual bool TObj_Object::CanDetach ( const TObj_DeletingMode theMode = TObj_FreeOnly)
virtual

Checks if object can be detached with specified mode.

Methods for deleting the object

◆ CanRemoveReference()

virtual bool TObj_Object::CanRemoveReference ( const occ::handle< TObj_Object > & theObject) const
virtual

Returns True if the referred object theObject can be deleted without deletion of this object. Default implementation does nothing and returns False.

◆ ClearBackReferences()

virtual void TObj_Object::ClearBackReferences ( )
virtual

The default implementation just clear the back references container.

◆ ClearFlags()

void TObj_Object::ClearFlags ( const int theMask = ~0)

clears flags by the mask.

◆ Clone()

virtual occ::handle< TObj_Object > TObj_Object::Clone ( const TDF_Label & theTargetLabel,
occ::handle< TDF_RelocationTable > theRelocTable = nullptr )
virtual

Copy me to other label theTargetLabel New object will not have all the reference that has me. Coping object with data and childs, but change name by adding string "_copy" As result return handle of new object (null handle is something wrong) NOTE: BackReferences not coping. After cloning all objects it is necessary to call copy references with the same relocation table.

Cloning related methods

◆ CopyChildren()

virtual void TObj_Object::CopyChildren ( TDF_Label & theTargetLabel,
const occ::handle< TDF_RelocationTable > & theRelocTable )
virtual

Coping the children from source label to the target.

◆ copyData()

virtual bool TObj_Object::copyData ( const occ::handle< TObj_Object > & theTargetObject)
protectedvirtual

Coping the data of me to Target object. return false is Target object is different type.

Protected Methods copy data of object to other object

Reimplemented in TObj_Partition.

◆ CopyReferences()

virtual void TObj_Object::CopyReferences ( const occ::handle< TObj_Object > & theTargetObject,
const occ::handle< TDF_RelocationTable > & theRelocTable )
virtual

Coping the references. return false is Target object is different type.

◆ copyReferences()

void TObj_Object::copyReferences ( const TDF_Label & theSourceLabel,
TDF_Label & theTargetLabel,
const occ::handle< TDF_RelocationTable > & theRelocTable )
protected

Coping the references from source label to the target.

◆ Detach() [1/2]

static bool TObj_Object::Detach ( const TDF_Label & theLabel,
const TObj_DeletingMode theMode = TObj_FreeOnly )
static

Deletes the object from the label. Checks if object can be deleted. Finds object on the label and detaches it by calling previous method. Returns true if there is no object on the label after detaching.

◆ Detach() [2/2]

virtual bool TObj_Object::Detach ( const TObj_DeletingMode theMode = TObj_FreeOnly)
virtual

Deletes the object from the model. The dependent objects are either deleted or modified when possible (see description of TObj_DeletingMode enumeration for more details) Returns True if deletion was successful. Checks if object can be deleted. Should be redefined for each specific kind of object.

◆ getAsciiString()

occ::handle< TCollection_HAsciiString > TObj_Object::getAsciiString ( const int theRank1,
const int theRank2 = 0 ) const
protected

Returns the string value from theRank2-th sublabel of theRank1-th sublabel of the Data label of the object. If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).

◆ GetBackReferences()

virtual occ::handle< TObj_ObjectIterator > TObj_Object::GetBackReferences ( const occ::handle< Standard_Type > & theType = nullptr) const
virtual

Returns iterator for the objects which depend on this one. These referring objects may belong to other models. theType narrows a variety of iterated objects.

◆ GetBadReference()

virtual bool TObj_Object::GetBadReference ( const TDF_Label & theRoot,
TDF_Label & theBadReference ) const
virtual

Return True if this refers to the model theRoot belongs to and a referred label is not a descendant of theRoot. In this case theBadReference returns the currently referred label.

◆ GetChildLabel()

TDF_Label TObj_Object::GetChildLabel ( ) const

Returns the label under which children are stored.

◆ getChildLabel()

TDF_Label TObj_Object::getChildLabel ( const int theRank) const

Returns the label for child with rank.

◆ GetChildren()

virtual occ::handle< TObj_ObjectIterator > TObj_Object::GetChildren ( const occ::handle< Standard_Type > & theType = nullptr) const
virtual

Returns iterator for the child objects. This method provides tree-like view of the objects hierarchy. The references to other objects are not considered as children. theType narrows a variety of iterated objects The default implementation search for children on 1 sublavel of the children sub label.

◆ GetDataLabel()

TDF_Label TObj_Object::GetDataLabel ( ) const

Returns the label which is the root for data OCAF sub-tree.

◆ getDataLabel()

TDF_Label TObj_Object::getDataLabel ( const int theRank1,
const int theRank2 = 0 ) const
protected

Returns the theRank2-th sub label of the theRank1-th sublabel of the Data label of the object. If theRank2 is 0 (default), sub label theRank1 of Data label is returned. If requested label does not exist, it is created.

Internal tools for work with OCAF data

◆ GetDictionary()

virtual occ::handle< TObj_TNameContainer > TObj_Object::GetDictionary ( ) const
virtual

Returns the map of names of the objects Default implementation returns global Dictionary of the model.

Methods handling name of the object

◆ getExtString()

occ::handle< TCollection_HExtendedString > TObj_Object::getExtString ( const int theRank1,
const int theRank2 = 0 ) const
protected

Returns the string value from theRank2-th sublabel of theRank1-th sublabel of the Data label of the object. If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).

◆ getExtStringArray()

occ::handle< NCollection_HArray1< TCollection_ExtendedString > > TObj_Object::getExtStringArray ( const int theLength,
const int theRank1,
const int theRank2 = 0 ) const
protected

Returns an existing or create a new string array on theRank2-th sublabel of theRank1-th sublabel of the Data label of the object. If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel). A newly created array has 1 and theLength bounds NOTE: new created array is NOT initialized.

NOTE: do not create new array and returns NULL handle if no array on label and theLength less than

WARNING: call setArray() after array contents modification in order to assure Undo work

◆ GetFatherObject()

occ::handle< TObj_Object > TObj_Object::GetFatherObject ( const occ::handle< Standard_Type > & theType = nullptr) const

Returns the father object, which may be NULL theType gives type of father object to search.

◆ GetFlags()

int TObj_Object::GetFlags ( ) const

Returns mask of seted flags.

◆ getInteger()

int TObj_Object::getInteger ( const int theRank1,
const int theRank2 = 0 ) const
protected

Returns the integer value from theRank2-th sublabel of theRank1-th sublabel of the Data label of the object. If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel). Returns 0 if no integer value is stored on that label.

◆ getIntegerArray()

occ::handle< NCollection_HArray1< int > > TObj_Object::getIntegerArray ( const int theLength,
const int theRank1,
const int theRank2 = 0,
const int theInitialValue = 0 ) const
protected

Returns an existing or create a new integer array on theRank2-th sublabel of theRank1-th sublabel of the Data label of the object. If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel). A newly created array has 1 and theLength bounds and is initialized with theInitialValue.

NOTE: do not create new array and returns NULL handle if no array on label and theLength less than

WARNING: call setArray() after array contents modification in order to assure Undo work

◆ GetLabel()

TDF_Label TObj_Object::GetLabel ( ) const

Returns the OCAF label on which object`s data are stored.

Access to the OCAF-specific data

◆ GetModel()

virtual occ::handle< TObj_Model > TObj_Object::GetModel ( ) const
virtual

Returns the model to which the object belongs.

Virtual methods

◆ GetName() [1/3]

virtual occ::handle< TCollection_HExtendedString > TObj_Object::GetName ( ) const
virtual

Returns the name of the object (empty string if object has no name)

◆ GetName() [2/3]

bool TObj_Object::GetName ( TCollection_AsciiString & theName) const

Returns the true is object has name and returns name to theName.

◆ GetName() [3/3]

bool TObj_Object::GetName ( TCollection_ExtendedString & theName) const

Returns the true is object has name and returns name to theName.

◆ GetNameForClone()

virtual occ::handle< TCollection_HExtendedString > TObj_Object::GetNameForClone ( const occ::handle< TObj_Object > & ) const
inlinevirtual

Returns name for copy default implementation returns the same name.

◆ GetObj()

static bool TObj_Object::GetObj ( const TDF_Label & theLabel,
occ::handle< TObj_Object > & theResult,
const bool isSuper = false )
static

Returns the Object attached to a given label. Returns False if no object of type TObj_Object is stored on the specified label. If isSuper is true tries to find on the super labels.

methods for object retrieval

◆ GetOrder()

virtual int TObj_Object::GetOrder ( ) const
virtual

returns order of object (or tag of their label if order is not initialised)

Public methods to access order of object

◆ getReal()

double TObj_Object::getReal ( const int theRank1,
const int theRank2 = 0 ) const
protected

Returns the real value from theRank2-th sublabel of theRank1-th sublabel of the Data label of the object. If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel). Returns 0.0 if no real value is stored on that label.

◆ getRealArray()

occ::handle< NCollection_HArray1< double > > TObj_Object::getRealArray ( const int theLength,
const int theRank1,
const int theRank2 = 0,
const double theInitialValue = 0.0 ) const
protected

Returns an existing or create a new real array on theRank2-th sublabel of theRank1-th sublabel of the Data label of the object. If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel). A newly created array has 1 and theLength bounds and is initialized with theInitialValue.

NOTE: do not create new array and returns NULL handle if no array on label and theLength less than

WARNING: call setArray() after array contents modification in order to assure Undo work

◆ getReference()

occ::handle< TObj_Object > TObj_Object::getReference ( const int theRank1,
const int theRank2 = 0 ) const
protected

Returns the reference attribute from theRank2-th sublabel of theRank1-th sublabel of the References label of the object. If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).

◆ GetReferenceLabel()

TDF_Label TObj_Object::GetReferenceLabel ( ) const

Returns the label which is the root for reference OCAF sub-tree.

◆ getReferenceLabel()

TDF_Label TObj_Object::getReferenceLabel ( const int theRank1,
const int theRank2 = 0 ) const
protected

Returns the theRank2-th sub label of the theRank1-th sublabel of the Reference label of the object. If theRank2 is 0 (default), sub label theRank1 of Reference label is returned. If requested label does not exist, it is created.

◆ GetReferences()

virtual occ::handle< TObj_ObjectIterator > TObj_Object::GetReferences ( const occ::handle< Standard_Type > & theType = nullptr) const
virtual

Returns an Iterator containing objects that compose the this one theType narrows a variety of iterated objects.

◆ GetTypeFlags()

virtual int TObj_Object::GetTypeFlags ( ) const
virtual

Returns flags (bitmask) that define properties of objects of that type By default returns flag Visible.

Access to object flags

Reimplemented in TObj_HiddenPartition.

◆ HasBackReferences()

bool TObj_Object::HasBackReferences ( ) const

Returns TRUE if object has 1 or more back references.

◆ HasModifications()

bool TObj_Object::HasModifications ( ) const

Returns true if object attributes or its children were modified in the current open transaction.

Public methods to check modifications of the object since last commit

◆ HasReference()

virtual bool TObj_Object::HasReference ( const occ::handle< TObj_Object > & theObject) const
virtual

Returns True if object has reference to indicated object.

Analysis of dependencies on other objects

◆ initFields()

void TObj_Object::initFields ( )
inlineprotected

This method is called from persistence to initialize the object fields, so successors that have transient fields must initialize them in initFields(), and call the same method of parent.

◆ IsAlive()

virtual bool TObj_Object::IsAlive ( ) const
virtual

Checks that object alive in model Default implementation checks that object has TObject attribute at own label.

Methods for checking and Updating object

◆ isDataAttribute()

bool TObj_Object::isDataAttribute ( const Standard_GUID & theGUID,
const int theRank1,
const int theRank2 = 0 ) const
protected

Returns True if there is an attribute having theGUID on the theRank2-th sublabel of theRank1-th sublabel of the Data label of the object. If theRank2 is 0 (default), label theRank1 is supposed, not its sublabel.

◆ RelocateReferences()

virtual bool TObj_Object::RelocateReferences ( const TDF_Label & theFromRoot,
const TDF_Label & theToRoot,
const bool theUpdateBackRefs = true )
virtual

Make that each reference pointing to a descendant label of theFromRoot to point to an equivalent label under theToRoot. Return False if a resulting reference does not point to an TObj_Object Example: a referred object label = 0:3:24:7:2:7 theFromRoot = 0:3:24 theToRoot = 0:2 a new referred label = 0:2:7:2:7.

◆ RemoveAllReferences()

virtual void TObj_Object::RemoveAllReferences ( )
virtual

Remove all references to other objects, by removing all reference attributes.

◆ RemoveBackReference()

virtual void TObj_Object::RemoveBackReference ( const occ::handle< TObj_Object > & theObject,
const bool theSingleOnly = true )
virtual

Removes information on dependent object (back reference). If theSingleOnly is true only the first back reference is removed in the case of duplicate items.

◆ RemoveBackReferences()

virtual bool TObj_Object::RemoveBackReferences ( const TObj_DeletingMode theMode = TObj_FreeOnly)
virtual

Removes all back reference by removing references from other to me.

◆ RemoveReference()

virtual void TObj_Object::RemoveReference ( const occ::handle< TObj_Object > & theObject)
virtual

Removes reference to the object by replace reference to NULL object.

◆ ReplaceReference()

virtual void TObj_Object::ReplaceReference ( const occ::handle< TObj_Object > & theOldObject,
const occ::handle< TObj_Object > & theNewObject )
virtual

Replace reference from old object to new object. If it is not possible, may raise exception. If new object is null then simple remove reference to old object.

◆ setArray() [1/3]

void TObj_Object::setArray ( const occ::handle< NCollection_HArray1< double > > & theArray,
const int theRank1,
const int theRank2 = 0 )
protected

Store theArray on theRank2-th sublabel of theRank1-th sublabel of the Data label of the object. If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel). If theArray is null then array attribute if any is removed.

◆ setArray() [2/3]

void TObj_Object::setArray ( const occ::handle< NCollection_HArray1< int > > & theArray,
const int theRank1,
const int theRank2 = 0 )
protected

Store theArray on theRank2-th sublabel of theRank1-th sublabel of the Data label of the object. If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel). If theArray is null then array attribute if any is removed.

◆ setArray() [3/3]

void TObj_Object::setArray ( const occ::handle< NCollection_HArray1< TCollection_ExtendedString > > & theArray,
const int theRank1,
const int theRank2 = 0 )
protected

Store theArray on theRank2-th sublabel of theRank1-th sublabel of the Data label of the object. If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel). If theArray is null then array attribute if any is removed.

◆ setAsciiString()

void TObj_Object::setAsciiString ( const occ::handle< TCollection_HAsciiString > & theValue,
const int theRank1,
const int theRank2 = 0 ) const
protected

Sets the ascii string value for theRank2-th sublabel of theRank1-th sublabel of the Data label of the object. If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).

◆ setExtString()

void TObj_Object::setExtString ( const occ::handle< TCollection_HExtendedString > & theValue,
const int theRank1,
const int theRank2 = 0 ) const
protected

Sets the string value for theRank2-th sublabel of theRank1-th sublabel of the Data label of the object. If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).

◆ SetFlags()

void TObj_Object::SetFlags ( const int theMask)

Sets flags with defined mask.

◆ setInteger()

bool TObj_Object::setInteger ( const int theValue,
const int theRank1,
const int theRank2 = 0 ) const
protected

Sets the integer value for theRank2-th sublabel of theRank1-th sublabel of the Data label of the object. If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel). Returns True if new value is actually different from previous one.

◆ SetName() [1/3]

bool TObj_Object::SetName ( const char *const theName) const

Sets name of the object. Returns False if theName is not unique.

◆ SetName() [2/3]

bool TObj_Object::SetName ( const occ::handle< TCollection_HAsciiString > & theName) const

Sets name of the object. Returns False if theName is not unique.

◆ SetName() [3/3]

virtual bool TObj_Object::SetName ( const occ::handle< TCollection_HExtendedString > & theName) const
virtual

Sets name of the object. Returns False if theName is not unique.

Reimplemented in TObj_Partition.

◆ SetOrder()

virtual bool TObj_Object::SetOrder ( const int & theIndx)
virtual

sets order of object

◆ setReal()

bool TObj_Object::setReal ( const double theValue,
const int theRank1,
const int theRank2 = 0,
const double theTolerance = 0. ) const
protected

Sets the real value for theRank2-th sublabel of theRank1-th sublabel of the Data label of the object. If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel). Returns True if new value is actually different from previous one (with specified tolerance)

◆ setReference()

bool TObj_Object::setReference ( const occ::handle< TObj_Object > & theObject,
const int theRank1,
const int theRank2 = 0 )
protected

Sets the reference to theObject on theRank2-th sublabel of theRank1-th sublabel of the References label of the object. If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel). Returns True if new value is actually different from previous one If Object is NULL, reference is deleted.

◆ TestFlags()

bool TObj_Object::TestFlags ( const int theMask) const

tests flags by the mask.


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