Open CASCADE Technology  7.2.0
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions
TObj_Partition Class Reference

#include <TObj_Partition.hxx>

Inheritance diagram for TObj_Partition:
Inheritance graph
[legend]

Public Member Functions

virtual Standard_Boolean SetName (const Handle< TCollection_HExtendedString > &theName) const override
 Sets name of the object. partition does not check unique of own name. More...
 
virtual void AfterRetrieval () override
 Preforms updating the links and dependances of the object which are not stored in persistence. Does not register the partition name. More...
 
TDF_Label NewLabel () const
 Creates and Returns label for new object in partition. More...
 
void SetNamePrefix (const Handle< TCollection_HExtendedString > &thePrefix)
 Sets prefix for names of the objects in partition. More...
 
Handle< TCollection_HExtendedStringGetNamePrefix () const
 Returns prefix for names of the objects in partition. More...
 
Handle< TCollection_HExtendedStringGetNewName (const Standard_Boolean theIsToChangeCount=Standard_True)
 Generates and returns name for new object in partition. if theIsToChangeCount is true partition icrease own counter to generate new name next time starting from new counter value. More...
 
Standard_Integer GetLastIndex () const
 Return Last index in partition (reserved);. More...
 
void SetLastIndex (const Standard_Integer theIndex)
 Sets Last index in partition (reserved);. More...
 
virtual Standard_Boolean Update ()
 Does nothing in the partition. More...
 
- Public Member Functions inherited from TObj_Object
virtual Handle< TObj_ModelGetModel () const
 Returns the model to which the object belongs. More...
 
virtual Handle< TObj_ObjectIteratorGetChildren (const Handle< Standard_Type > &theType=NULL) 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. More...
 
TDF_Label GetChildLabel () const
 Returns the label under which children are stored. More...
 
TDF_Label getChildLabel (const Standard_Integer theRank) const
 Returns the label for child with rank. More...
 
