0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / TDataStd / TDataStd_GenericExtString.hxx
1 // Copyright (c) 2020 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
14 #ifndef _TDataStd_GenericExtString_HeaderFile
15 #define _TDataStd_GenericExtString_HeaderFile
16
17 #include <TDF_DerivedAttribute.hxx>
18 #include <TCollection_ExtendedString.hxx>
19 #include <Standard_GUID.hxx>
20
21 class TDF_RelocationTable;
22
23 class TDataStd_GenericExtString;
24 DEFINE_STANDARD_HANDLE(TDataStd_GenericExtString, TDF_Attribute)
25
26 //! An ancestor attribute for all attributes which have TCollection_ExtendedString field.
27 //! If an attribute inherits this one it should not have drivers for persistence.
28 //! Also this attribute provides functionality to have on the same label same attributes with different IDs.
29 class TDataStd_GenericExtString : public TDF_Attribute
30 {
31
32 public:
33
34   //! Sets <S> as name. Raises if <S> is not a valid name.
35   Standard_EXPORT virtual void Set (const TCollection_ExtendedString& S);
36   
37   //! Sets the explicit user defined GUID  to the attribute.
38   Standard_EXPORT void SetID (const Standard_GUID& guid) Standard_OVERRIDE;
39
40   //! Returns the name contained in this name attribute.
41   Standard_EXPORT virtual const TCollection_ExtendedString& Get() const;
42   
43   //! Returns the ID of the attribute.
44   Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;
45
46   Standard_EXPORT void Restore (const Handle(TDF_Attribute)& with) Standard_OVERRIDE;
47
48   Standard_EXPORT void Paste (const Handle(TDF_Attribute)& into, const Handle(TDF_RelocationTable)& RT) const Standard_OVERRIDE;
49
50   //! Dumps the content of me into the stream
51   Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
52
53   DEFINE_STANDARD_RTTIEXT(TDataStd_GenericExtString,TDF_Attribute)
54
55 protected:
56   //! A string field of the attribute, participated in persistence.
57   TCollection_ExtendedString myString;
58   //! A private GUID of the attribute.
59   Standard_GUID myID;
60
61 };
62
63 #endif // _TDataStd_GenericExtString_HeaderFile