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