TDF_Label GetLabel () const
 Returns the OCAF label on which object`s data are stored. More...
 
TDF_Label GetDataLabel () const
 Returns the label which is the root for data OCAF sub-tree. More...
 
TDF_Label GetReferenceLabel () const
 Returns the label which is the root for reference OCAF sub-tree. More...
 
virtual Handle< TObj_TNameContainerGetDictionary () const
 Returns the map of names of the objects Default implementation returns global Dictionary of the model. More...
 
virtual Handle< TCollection_HExtendedStringGetName () const
 Returns the name of the object (empty string if object has no name) More...
 
Standard_Boolean GetName (TCollection_ExtendedString &theName) const
 Returns the Standard_True is object has name and returns name to theName. More...
 
Standard_Boolean GetName (TCollection_AsciiString &theName) const
 Returns the Standard_True is object has name and returns name to theName. More...
 
Standard_Boolean SetName (const Handle< TCollection_HAsciiString > &theName) const
 Sets name of the object. Returns False if theName is not unique. More...
 
Standard_Boolean SetName (const Standard_CString name) const
 Sets name of the object. Returns False if theName is not unique. More...
 
virtual Handle< TCollection_HExtendedStringGetNameForClone (const Handle< TObj_Object > &) const
 Returns name for copy default implementation returns the same name. More...
 
virtual Standard_Boolean HasReference (const Handle< TObj_Object > &theObject) const
 Returns True if object has reference to indicated object. More...
 
virtual Handle< TObj_ObjectIteratorGetReferences (const Handle< Standard_Type > &theType=NULL) const
 Returns an Iterator containing objects that compose the this one theType narrows a variety of iterated objects. More...
 
virtual void RemoveAllReferences ()
 Remove all references to other objects, by removing all reference attributes. More...
 
virtual Handle< TObj_ObjectIteratorGetBackReferences (const Handle< Standard_Type > &theType=NULL) const
 Returns iterator for the objects which depend on this one. These reffering objects may belong to other models. theType narrows a variety of iterated objects. More...
 
virtual void AddBackReference (const 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). More...
 
virtual void RemoveBackReference (const Handle< TObj_Object > &theObject, const Standard_Boolean theSingleOnly=Standard_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. More...
 
virtual Standard_Boolean RemoveBackReferences (const TObj_DeletingMode theMode=TObj_FreeOnly)
 Removes all back reference by removing references from other to me. More...
 
virtual void ClearBackReferences ()
 The default implementation just clear the back references container. More...
 
Standard_Boolean HasBackReferences () const
 Returns TRUE if obejct has 1 or more back references. More...
 
virtual void ReplaceReference (const Handle< TObj_Object > &theOldObject, const 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. More...
 
virtual Standard_Boolean 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. More...
 
virtual Standard_Boolean RelocateReferences (const TDF_Label &theFromRoot, const TDF_Label &theToRoot, const Standard_Boolean theUpdateBackRefs=Standard_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. More...
 
virtual Standard_Boolean CanRemoveReference (const 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. More...
 
virtual void RemoveReference (const Handle< TObj_Object > &theObject)
 Removes reference to the object by replace reference to NULL object. More...
 
virtual void BeforeForgetReference (const TDF_Label &)
 Invokes from TObj_TReference::BeforeForget(). theLabel - label on that reference become removed Default implementation is empty. More...
 
virtual Standard_Boolean CanDetach (const TObj_DeletingMode theMode=TObj_FreeOnly)
 Checks if object can be detached with specified mode. More...
 
virtual Standard_Boolean 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. More...
 
Handle< TObj_ObjectGetFatherObject (const Handle< Standard_Type > &theType=NULL) const
 Returns the father object, which may be NULL theType gives type of father object to search. More...
 
virtual Standard_Boolean IsAlive () const
 Checks that object alive in model Default implementation checks that object has TObject attribute at own label. More...
 
virtual Handle< TObj_ObjectClone (const TDF_Label &theTargetLabel, Handle< TDF_RelocationTable > theRelocTable=0)
 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 clonning all objects it is neccessary to call copy references with the same relocation table. More...
 
virtual void CopyReferences (const Handle< TObj_Object > &theTargetObject, const Handle< TDF_RelocationTable > &theRelocTable)
 Coping the references. return Standard_False is Target object is different type. More...
 
virtual void CopyChildren (TDF_Label &theTargetLabel, const Handle< TDF_RelocationTable > &theRelocTable)
 Coping the children from source label to the target. More...
 
virtual Standard_Integer GetOrder () const
 returns order of object (or tag of their label if order is not initialised) More...
 
virtual Standard_Boolean SetOrder (const Standard_Integer &theIndx)
 sets order of object More...
 
virtual Standard_Integer GetTypeFlags () const
 Returns flags (bitmask) that define properties of objects of that type By default returns flag Visible. More...
 
Standard_Integer GetFlags () const
 Returns mask of seted flags. More...
 
void SetFlags (const Standard_Integer theMask)
 Sets flags with defined mask. More...
 
Standard_Boolean TestFlags (const Standard_Integer theMask) const
 tests flags by the mask. More...
 
void ClearFlags (const Standard_Integer theMask=~0)
 clears flags by the mask. More...
 
virtual void BeforeStoring ()
 Preforms storing the objects transient fields in OCAF document which were outside transaction mechanism. Default implementation doesnot nothing. More...
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual void Delete () const
 Memory deallocator for transient classes. More...
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object. More...
 
Standard_Boolean IsInstance (const opencascade::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 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. 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...
 
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. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 
void IncrementRefCounter () const
 Increments the reference counter of this object. More...
 
Standard_Integer DecrementRefCounter () const
 Decrements the reference counter of this object; returns the decremented value. More...
 

Static Public Member Functions

static Handle< TObj_PartitionCreate (const TDF_Label &theLabel)
 Creates a new partition on given label. More...
 
static Handle< TObj_PartitionGetPartition (const Handle< TObj_Object > &theObject)
 Returns the partition in which object is stored. Null partition returned if not found. More...
 
- Static Public Member Functions inherited from TObj_Object
static Standard_Boolean 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 previos method. Returns true if there is no object on the label after detaching. More...
 
static Standard_Boolean GetObj (const TDF_Label &theLabel, Handle< TObj_Object > &theResult, const Standard_Boolean isSuper=Standard_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. More...
 
- Static Public Member Functions inherited from Standard_Transient
static const char * get_type_name ()
 Returns a type descriptor about this object. More...
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class. More...
 

Protected Types

enum  DataTag { DataTag_First = TObj_Object::DataTag_Last, DataTag_LastIndex, DataTag_Last = DataTag_First + 100 }
 
- Protected Types inherited from TObj_Object
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_Partition (const TDF_Label &theLabel)
 Constructor is protected; static methods are used for creation of this type of objects. More...
 
virtual Standard_Boolean copyData (const Handle< TObj_Object > &theTargetObject) override
 Coping the data of me to Target object. return Standard_False is Target object is different type. More...
 
- Protected Member Functions inherited from TObj_Object
 TObj_Object (const TDF_Label &theLabel, const Standard_Boolean theSetName=Standard_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. More...
 
 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. More...
 
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. More...
 
void copyReferences (const TDF_Label &theSourceLabel, TDF_Label &theTargetLabel, const Handle< TDF_RelocationTable > &theRelocTable)
 Coping the references from source label to the target. More...
 
TDF_Label getDataLabel (const Standard_Integer theRank1, const Standard_Integer 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. More...
 
TDF_Label getReferenceLabel (const Standard_Integer theRank1, const Standard_Integer 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. More...
 
Standard_Boolean isDataAttribute (const Standard_GUID &theGUID, const Standard_Integer theRank1, const Standard_Integer 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. More...
 
Standard_Real getReal (const Standard_Integer theRank1, const Standard_Integer 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. More...
 
Standard_Boolean setReal (const Standard_Real theValue, const Standard_Integer theRank1, const Standard_Integer theRank2=0, const Standard_Real 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) More...
 
Standard_Integer getInteger (const Standard_Integer theRank1, const Standard_Integer 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. More...
 
Standard_Boolean setInteger (const Standard_Integer theValue, const Standard_Integer theRank1, const Standard_Integer 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. More...
 
Handle< TColStd_HArray1OfReal > getRealArray (const Standard_Integer theLength, const Standard_Integer theRank1, const Standard_Integer theRank2=0, const Standard_Real 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. More...
 
Handle< TColStd_HArray1OfInteger > getIntegerArray (const Standard_Integer theLength, const Standard_Integer theRank1, const Standard_Integer theRank2=0, const Standard_Integer 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. More...
 
Handle< TColStd_HArray1OfExtendedString > getExtStringArray (const Standard_Integer theLength, const Standard_Integer theRank1, const Standard_Integer 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. More...
 
void setArray (const Handle< TColStd_HArray1OfReal > &theArray, const Standard_Integer theRank1, const Standard_Integer 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. More...
 
void setArray (const Handle< TColStd_HArray1OfInteger > &theArray, const Standard_Integer theRank1, const Standard_Integer 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. More...
 
void setArray (const Handle< TColStd_HArray1OfExtendedString > &theArray, const Standard_Integer theRank1, const Standard_Integer 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. More...
 
void setExtString (const Handle< TCollection_HExtendedString > &theValue, const Standard_Integer theRank1, const Standard_Integer 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). More...
 
Handle< TCollection_HExtendedStringgetExtString (const Standard_Integer theRank1, const Standard_Integer 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). More...
 
void setAsciiString (const Handle< TCollection_HAsciiString > &theValue, const Standard_Integer theRank1, const Standard_Integer 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). More...
 
Handle< TCollection_HAsciiStringgetAsciiString (const Standard_Integer theRank1, const Standard_Integer 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). More...
 
Handle< TObj_ObjectgetReference (const Standard_Integer theRank1, const Standard_Integer 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). More...
 
Standard_Boolean setReference (const Handle< TObj_Object > &theObject, const Standard_Integer theRank1, const Standard_Integer 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. More...
 
TDF_Label addReference (const Standard_Integer theRank1, const 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. More...
 

Additional Inherited Members

- Public Types inherited from TObj_Object
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. More...
 

Detailed Description

This class privides tool handling one of partitions (the set of homogenious elements) in the OCAF based model`s data structure

