0024157: Parallelization of assembly part of BO
[occt.git] / src / TObj / TObj_Object.hxx
1 // Created on: 2004-11-22
2 // Created by: Pavel TELKOV
3 // Copyright (c) 2004-2012 OPEN CASCADE SAS
4 //
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
9 //
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12 //
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
19
20 // The original implementation Copyright: (C) RINA S.p.A
21
22 #ifndef TObj_Object_HeaderFile
23 #define TObj_Object_HeaderFile
24
25 #include <TObj_Common.hxx>
26 #include <TObj_DeletingMode.hxx>
27 #include <TObj_SequenceOfObject.hxx>
28 #include <Handle_TObj_Model.hxx>
29 #include <Handle_TObj_Object.hxx>
30
31 #include <TDF_Label.hxx>
32 #include <gp_XYZ.hxx>
33
34 class TObj_Persistence;
35 class Handle(TObj_ObjectIterator);
36 class Handle(TObj_TNameContainer);
37
38 class Handle(TCollection_HAsciiString);
39 class Handle(TCollection_HExtendedString);
40 class Handle(TColStd_HArray1OfReal);
41 class Handle(TColStd_HArray1OfInteger);
42 class Handle(TColStd_HArray1OfExtendedString);
43
44 //! Basis class for transient objects in OCAF-based models
45
46 class TObj_Object : public MMgt_TShared
47 {
48  public:
49   enum TypeFlags     //!< Flags that define type-specific behaviour of objects
50   {
51     Visible = 0x0001 //!< Is visible in DataViewer
52   };
53
54   //! enumeration describing various object state bit flags (see Set/GetFlags())
55   enum ObjectState
56   {
57     ObjectState_Hidden         = 0x0001, //!< object is hidden in tree browser
58     ObjectState_Saved          = 0x0002, //!< object has (or should have)
59                                          //!<   corresponding saved file on disk
60     ObjectState_Imported       = 0x0004, //!< object's data are just imported from somewhere
61     ObjectState_ImportedByFile = 0x0008, //!< a model imported by file may need a
62                                          //!<   sophisticated update of external references
63     ObjectState_Ordered        = 0x0010  //!< flag that partition contains ordered objects
64   };
65
66  protected:
67
68   //! enumeration for the ranks of label under Data section.
69   enum DataTag
70   {
71     DataTag_First = 0,
72     DataTag_Flags,     //!< stores flags of object
73     DataTag_Order,     //!< stores order of object
74     DataTag_Last = DataTag_First + 100 //!< Reserved for possible future use
75   };
76
77   //! enumeration for the ranks of label under Child section.
78   enum ChildTag
79   {
80     ChildTag_First = 0,
81     ChildTag_Last  = ChildTag_First //!< No children
82   };
83
84   //! enumeration for the ranks of label under Reference section.
85   enum RefTag
86   {
87     RefTag_First = 0,
88     RefTag_Last = RefTag_First //!< No children
89   };
90
91  protected:
92   /**
93   * Constructors
94   */
95
96   //! Constructor of a new object interface: requires label,
97   //! which should be one of the labels in model's data structure.
98   //! This creates a new object and attaches it to a given label.
99   //! The initialisation of the object's data and their integrity is
100   //! to be ensured by implementations and by persistence mechanism.
101   //! If the flag theSetName is true (default) the object is assign the default name
102   //! that is generated using the father partition object if any.
103   Standard_EXPORT TObj_Object (const TDF_Label& theLabel,
104                                    const Standard_Boolean theSetName = Standard_True);
105
106   //! The special constructor intended for implementation of persistence
107   //! mechanism. See class TObj_Persistence for more details.
108   //! The first argument is used only to avoid confusion with
109   //! other constructors.
110   Standard_EXPORT TObj_Object (const TObj_Persistence *,
111                                    const TDF_Label& theLabel)
112     : myLabel(theLabel) {}
113
114   //! This method is called from persistence to initialize the object fields,
115   //! so successors that have transient fields must initialize them in initFields(),
116   //! and call the same method of parent.
117   void initFields() {}
118
119  public:
120   /**
121   * Virtual methods
122   */
123
124   //! Returns the model to which the object belongs
125   virtual Standard_EXPORT Handle(TObj_Model) GetModel () const;
126
127   //! Returns iterator for the child objects.
128   //! This method provides tree-like view of the objects hierarchy.
129   //! The references to other objects are not considered as children.
130   //! theType narrows a variety of iterated objects
131   //! The default implementation search for children on 1 sublavel
132   //! of the children sub label
133   virtual Standard_EXPORT Handle(TObj_ObjectIterator) GetChildren
134                          (const Handle(Standard_Type)& theType = NULL) const;
135
136   //! Returns the label under which children are stored
137   Standard_EXPORT TDF_Label GetChildLabel() const;
138
139   //! Returns the label for child with rank
140   Standard_EXPORT TDF_Label getChildLabel(const Standard_Integer theRank) const;
141
142  public:
143   /**
144   * Access to the OCAF-specific data
145   */
146
147   //! Returns the OCAF label on which object`s data are stored
148   Standard_EXPORT TDF_Label GetLabel() const;
149
150   //! Returns the label which is the root for data OCAF sub-tree
151   Standard_EXPORT TDF_Label GetDataLabel() const;
152
153   //! Returns the label which is the root for reference OCAF sub-tree
154   Standard_EXPORT TDF_Label GetReferenceLabel() const;
155
156  public:
157   /**
158   * Methods hanling name of the object
159   */
160
161   //! Returns the map of names of the objects
162   //! Default implementation returns global Dictionary of the model
163   virtual Standard_EXPORT Handle(TObj_TNameContainer) GetDictionary() const;
164
165   //! Returns the name of the object (empty string if object has no name)
166   virtual Standard_EXPORT Handle(TCollection_HExtendedString) GetName() const;
167
168   //! Returns the Standard_True is object has name and returns name to theName
169   Standard_EXPORT Standard_Boolean GetName
170                         (TCollection_ExtendedString& theName) const;
171
172   //! Returns the Standard_True is object has name and returns name to theName
173   Standard_EXPORT Standard_Boolean GetName
174                         (TCollection_AsciiString& theName) const;
175
176   //! Sets name of the object. Returns False if theName is not unique.
177   virtual Standard_EXPORT Standard_Boolean SetName
178                         (const Handle(TCollection_HExtendedString)& theName) const;
179
180   //! Sets name of the object. Returns False if theName is not unique.
181   Standard_EXPORT Standard_Boolean SetName
182                         (const Handle(TCollection_HAsciiString)& theName) const;
183   
184   //! Sets name of the object. Returns False if theName is not unique.
185   Standard_EXPORT Standard_Boolean SetName (const Standard_CString name) const;
186
187   //! Returns name for copy
188   //! default implementation returns the same name
189   virtual Standard_EXPORT Handle(TCollection_HExtendedString) GetNameForClone
190     ( const Handle(TObj_Object)& ) const
191   { return GetName(); }
192
193  public:
194   /**
195   * Analysis of dependencies on other objects
196   */
197
198   //! Returns True if object has reference to indicated object
199   virtual Standard_EXPORT Standard_Boolean HasReference
200                          (const Handle(TObj_Object)& theObject) const;
201
202   //! Returns an Iterator containing objects that compose the this one
203   //! theType narrows a variety of iterated objects
204   virtual Standard_EXPORT Handle(TObj_ObjectIterator) GetReferences
205                          (const Handle(Standard_Type)& theType = NULL) const;
206
207   //! Remove all references to other objects, by removing all reference attributes
208   virtual Standard_EXPORT void RemoveAllReferences();
209
210   //! Returns iterator for the objects which depend on this one.
211   //! These reffering objects may belong to other models.
212   //! theType narrows a variety of iterated objects
213   virtual Standard_EXPORT Handle(TObj_ObjectIterator) GetBackReferences
214                          (const Handle(Standard_Type)& theType = NULL) const;
215
216   //! Registers another object as being dependent on this one.
217   //! Stores back references under sublabel 2 (purely transient data,
218   //! not subject to persistency).
219   virtual Standard_EXPORT void AddBackReference
220                         (const Handle(TObj_Object)& theObject);
221
222   //! Removes information on dependent object (back reference).
223   //! If theSingleOnly is true only the first back reference is removed in the 
224   //! case of duplicate items.
225   virtual Standard_EXPORT void RemoveBackReference
226                         (const Handle(TObj_Object)& theObject,
227                          const Standard_Boolean theSingleOnly = Standard_True);
228
229   //! Removes all back reference by removing references from other to me.
230   virtual Standard_EXPORT Standard_Boolean RemoveBackReferences
231     (const TObj_DeletingMode theMode = TObj_FreeOnly);
232
233   //! The default implementation just clear the back references container
234   virtual Standard_EXPORT void ClearBackReferences();
235
236   //! Returns TRUE if obejct has 1 or more back references
237   Standard_EXPORT Standard_Boolean HasBackReferences() const;
238   
239   //! Replace reference from old object to new object.
240   //! If it is not possible, may raise exception.
241   //! If new object is null then simple remove reference to old object.
242   virtual Standard_EXPORT void ReplaceReference
243                         (const Handle(TObj_Object)& theOldObject,
244                          const Handle(TObj_Object)& theNewObject);
245
246   //! Return True if this refers to the model theRoot belongs
247   //! to and a referred label is not a descendant of theRoot.
248   //! In this case theBadReference returns the currently referred label.
249   virtual Standard_EXPORT Standard_Boolean GetBadReference
250                          (const TDF_Label& theRoot,
251                           TDF_Label&       theBadReference) const;
252
253   //! Make that each reference pointing to a descendant label of
254   //! theFromRoot to point to an equivalent label under theToRoot.
255   //! Return False if a resulting reference does not point to
256   //! an TObj_Object
257   //! Example:
258   //! a referred object label = 0:3:24:7:2:7
259   //! theFromRoot             = 0:3:24
260   //! theToRoot               = 0:2
261   //! a new referred label    = 0:2:7:2:7
262   virtual Standard_EXPORT Standard_Boolean RelocateReferences
263                       (const TDF_Label&       theFromRoot,
264                        const TDF_Label&       theToRoot,
265                        const Standard_Boolean theUpdateBackRefs = Standard_True);
266
267   //! Returns True if the referred object theObject can be deleted 
268   //! without deletion of this object.
269   //! Default implementation does nothing and returns False.
270   virtual Standard_EXPORT Standard_Boolean CanRemoveReference
271                          (const Handle(TObj_Object)& theObject) const;
272
273   //! Removes reference to the object by replace reference to NULL object
274   virtual Standard_EXPORT void RemoveReference (const Handle(TObj_Object)& theObject);
275   
276   //! Invokes from TObj_TReference::BeforeForget().
277   //! theLabel - label on that reference become removed
278   //! Default implementation is empty
279   virtual Standard_EXPORT void BeforeForgetReference( const TDF_Label& /*theLabel*/ )
280   {}
281
282  public:
283   /**
284   * Methods for deleting the object
285   */
286
287   //! Checks if object can be detached with specified mode
288   virtual Standard_EXPORT Standard_Boolean CanDetach(const TObj_DeletingMode theMode = TObj_FreeOnly);
289
290   //! Deletes the object from the model. 
291   //! The dependent objects are either deleted or modified when possible
292   //! (see description of TObj_DeletingMode enumeration for more details)
293   //! Returns True if deletion was successful. 
294   //! Checks if object can be deleted.
295   //! Should be redefined for each specific kind of object
296   virtual Standard_EXPORT Standard_Boolean Detach
297                          (const TObj_DeletingMode theMode = TObj_FreeOnly);
298
299   //! Deletes the object from the label. Checks if object can be deleted.
300   //! Finds object on the label and detaches it by calling previos method.
301   //! Returns true if there is no object on the label after detaching
302   static Standard_EXPORT Standard_Boolean Detach
303                          (const TDF_Label& theLabel,
304                           const TObj_DeletingMode theMode = TObj_FreeOnly);
305
306  
307  public:
308   /**
309   * methods for object retrieval
310   */
311
312   //! Returns the Object attached to a given label.
313   //! Returns False if no object of type TObj_Object is stored on the
314   //! specified label.
315   //! If isSuper is true tries to find on the super labels.
316   static Standard_EXPORT Standard_Boolean GetObj
317                          (const TDF_Label&         theLabel,
318                           Handle(TObj_Object)& theResult,
319                           const Standard_Boolean   isSuper = Standard_False);
320
321   //! Returns the father object, which may be NULL
322   //! theType gives type of father object to search
323   Standard_EXPORT Handle(TObj_Object) GetFatherObject
324                          (const Handle(Standard_Type)& theType = NULL) const;
325
326  public:
327   /**
328   * Methods for checking and Updating object
329   */
330
331   //! Checks that object alive in model
332   //! Default implementation checks that object has TObject attribute at own label.
333   virtual Standard_EXPORT Standard_Boolean IsAlive() const;
334
335  public:
336   /**
337   * Cloning related methods
338   */
339
340   //! Copy me to other label theTargetLabel
341   //! New object will not have all the reference that has me.
342   //! Coping object with data and childs, but change name by adding string "_copy"
343   //! As result return handle of new object (null handle is something wrong)
344   //! NOTE: BackReferences not coping.
345   //! After clonning all objects it is neccessary to call copy references
346   //! with the same relocation table
347   virtual Standard_EXPORT Handle(TObj_Object) Clone
348                          (const TDF_Label&            theTargetLabel,
349                           Handle(TDF_RelocationTable) theRelocTable = 0);
350
351   //! Coping the references.
352   //! return Standard_False is Target object is different type
353   virtual Standard_EXPORT void CopyReferences
354                          (const Handle(TObj_Object)&     theTargetObject,
355                           const Handle(TDF_RelocationTable)& theRelocTable);
356
357   //! Coping the children from source label to the target.
358   virtual Standard_EXPORT void CopyChildren
359                          (TDF_Label&                         theTargetLabel,
360                           const Handle(TDF_RelocationTable)& theRelocTable);
361
362
363  public:
364   /**
365   * Public methods to access order of object
366   */
367
368    //! returns order of object (or tag of their label if order is not initialised)
369    virtual Standard_EXPORT Standard_Integer GetOrder() const;
370
371    //! sets order of object
372    virtual Standard_EXPORT Standard_Boolean SetOrder( const Standard_Integer& theIndx );
373
374  protected:
375   /**
376   * Protected Methods copy data of object to other object
377   */
378
379   //! Coping the data of me to Target object.
380   //! return Standard_False is Target object is different type
381   virtual Standard_EXPORT Standard_Boolean copyData
382                         (const Handle(TObj_Object)& theTargetObject);
383
384   //! Coping the references from source label to the target.
385   Standard_EXPORT void copyReferences
386                        (const TDF_Label&                   theSourceLabel,
387                         TDF_Label&                         theTargetLabel,
388                         const Handle(TDF_RelocationTable)& theRelocTable);
389
390  public:
391   /**
392   * Access to object flags
393   */
394
395   //! Returns flags (bitmask) that define properties of objects of that type
396   //! By default returns flag Visible
397   virtual Standard_EXPORT Standard_Integer GetTypeFlags() const;
398   
399   //! Returns mask of seted flags
400   Standard_EXPORT Standard_Integer GetFlags() const;
401
402   //! Sets flags with defined mask.
403   Standard_EXPORT void SetFlags(const Standard_Integer theMask);
404
405   //! tests flags by the mask.
406   Standard_EXPORT Standard_Boolean TestFlags(const Standard_Integer theMask) const;
407
408   //! clears flags by the mask.
409   Standard_EXPORT void ClearFlags(const Standard_Integer theMask = ~0);
410
411  public:
412   /**
413   * Method for updating object afrer restoring
414   */
415
416   //! Preforms updating the links and dependances of the object which are not
417   //! stored in persistence. Should be redefined if necessary.
418   virtual Standard_EXPORT void AfterRetrieval();
419
420   //! Preforms storing the objects transient fields in OCAF document
421   //! which were outside transaction mechanism.
422   //! Default implementation doesnot nothing
423   virtual Standard_EXPORT void BeforeStoring();
424
425  protected:
426   /**
427   * Internal tools for work with OCAF data
428   */
429
430   //! Returns the theRank2-th sub label of the theRank1-th  sublabel of the
431   //! Data label of the object.
432   //! If theRank2 is 0 (default), sub label theRank1 of Data label is returned.
433   //! If requested label does not exist, it is created.
434   Standard_EXPORT TDF_Label getDataLabel
435                         (const Standard_Integer theRank1,
436                          const Standard_Integer theRank2 = 0) const;
437
438   //! Returns the theRank2-th sub label of the theRank1-th  sublabel of the
439   //! Reference label of the object.
440   //! If theRank2 is 0 (default), sub label theRank1 of Reference label is returned.
441   //! If requested label does not exist, it is created.
442   Standard_EXPORT TDF_Label getReferenceLabel
443                         (const Standard_Integer theRank1,
444                          const Standard_Integer theRank2 = 0) const;
445
446   //! Returns True if there is an attribute having theGUID on the
447   //! theRank2-th sublabel of theRank1-th sublabel of the Data
448   //! label of the object.
449   //! If theRank2 is 0 (default), label theRank1 is supposed, not
450   //! its sublabel
451   Standard_EXPORT Standard_Boolean isDataAttribute
452                         (const Standard_GUID&   theGUID,
453                          const Standard_Integer theRank1,
454                          const Standard_Integer theRank2 = 0) const;
455
456   //! Returns the real value from theRank2-th sublabel of theRank1-th
457   //! sublabel of the Data label of the object.
458   //! If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
459   //! Returns 0.0 if no real value is stored on that label.
460   Standard_EXPORT Standard_Real getReal
461                         (const Standard_Integer theRank1,
462                          const Standard_Integer theRank2 = 0) const;
463
464   //! Sets the real value for theRank2-th sublabel of theRank1-th
465   //! sublabel of the Data label of the object.
466   //! If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
467   //! Returns True if new value is actually different from previous one
468   //! (with specified tolerance)
469   Standard_EXPORT Standard_Boolean setReal
470                         (const Standard_Real theValue,
471                          const Standard_Integer theRank1,
472                          const Standard_Integer theRank2 = 0,
473                          const Standard_Real theTolerance = 0.) const;
474
475   //! Returns the integer value from theRank2-th sublabel of theRank1-th
476   //! sublabel of the Data label of the object.
477   //! If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
478   //! Returns 0 if no integer value is stored on that label.
479   Standard_EXPORT Standard_Integer getInteger
480                         (const Standard_Integer theRank1,
481                          const Standard_Integer theRank2 = 0) const;
482
483   //! Sets the integer value for theRank2-th sublabel of theRank1-th
484   //! sublabel of the Data label of the object.
485   //! If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
486   //! Returns True if new value is actually different from previous one
487   Standard_EXPORT Standard_Boolean setInteger
488                         (const Standard_Integer theValue,
489                          const Standard_Integer theRank1,
490                          const Standard_Integer theRank2 = 0) const;
491
492   //! Returns an existing or create a new real array on theRank2-th
493   //! sublabel of theRank1-th sublabel of the Data label of the object.
494   //! If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
495   //! A newly created array has 1 and theLength bounds and is initialized
496   //! with theInitialValue
497   //!
498   //! NOTE: do not create new array and returns NULL handle if no array on label
499   //!       and theLength less than 
500   //!
501   //! WARNING: call setArray() after array contents modification
502   //! in order to assure Undo work
503   Standard_EXPORT Handle(TColStd_HArray1OfReal) getRealArray
504                         (const Standard_Integer theLength,
505                          const Standard_Integer theRank1,
506                          const Standard_Integer theRank2 = 0,
507                          const Standard_Real    theInitialValue = 0.0) const;
508
509   //! Returns an existing or create a new integer array on theRank2-th
510   //! sublabel of theRank1-th sublabel of the Data label of the object.
511   //! If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
512   //! A newly created array has 1 and theLength bounds and is initialized
513   //! with theInitialValue
514   //!
515   //! NOTE: do not create new array and returns NULL handle if no array on label
516   //!       and theLength less than 
517   //!
518   //! WARNING: call setArray() after array contents modification
519   //! in order to assure Undo work
520   Standard_EXPORT Handle(TColStd_HArray1OfInteger) getIntegerArray
521                         (const Standard_Integer theLength,
522                          const Standard_Integer theRank1,
523                          const Standard_Integer theRank2 = 0,
524                          const Standard_Integer theInitialValue = 0) const;
525
526   //! Returns an existing or create a new string array on theRank2-th
527   //! sublabel of theRank1-th sublabel of the Data label of the object.
528   //! If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
529   //! A newly created array has 1 and theLength bounds
530   //! NOTE: new created array is NOT initialized.
531   //!
532   //! NOTE: do not create new array and returns NULL handle if no array on label
533   //!       and theLength less than 
534   //!
535   //! WARNING: call setArray() after array contents modification
536   //! in order to assure Undo work
537   Standard_EXPORT Handle(TColStd_HArray1OfExtendedString) getExtStringArray
538                         (const Standard_Integer theLength,
539                          const Standard_Integer theRank1,
540                          const Standard_Integer theRank2 = 0) const;
541
542   //! Store theArray on theRank2-th sublabel of theRank1-th sublabel
543   //! of the Data label of the object.
544   //! If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
545   //! If theArray is null then array attribute if any is removed.
546   Standard_EXPORT void setArray
547                          (const Handle(TColStd_HArray1OfReal)& theArray,
548                           const Standard_Integer theRank1,
549                           const Standard_Integer theRank2 = 0);
550
551   //! Store theArray on theRank2-th sublabel of theRank1-th sublabel
552   //! of the Data label of the object.
553   //! If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
554   //! If theArray is null then array attribute if any is removed.
555   Standard_EXPORT void setArray
556                          (const Handle(TColStd_HArray1OfInteger)& theArray,
557                           const Standard_Integer theRank1,
558                           const Standard_Integer theRank2 = 0);
559
560   //! Store theArray on theRank2-th sublabel of theRank1-th sublabel
561   //! of the Data label of the object.
562   //! If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
563   //! If theArray is null then array attribute if any is removed.
564   Standard_EXPORT void setArray
565                          (const Handle(TColStd_HArray1OfExtendedString)& theArray,
566                           const Standard_Integer theRank1,
567                           const Standard_Integer theRank2 = 0);
568
569   //! Sets the string value for theRank2-th sublabel of theRank1-th
570   //! sublabel of the Data label of the object.
571   //! If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
572   Standard_EXPORT void setExtString
573                         (const Handle(TCollection_HExtendedString)& theValue,
574                          const Standard_Integer theRank1,
575                          const Standard_Integer theRank2 = 0) const;
576
577   //! Returns the string value from theRank2-th sublabel of theRank1-th
578   //! sublabel of the Data label of the object.
579   //! If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
580   Standard_EXPORT Handle(TCollection_HExtendedString) getExtString
581                         (const Standard_Integer theRank1,
582                          const Standard_Integer theRank2 = 0) const;
583
584   //! Sets the ascii string value for theRank2-th sublabel of theRank1-th
585   //! sublabel of the Data label of the object.
586   //! If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
587   Standard_EXPORT void setAsciiString
588                         (const Handle(TCollection_HAsciiString)& theValue,
589                          const Standard_Integer theRank1,
590                          const Standard_Integer theRank2 = 0) const;
591
592   //! Returns the string value from theRank2-th sublabel of theRank1-th
593   //! sublabel of the Data label of the object.
594   //! If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
595   Standard_EXPORT Handle(TCollection_HAsciiString) getAsciiString
596                         (const Standard_Integer theRank1,
597                          const Standard_Integer theRank2 = 0) const;
598
599   //! Returns the reference attribute from theRank2-th sublabel of theRank1-th
600   //! sublabel of the References label of the object.
601   //! If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
602   Standard_EXPORT Handle(TObj_Object) getReference
603                         (const Standard_Integer theRank1,
604                          const Standard_Integer theRank2 = 0) const;
605
606   //! Sets the reference to theObject on theRank2-th sublabel of theRank1-th
607   //! sublabel of the References label of the object.
608   //! If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
609   //! Returns True if new value is actually different from previous one
610   //! If Object is NULL, reference is deleted
611   Standard_EXPORT Standard_Boolean setReference
612                         (const Handle(TObj_Object) &theObject,
613                          const Standard_Integer theRank1,
614                          const Standard_Integer theRank2 = 0);
615
616   //! Adds the reference to theObject on next free sublabel of theRank1-th
617   //! sublabel of the References label of the object and returns the Label.
618   Standard_EXPORT TDF_Label addReference
619                         (const Standard_Integer theRank1,
620                          const Handle(TObj_Object) &theObject);
621
622  private:
623   /**
624   * Fields
625   */
626   TDF_Label myLabel;                            //!< Label on which object`s data are stored
627
628   Handle(TObj_HSequenceOfObject) myHSeqBackRef; //!< hsequence of back references.
629
630  friend class TObj_TObject;
631
632  public:
633   //! CASCADE RTTI
634   DEFINE_STANDARD_RTTI(TObj_Object)
635 };
636
637 //! Define handle in separate file
638
639 #endif
640
641 #ifdef _MSC_VER
642 #pragma once
643 #endif