Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-07 08:36:58

0001 // Created on: 2004-11-22
0002 // Created by: Pavel TELKOV
0003 // Copyright (c) 2004-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 // The original implementation Copyright: (C) RINA S.p.A
0017 
0018 #ifndef TObj_Object_HeaderFile
0019 #define TObj_Object_HeaderFile
0020 
0021 #include <TObj_DeletingMode.hxx>
0022 #include <TObj_SequenceOfObject.hxx>
0023 
0024 #include <TDF_Label.hxx>
0025 #include <gp_XYZ.hxx>
0026 
0027 class TObj_Model;
0028 class TObj_Persistence;
0029 class TObj_ObjectIterator;
0030 class TObj_TNameContainer;
0031 class TCollection_HExtendedString;
0032 class TCollection_HAsciiString;
0033 
0034 #include <TColStd_HArray1OfInteger.hxx>
0035 #include <TColStd_HArray1OfReal.hxx>
0036 #include <TColStd_HArray1OfExtendedString.hxx>
0037 
0038 class TObj_Object;
0039 DEFINE_STANDARD_HANDLE(TObj_Object, Standard_Transient)
0040 
0041 //! Basis class for transient objects in OCAF-based models
0042 
0043 class TObj_Object : public Standard_Transient
0044 {
0045 public:
0046   enum TypeFlags //!< Flags that define type-specific behaviour of objects
0047   {
0048     Visible = 0x0001 //!< Is visible in DataViewer
0049   };
0050 
0051   //! enumeration describing various object state bit flags (see Set/GetFlags())
0052   enum ObjectState
0053   {
0054     ObjectState_Hidden = 0x0001,         //!< object is hidden in tree browser
0055     ObjectState_Saved  = 0x0002,         //!< object has (or should have)
0056                                          //!<   corresponding saved file on disk
0057     ObjectState_Imported       = 0x0004, //!< object's data are just imported from somewhere
0058     ObjectState_ImportedByFile = 0x0008, //!< a model imported by file may need a
0059                                          //!<   sophisticated update of external references
0060     ObjectState_Ordered = 0x0010         //!< flag that partition contains ordered objects
0061   };
0062 
0063 protected:
0064   //! enumeration for the ranks of label under Data section.
0065   enum DataTag
0066   {
0067     DataTag_First = 0,
0068     DataTag_Flags,                     //!< stores flags of object
0069     DataTag_Order,                     //!< stores order of object
0070     DataTag_Last = DataTag_First + 100 //!< Reserved for possible future use
0071   };
0072 
0073   //! enumeration for the ranks of label under Child section.
0074   enum ChildTag
0075   {
0076     ChildTag_First = 0,
0077     ChildTag_Last  = ChildTag_First //!< No children
0078   };
0079 
0080   //! enumeration for the ranks of label under Reference section.
0081   enum RefTag
0082   {
0083     RefTag_First = 0,
0084     RefTag_Last  = RefTag_First //!< No children
0085   };
0086 
0087 protected:
0088   /**
0089    * Constructors
0090    */
0091 
0092   //! Constructor of a new object interface: requires label,
0093   //! which should be one of the labels in model's data structure.
0094   //! This creates a new object and attaches it to a given label.
0095   //! The initialisation of the object's data and their integrity is
0096   //! to be ensured by implementations and by persistence mechanism.
0097   //! If the flag theSetName is true (default) the object is assign the default name
0098   //! that is generated using the father partition object if any.
0099   Standard_EXPORT TObj_Object(const TDF_Label&       theLabel,
0100                               const Standard_Boolean theSetName = Standard_True);
0101 
0102   //! The special constructor intended for implementation of persistence
0103   //! mechanism. See class TObj_Persistence for more details.
0104   //! The first argument is used only to avoid confusion with
0105   //! other constructors.
0106   TObj_Object(const TObj_Persistence*, const TDF_Label& theLabel)
0107       : myLabel(theLabel)
0108   {
0109   }
0110 
0111   //! This method is called from persistence to initialize the object fields,
0112   //! so successors that have transient fields must initialize them in initFields(),
0113   //! and call the same method of parent.
0114   void initFields() {}
0115 
0116 public:
0117   /**
0118    * Virtual methods
0119    */
0120 
0121   //! Returns the model to which the object belongs
0122   virtual Standard_EXPORT Handle(TObj_Model) GetModel() const;
0123 
0124   //! Returns iterator for the child objects.
0125   //! This method provides tree-like view of the objects hierarchy.
0126   //! The references to other objects are not considered as children.
0127   //! theType narrows a variety of iterated objects
0128   //! The default implementation search for children on 1 sublavel
0129   //! of the children sub label
0130   virtual Standard_EXPORT Handle(TObj_ObjectIterator) GetChildren(
0131     const Handle(Standard_Type)& theType = NULL) const;
0132 
0133   //! Returns the label under which children are stored
0134   Standard_EXPORT TDF_Label GetChildLabel() const;
0135 
0136   //! Returns the label for child with rank
0137   Standard_EXPORT TDF_Label getChildLabel(const Standard_Integer theRank) const;
0138 
0139 public:
0140   /**
0141    * Access to the OCAF-specific data
0142    */
0143 
0144   //! Returns the OCAF label on which object`s data are stored
0145   Standard_EXPORT TDF_Label GetLabel() const;
0146 
0147   //! Returns the label which is the root for data OCAF sub-tree
0148   Standard_EXPORT TDF_Label GetDataLabel() const;
0149 
0150   //! Returns the label which is the root for reference OCAF sub-tree
0151   Standard_EXPORT TDF_Label GetReferenceLabel() const;
0152 
0153 public:
0154   /**
0155    * Methods handling name of the object
0156    */
0157 
0158   //! Returns the map of names of the objects
0159   //! Default implementation returns global Dictionary of the model
0160   virtual Standard_EXPORT Handle(TObj_TNameContainer) GetDictionary() const;
0161 
0162   //! Returns the name of the object (empty string if object has no name)
0163   virtual Standard_EXPORT Handle(TCollection_HExtendedString) GetName() const;
0164 
0165   //! Returns the Standard_True is object has name and returns name to theName
0166   Standard_EXPORT Standard_Boolean GetName(TCollection_ExtendedString& theName) const;
0167 
0168   //! Returns the Standard_True is object has name and returns name to theName
0169   Standard_EXPORT Standard_Boolean GetName(TCollection_AsciiString& theName) const;
0170 
0171   //! Sets name of the object. Returns False if theName is not unique.
0172   virtual Standard_EXPORT Standard_Boolean
0173     SetName(const Handle(TCollection_HExtendedString)& theName) const;
0174 
0175   //! Sets name of the object. Returns False if theName is not unique.
0176   Standard_EXPORT Standard_Boolean SetName(const Handle(TCollection_HAsciiString)& theName) const;
0177 
0178   //! Sets name of the object. Returns False if theName is not unique.
0179   Standard_EXPORT Standard_Boolean SetName(const Standard_CString name) const;
0180 
0181   //! Returns name for copy
0182   //! default implementation returns the same name
0183   virtual Handle(TCollection_HExtendedString) GetNameForClone(const Handle(TObj_Object)&) const
0184   {
0185     return GetName();
0186   }
0187 
0188 public:
0189   /**
0190    * Analysis of dependencies on other objects
0191    */
0192 
0193   //! Returns True if object has reference to indicated object
0194   virtual Standard_EXPORT Standard_Boolean HasReference(const Handle(TObj_Object)& theObject) const;
0195 
0196   //! Returns an Iterator containing objects that compose the this one
0197   //! theType narrows a variety of iterated objects
0198   virtual Standard_EXPORT Handle(TObj_ObjectIterator) GetReferences(
0199     const Handle(Standard_Type)& theType = NULL) const;
0200 
0201   //! Remove all references to other objects, by removing all reference attributes
0202   virtual Standard_EXPORT void RemoveAllReferences();
0203 
0204   //! Returns iterator for the objects which depend on this one.
0205   //! These referring objects may belong to other models.
0206   //! theType narrows a variety of iterated objects
0207   virtual Standard_EXPORT Handle(TObj_ObjectIterator) GetBackReferences(
0208     const Handle(Standard_Type)& theType = NULL) const;
0209 
0210   //! Registers another object as being dependent on this one.
0211   //! Stores back references under sublabel 2 (purely transient data,
0212   //! not subject to persistency).
0213   virtual Standard_EXPORT void AddBackReference(const Handle(TObj_Object)& theObject);
0214 
0215   //! Removes information on dependent object (back reference).
0216   //! If theSingleOnly is true only the first back reference is removed in the
0217   //! case of duplicate items.
0218   virtual Standard_EXPORT void RemoveBackReference(
0219     const Handle(TObj_Object)& theObject,
0220     const Standard_Boolean     theSingleOnly = Standard_True);
0221 
0222   //! Removes all back reference by removing references from other to me.
0223   virtual Standard_EXPORT Standard_Boolean
0224     RemoveBackReferences(const TObj_DeletingMode theMode = TObj_FreeOnly);
0225 
0226   //! The default implementation just clear the back references container
0227   virtual Standard_EXPORT void ClearBackReferences();
0228 
0229   //! Returns TRUE if object has 1 or more back references
0230   Standard_EXPORT Standard_Boolean HasBackReferences() const;
0231 
0232   //! Replace reference from old object to new object.
0233   //! If it is not possible, may raise exception.
0234   //! If new object is null then simple remove reference to old object.
0235   virtual Standard_EXPORT void ReplaceReference(const Handle(TObj_Object)& theOldObject,
0236                                                 const Handle(TObj_Object)& theNewObject);
0237 
0238   //! Return True if this refers to the model theRoot belongs
0239   //! to and a referred label is not a descendant of theRoot.
0240   //! In this case theBadReference returns the currently referred label.
0241   virtual Standard_EXPORT Standard_Boolean GetBadReference(const TDF_Label& theRoot,
0242                                                            TDF_Label&       theBadReference) const;
0243 
0244   //! Make that each reference pointing to a descendant label of
0245   //! theFromRoot to point to an equivalent label under theToRoot.
0246   //! Return False if a resulting reference does not point to
0247   //! an TObj_Object
0248   //! Example:
0249   //! a referred object label = 0:3:24:7:2:7
0250   //! theFromRoot             = 0:3:24
0251   //! theToRoot               = 0:2
0252   //! a new referred label    = 0:2:7:2:7
0253   virtual Standard_EXPORT Standard_Boolean
0254     RelocateReferences(const TDF_Label&       theFromRoot,
0255                        const TDF_Label&       theToRoot,
0256                        const Standard_Boolean theUpdateBackRefs = Standard_True);
0257 
0258   //! Returns True if the referred object theObject can be deleted
0259   //! without deletion of this object.
0260   //! Default implementation does nothing and returns False.
0261   virtual Standard_EXPORT Standard_Boolean
0262     CanRemoveReference(const Handle(TObj_Object)& theObject) const;
0263 
0264   //! Removes reference to the object by replace reference to NULL object
0265   virtual Standard_EXPORT void RemoveReference(const Handle(TObj_Object)& theObject);
0266 
0267   //! Invokes from TObj_TReference::BeforeForget().
0268   //! theLabel - label on that reference become removed
0269   //! Default implementation is empty
0270   virtual void BeforeForgetReference(const TDF_Label& /*theLabel*/) {}
0271 
0272 public:
0273   /**
0274    * Methods for deleting the object
0275    */
0276 
0277   //! Checks if object can be detached with specified mode
0278   virtual Standard_EXPORT Standard_Boolean
0279     CanDetach(const TObj_DeletingMode theMode = TObj_FreeOnly);
0280 
0281   //! Deletes the object from the model.
0282   //! The dependent objects are either deleted or modified when possible
0283   //! (see description of TObj_DeletingMode enumeration for more details)
0284   //! Returns True if deletion was successful.
0285   //! Checks if object can be deleted.
0286   //! Should be redefined for each specific kind of object
0287   virtual Standard_EXPORT Standard_Boolean Detach(const TObj_DeletingMode theMode = TObj_FreeOnly);
0288 
0289   //! Deletes the object from the label. Checks if object can be deleted.
0290   //! Finds object on the label and detaches it by calling previous method.
0291   //! Returns true if there is no object on the label after detaching
0292   static Standard_EXPORT Standard_Boolean Detach(const TDF_Label&        theLabel,
0293                                                  const TObj_DeletingMode theMode = TObj_FreeOnly);
0294 
0295 public:
0296   /**
0297    * methods for object retrieval
0298    */
0299 
0300   //! Returns the Object attached to a given label.
0301   //! Returns False if no object of type TObj_Object is stored on the
0302   //! specified label.
0303   //! If isSuper is true tries to find on the super labels.
0304   static Standard_EXPORT Standard_Boolean GetObj(const TDF_Label&       theLabel,
0305                                                  Handle(TObj_Object)&   theResult,
0306                                                  const Standard_Boolean isSuper = Standard_False);
0307 
0308   //! Returns the father object, which may be NULL
0309   //! theType gives type of father object to search
0310   Standard_EXPORT Handle(TObj_Object) GetFatherObject(
0311     const Handle(Standard_Type)& theType = NULL) const;
0312 
0313 public:
0314   /**
0315    * Methods for checking and Updating object
0316    */
0317 
0318   //! Checks that object alive in model
0319   //! Default implementation checks that object has TObject attribute at own label.
0320   virtual Standard_EXPORT Standard_Boolean IsAlive() const;
0321 
0322 public:
0323   /**
0324    * Cloning related methods
0325    */
0326 
0327   //! Copy me to other label theTargetLabel
0328   //! New object will not have all the reference that has me.
0329   //! Coping object with data and childs, but change name by adding string "_copy"
0330   //! As result return handle of new object (null handle is something wrong)
0331   //! NOTE: BackReferences not coping.
0332   //! After cloning all objects it is necessary to call copy references
0333   //! with the same relocation table
0334   virtual Standard_EXPORT Handle(TObj_Object) Clone(const TDF_Label&            theTargetLabel,
0335                                                     Handle(TDF_RelocationTable) theRelocTable = 0);
0336 
0337   //! Coping the references.
0338   //! return Standard_False is Target object is different type
0339   virtual Standard_EXPORT void CopyReferences(const Handle(TObj_Object)&         theTargetObject,
0340                                               const Handle(TDF_RelocationTable)& theRelocTable);
0341 
0342   //! Coping the children from source label to the target.
0343   virtual Standard_EXPORT void CopyChildren(TDF_Label&                         theTargetLabel,
0344                                             const Handle(TDF_RelocationTable)& theRelocTable);
0345 
0346 public:
0347   /**
0348    * Public methods to access order of object
0349    */
0350 
0351   //! returns order of object (or tag of their label if order is not initialised)
0352   virtual Standard_EXPORT Standard_Integer GetOrder() const;
0353 
0354   //! sets order of object
0355   virtual Standard_EXPORT Standard_Boolean SetOrder(const Standard_Integer& theIndx);
0356 
0357 public:
0358   /**
0359    * Public methods to check modifications of the object since last commit
0360    */
0361   //! Returns true if object attributes or its children were modified in the current open
0362   //! transaction
0363   Standard_EXPORT Standard_Boolean HasModifications() const;
0364 
0365 protected:
0366   /**
0367    * Protected Methods copy data of object to other object
0368    */
0369 
0370   //! Coping the data of me to Target object.
0371   //! return Standard_False is Target object is different type
0372   virtual Standard_EXPORT Standard_Boolean copyData(const Handle(TObj_Object)& theTargetObject);
0373 
0374   //! Coping the references from source label to the target.
0375   Standard_EXPORT void copyReferences(const TDF_Label&                   theSourceLabel,
0376                                       TDF_Label&                         theTargetLabel,
0377                                       const Handle(TDF_RelocationTable)& theRelocTable);
0378 
0379 public:
0380   /**
0381    * Access to object flags
0382    */
0383 
0384   //! Returns flags (bitmask) that define properties of objects of that type
0385   //! By default returns flag Visible
0386   virtual Standard_EXPORT Standard_Integer GetTypeFlags() const;
0387 
0388   //! Returns mask of seted flags
0389   Standard_EXPORT Standard_Integer GetFlags() const;
0390 
0391   //! Sets flags with defined mask.
0392   Standard_EXPORT void SetFlags(const Standard_Integer theMask);
0393 
0394   //! tests flags by the mask.
0395   Standard_EXPORT Standard_Boolean TestFlags(const Standard_Integer theMask) const;
0396 
0397   //! clears flags by the mask.
0398   Standard_EXPORT void ClearFlags(const Standard_Integer theMask = ~0);
0399 
0400 public:
0401   /**
0402    * Method for updating object after restoring
0403    */
0404 
0405   //! Performs updating the links and dependences of the object which are not
0406   //! stored in persistence. Should be redefined if necessary.
0407   virtual Standard_EXPORT void AfterRetrieval();
0408 
0409   //! Performs storing the objects transient fields in OCAF document
0410   //! which were outside transaction mechanism.
0411   //! Default implementation does nothing
0412   virtual Standard_EXPORT void BeforeStoring();
0413 
0414 protected:
0415   /**
0416    * Internal tools for work with OCAF data
0417    */
0418 
0419   //! Returns the theRank2-th sub label of the theRank1-th  sublabel of the
0420   //! Data label of the object.
0421   //! If theRank2 is 0 (default), sub label theRank1 of Data label is returned.
0422   //! If requested label does not exist, it is created.
0423   Standard_EXPORT TDF_Label getDataLabel(const Standard_Integer theRank1,
0424                                          const Standard_Integer theRank2 = 0) const;
0425 
0426   //! Returns the theRank2-th sub label of the theRank1-th  sublabel of the
0427   //! Reference label of the object.
0428   //! If theRank2 is 0 (default), sub label theRank1 of Reference label is returned.
0429   //! If requested label does not exist, it is created.
0430   Standard_EXPORT TDF_Label getReferenceLabel(const Standard_Integer theRank1,
0431                                               const Standard_Integer theRank2 = 0) const;
0432 
0433   //! Returns True if there is an attribute having theGUID on the
0434   //! theRank2-th sublabel of theRank1-th sublabel of the Data
0435   //! label of the object.
0436   //! If theRank2 is 0 (default), label theRank1 is supposed, not
0437   //! its sublabel
0438   Standard_EXPORT Standard_Boolean isDataAttribute(const Standard_GUID&   theGUID,
0439                                                    const Standard_Integer theRank1,
0440                                                    const Standard_Integer theRank2 = 0) const;
0441 
0442   //! Returns the real value from theRank2-th sublabel of theRank1-th
0443   //! sublabel of the Data label of the object.
0444   //! If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
0445   //! Returns 0.0 if no real value is stored on that label.
0446   Standard_EXPORT Standard_Real getReal(const Standard_Integer theRank1,
0447                                         const Standard_Integer theRank2 = 0) const;
0448 
0449   //! Sets the real value for theRank2-th sublabel of theRank1-th
0450   //! sublabel of the Data label of the object.
0451   //! If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
0452   //! Returns True if new value is actually different from previous one
0453   //! (with specified tolerance)
0454   Standard_EXPORT Standard_Boolean setReal(const Standard_Real    theValue,
0455                                            const Standard_Integer theRank1,
0456                                            const Standard_Integer theRank2     = 0,
0457                                            const Standard_Real    theTolerance = 0.) const;
0458 
0459   //! Returns the integer value from theRank2-th sublabel of theRank1-th
0460   //! sublabel of the Data label of the object.
0461   //! If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
0462   //! Returns 0 if no integer value is stored on that label.
0463   Standard_EXPORT Standard_Integer getInteger(const Standard_Integer theRank1,
0464                                               const Standard_Integer theRank2 = 0) const;
0465 
0466   //! Sets the integer value for theRank2-th sublabel of theRank1-th
0467   //! sublabel of the Data label of the object.
0468   //! If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
0469   //! Returns True if new value is actually different from previous one
0470   Standard_EXPORT Standard_Boolean setInteger(const Standard_Integer theValue,
0471                                               const Standard_Integer theRank1,
0472                                               const Standard_Integer theRank2 = 0) const;
0473 
0474   //! Returns an existing or create a new real array on theRank2-th
0475   //! sublabel of theRank1-th sublabel of the Data label of the object.
0476   //! If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
0477   //! A newly created array has 1 and theLength bounds and is initialized
0478   //! with theInitialValue
0479   //!
0480   //! NOTE: do not create new array and returns NULL handle if no array on label
0481   //!       and theLength less than
0482   //!
0483   //! WARNING: call setArray() after array contents modification
0484   //! in order to assure Undo work
0485   Standard_EXPORT Handle(TColStd_HArray1OfReal) getRealArray(
0486     const Standard_Integer theLength,
0487     const Standard_Integer theRank1,
0488     const Standard_Integer theRank2        = 0,
0489     const Standard_Real    theInitialValue = 0.0) const;
0490 
0491   //! Returns an existing or create a new integer array on theRank2-th
0492   //! sublabel of theRank1-th sublabel of the Data label of the object.
0493   //! If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
0494   //! A newly created array has 1 and theLength bounds and is initialized
0495   //! with theInitialValue
0496   //!
0497   //! NOTE: do not create new array and returns NULL handle if no array on label
0498   //!       and theLength less than
0499   //!
0500   //! WARNING: call setArray() after array contents modification
0501   //! in order to assure Undo work
0502   Standard_EXPORT Handle(TColStd_HArray1OfInteger) getIntegerArray(
0503     const Standard_Integer theLength,
0504     const Standard_Integer theRank1,
0505     const Standard_Integer theRank2        = 0,
0506     const Standard_Integer theInitialValue = 0) const;
0507 
0508   //! Returns an existing or create a new string array on theRank2-th
0509   //! sublabel of theRank1-th sublabel of the Data label of the object.
0510   //! If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
0511   //! A newly created array has 1 and theLength bounds
0512   //! NOTE: new created array is NOT initialized.
0513   //!
0514   //! NOTE: do not create new array and returns NULL handle if no array on label
0515   //!       and theLength less than
0516   //!
0517   //! WARNING: call setArray() after array contents modification
0518   //! in order to assure Undo work
0519   Standard_EXPORT Handle(TColStd_HArray1OfExtendedString) getExtStringArray(
0520     const Standard_Integer theLength,
0521     const Standard_Integer theRank1,
0522     const Standard_Integer theRank2 = 0) const;
0523 
0524   //! Store theArray on theRank2-th sublabel of theRank1-th sublabel
0525   //! of the Data label of the object.
0526   //! If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
0527   //! If theArray is null then array attribute if any is removed.
0528   Standard_EXPORT void setArray(const Handle(TColStd_HArray1OfReal)& theArray,
0529                                 const Standard_Integer               theRank1,
0530                                 const Standard_Integer               theRank2 = 0);
0531 
0532   //! Store theArray on theRank2-th sublabel of theRank1-th sublabel
0533   //! of the Data label of the object.
0534   //! If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
0535   //! If theArray is null then array attribute if any is removed.
0536   Standard_EXPORT void setArray(const Handle(TColStd_HArray1OfInteger)& theArray,
0537                                 const Standard_Integer                  theRank1,
0538                                 const Standard_Integer                  theRank2 = 0);
0539 
0540   //! Store theArray on theRank2-th sublabel of theRank1-th sublabel
0541   //! of the Data label of the object.
0542   //! If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
0543   //! If theArray is null then array attribute if any is removed.
0544   Standard_EXPORT void setArray(const Handle(TColStd_HArray1OfExtendedString)& theArray,
0545                                 const Standard_Integer                         theRank1,
0546                                 const Standard_Integer                         theRank2 = 0);
0547 
0548   //! Sets the string value for theRank2-th sublabel of theRank1-th
0549   //! sublabel of the Data label of the object.
0550   //! If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
0551   Standard_EXPORT void setExtString(const Handle(TCollection_HExtendedString)& theValue,
0552                                     const Standard_Integer                     theRank1,
0553                                     const Standard_Integer                     theRank2 = 0) const;
0554 
0555   //! Returns the string value from theRank2-th sublabel of theRank1-th
0556   //! sublabel of the Data label of the object.
0557   //! If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
0558   Standard_EXPORT Handle(TCollection_HExtendedString) getExtString(
0559     const Standard_Integer theRank1,
0560     const Standard_Integer theRank2 = 0) const;
0561 
0562   //! Sets the ascii string value for theRank2-th sublabel of theRank1-th
0563   //! sublabel of the Data label of the object.
0564   //! If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
0565   Standard_EXPORT void setAsciiString(const Handle(TCollection_HAsciiString)& theValue,
0566                                       const Standard_Integer                  theRank1,
0567                                       const Standard_Integer                  theRank2 = 0) const;
0568 
0569   //! Returns the string value from theRank2-th sublabel of theRank1-th
0570   //! sublabel of the Data label of the object.
0571   //! If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
0572   Standard_EXPORT Handle(TCollection_HAsciiString) getAsciiString(
0573     const Standard_Integer theRank1,
0574     const Standard_Integer theRank2 = 0) const;
0575 
0576   //! Returns the reference attribute from theRank2-th sublabel of theRank1-th
0577   //! sublabel of the References label of the object.
0578   //! If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
0579   Standard_EXPORT Handle(TObj_Object) getReference(const Standard_Integer theRank1,
0580                                                    const Standard_Integer theRank2 = 0) const;
0581 
0582   //! Sets the reference to theObject on theRank2-th sublabel of theRank1-th
0583   //! sublabel of the References label of the object.
0584   //! If theRank2 is 0 (default), label theRank1 is supposed (not its sublabel).
0585   //! Returns True if new value is actually different from previous one
0586   //! If Object is NULL, reference is deleted
0587   Standard_EXPORT Standard_Boolean setReference(const Handle(TObj_Object)& theObject,
0588                                                 const Standard_Integer     theRank1,
0589                                                 const Standard_Integer     theRank2 = 0);
0590 
0591   //! Adds the reference to theObject on next free sublabel of theRank1-th
0592   //! sublabel of the References label of the object and returns the Label.
0593   Standard_EXPORT TDF_Label addReference(const Standard_Integer     theRank1,
0594                                          const Handle(TObj_Object)& theObject);
0595 
0596 private:
0597   /**
0598    * Fields
0599    */
0600   TDF_Label myLabel; //!< Label on which object`s data are stored
0601 
0602   Handle(TObj_HSequenceOfObject) myHSeqBackRef; //!< hsequence of back references.
0603 
0604   friend class TObj_TObject;
0605 
0606 public:
0607   //! CASCADE RTTI
0608   DEFINE_STANDARD_RTTIEXT(TObj_Object, Standard_Transient)
0609 };
0610 
0611 //! Define handle in separate file
0612 
0613 #endif
0614 
0615 #ifdef _MSC_VER
0616 #pragma once
0617 #endif