Member Enumeration Documentation

◆ DataTag

enum TObj_Partition::DataTag
protected
Enumerator
DataTag_First 
DataTag_LastIndex 
DataTag_Last 

Constructor & Destructor Documentation

◆ TObj_Partition()

TObj_Partition::TObj_Partition ( const TDF_Label theLabel)
protected

Constructor is protected; static methods are used for creation of this type of objects.

Constructor

Member Function Documentation

◆ AfterRetrieval()

virtual void TObj_Partition::AfterRetrieval ( )
overridevirtual

Preforms updating the links and dependances of the object which are not stored in persistence. Does not register the partition name.

Method for updating object afrer restoring

Reimplemented from TObj_Object.

◆ copyData()

virtual Standard_Boolean TObj_Partition::copyData ( const Handle< TObj_Object > &  theTargetObject)
overrideprotectedvirtual

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

protected redefined methods

Reimplemented from TObj_Object.

◆ Create()

static Handle< TObj_Partition > TObj_Partition::Create ( const TDF_Label theLabel)
static

Creates a new partition on given label.

Method for create partition

◆ GetLastIndex()

Standard_Integer TObj_Partition::GetLastIndex ( ) const

Return Last index in partition (reserved);.

◆ GetNamePrefix()

Handle< TCollection_HExtendedString > TObj_Partition::GetNamePrefix ( ) const
inline

Returns prefix for names of the objects in partition.

◆ GetNewName()

Handle< TCollection_HExtendedString > TObj_Partition::GetNewName ( const Standard_Boolean  theIsToChangeCount = Standard_True)

Generates and returns name for new object in partition. if theIsToChangeCount is true partition icrease own counter to generate new name next time starting from new counter value.

◆ GetPartition()

static Handle< TObj_Partition > TObj_Partition::GetPartition ( const Handle< TObj_Object > &  theObject)
static

Returns the partition in which object is stored. Null partition returned if not found.

Methods to define partition by object

◆ NewLabel()

TDF_Label TObj_Partition::NewLabel ( ) const

Creates and Returns label for new object in partition.

Methods handling of the objects in partition

◆ SetLastIndex()

void TObj_Partition::SetLastIndex ( const Standard_Integer  theIndex)

Sets Last index in partition (reserved);.

◆ SetName()

virtual Standard_Boolean TObj_Partition::SetName ( const Handle< TCollection_HExtendedString > &  theName) const
overridevirtual

Sets name of the object. partition does not check unique of own name.

Methods hanling name of the object

Reimplemented from TObj_Object.

◆ SetNamePrefix()

void TObj_Partition::SetNamePrefix ( const Handle< TCollection_HExtendedString > &  thePrefix)

Sets prefix for names of the objects in partition.

◆ Update()

virtual Standard_Boolean TObj_Partition::Update ( )
inlinevirtual

Does nothing in the partition.

Methods for updating the object


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