1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

0027932: Improvement of standard attributes usability.

OCAF attributes TDataStd_AsciiString, TDataStd_Integer, TDataStd_Name, TDataStd_Real are extended by possibility to use custom GUID.

Now multiple attributes of any of these types can be placed at the same label using different user-defined GUIDs.
For this new "Set" methods were added into each attribute, which takes this custom GUID as an argument.
Other aspects of management of attributes on labels remain the same.

Version number of persistent OCAF documents is incremented.
However, the attributes are stored in the same way unless non-standard GUID is used for particular attribute.
Previously saved documents are fully supported, but the new documents with this extension used will be non-readable by the previous version of OCAF libraries.
This commit is contained in:
szy
2016-10-27 17:55:43 +03:00
committed by abv
parent 9c86076b21
commit fa53efefc3
39 changed files with 1274 additions and 600 deletions

View File

@@ -23,8 +23,9 @@
#include <TCollection_ExtendedString.hxx>
#include <TDF_Attribute.hxx>
#include <Standard_OStream.hxx>
#include <Standard_GUID.hxx>
class Standard_DomainError;
class Standard_GUID;
class TDF_Label;
class TCollection_ExtendedString;
class TDF_Attribute;
@@ -69,12 +70,18 @@ public:
//! Name methods
//! ============
Standard_EXPORT static Handle(TDataStd_Name) Set (const TDF_Label& label, const TCollection_ExtendedString& string);
//! Finds, or creates, a Name attribute with explicit user defined <guid> and sets <string>.
//! The Name attribute is returned.
Standard_EXPORT static Handle(TDataStd_Name) Set (const TDF_Label& label, const Standard_GUID& guid,
const TCollection_ExtendedString& string);
Standard_EXPORT TDataStd_Name();
//! Sets <S> as name. Raises if <S> is not a valid name.
Standard_EXPORT void Set (const TCollection_ExtendedString& S);
//! Sets the explicit user defined GUID to the attribute.
Standard_EXPORT void SetID (const Standard_GUID& guid);
//! Returns the name contained in this name attribute.
Standard_EXPORT const TCollection_ExtendedString& Get() const;
@@ -103,7 +110,7 @@ private:
TCollection_ExtendedString myString;
Standard_GUID myID;
};