ff205346 |
1 | // Copyright (c) 2015 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 | |
15 | #ifndef _StdPersistent_Naming_HeaderFile |
16 | #define _StdPersistent_Naming_HeaderFile |
17 | |
18 | #include <StdObjMgt_Attribute.hxx> |
19 | #include <StdObjMgt_Persistent.hxx> |
20 | #include <StdPersistent_HArray1.hxx> |
21 | #include <StdLPersistent_HArray1.hxx> |
22 | #include <StdLPersistent_HString.hxx> |
23 | |
ff205346 |
24 | #include <TNaming_NamedShape.hxx> |
25 | #include <TNaming_Naming.hxx> |
26 | |
27 | class TNaming_Name; |
28 | |
29 | |
30 | class StdPersistent_Naming |
31 | { |
32 | public: |
33 | class NamedShape : public StdObjMgt_Attribute<TNaming_NamedShape> |
34 | { |
35 | public: |
36 | //! Read persistent data from a file. |
37 | inline void Read (StdObjMgt_ReadData& theReadData) |
38 | { theReadData >> myOldShapes >> myNewShapes >> myShapeStatus >> myVersion; } |
39 | |
40 | //! Import transient attribuite from the persistent data. |
41 | void Import (const Handle(TNaming_NamedShape)& theAttribute) const; |
42 | |
43 | private: |
45d8465e |
44 | Handle(StdPersistent_HArray1::Shape1) myOldShapes; |
45 | Handle(StdPersistent_HArray1::Shape1) myNewShapes; |
46 | Standard_Integer myShapeStatus; |
47 | Standard_Integer myVersion; |
ff205346 |
48 | }; |
49 | |
50 | class Name : public StdObjMgt_Persistent |
51 | { |
52 | public: |
53 | //! Read persistent data from a file. |
54 | Standard_EXPORT virtual void Read (StdObjMgt_ReadData& theReadData); |
55 | |
56 | //! Import transient object from the persistent data. |
57 | Standard_EXPORT virtual void Import |
58 | (TNaming_Name& theName, const Handle(TDF_Data)& theDF) const; |
59 | |
60 | private: |
45d8465e |
61 | Standard_Integer myType; |
62 | Standard_Integer myShapeType; |
63 | Handle(StdLPersistent_HArray1::Persistent) myArgs; |
64 | Handle(StdObjMgt_Persistent) myStop; |
65 | Standard_Integer myIndex; |
ff205346 |
66 | }; |
67 | |
68 | class Name_1 : public Name |
69 | { |
70 | public: |
71 | //! Read persistent data from a file. |
72 | Standard_EXPORT virtual void Read (StdObjMgt_ReadData& theReadData); |
73 | |
74 | //! Import transient object from the persistent data. |
75 | Standard_EXPORT virtual void Import |
76 | (TNaming_Name& theName, const Handle(TDF_Data)& theDF) const; |
77 | |
78 | private: |
45d8465e |
79 | Handle(StdLPersistent_HString::Ascii) myContextLabel; |
ff205346 |
80 | }; |
81 | |
82 | class Name_2 : public Name_1 |
83 | { |
84 | public: |
85 | //! Read persistent data from a file. |
86 | Standard_EXPORT virtual void Read (StdObjMgt_ReadData& theReadData); |
87 | |
88 | //! Import transient object from the persistent data. |
89 | Standard_EXPORT virtual void Import |
90 | (TNaming_Name& theName, const Handle(TDF_Data)& theDF) const; |
91 | |
92 | private: |
45d8465e |
93 | Standard_Integer myOrientation; |
ff205346 |
94 | }; |
95 | |
96 | class Naming : public StdObjMgt_Attribute<TNaming_Naming>::SingleRef |
97 | { |
98 | public: |
99 | //! Import transient attribuite from the persistent data. |
100 | Standard_EXPORT virtual void ImportAttribute(); |
101 | }; |
102 | |
103 | class Naming_1 : public Naming |
104 | { |
105 | public: |
106 | //! Import transient attribuite from the persistent data. |
107 | Standard_EXPORT virtual void ImportAttribute(); |
108 | }; |
109 | |
110 | typedef Naming Naming_2; |
111 | }; |
112 | |
113 | #endif |