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_DataXtd_PatternStd_HeaderFile
16 #define _StdPersistent_DataXtd_PatternStd_HeaderFile
17 
18 #include <StdObjMgt_Attribute.hxx>
19 
20 #include <TDataXtd_PatternStd.hxx>
21 
22 
23 class StdPersistent_DataXtd_PatternStd
24   : public StdObjMgt_Attribute<TDataXtd_PatternStd>
25 {
26 public:
27   //! Read persistent data from a file.
Read(StdObjMgt_ReadData & theReadData)28   inline void Read (StdObjMgt_ReadData& theReadData)
29   {
30     theReadData >> mySignature >> myAxis1Reversed >> myAxis2Reversed >>
31       myAxis1 >> myAxis2 >> myValue1 >> myValue2 >> myNb1 >> myNb2 >> myMirror;
32   }
33   //! Write persistent data to a file.
Write(StdObjMgt_WriteData & theWriteData)34   inline void Write(StdObjMgt_WriteData& theWriteData)
35   {
36     theWriteData << mySignature << myAxis1Reversed << myAxis2Reversed <<
37       myAxis1 << myAxis2 << myValue1 << myValue2 << myNb1 << myNb2 << myMirror;
38   }
39   //! Gets persistent child objects
PChildren(StdObjMgt_Persistent::SequenceOfPersistent & theChildren) const40   inline void PChildren(StdObjMgt_Persistent::SequenceOfPersistent& theChildren) const
41   {
42     theChildren.Append(myAxis1);
43     theChildren.Append(myAxis2);
44     theChildren.Append(myValue1);
45     theChildren.Append(myValue2);
46     theChildren.Append(myNb1);
47     theChildren.Append(myNb2);
48     theChildren.Append(myMirror);
49   }
50   //! Returns persistent type name
PName() const51   inline Standard_CString PName() const { return "PDataXtd_PatternStd"; }
52 
53   //! Import transient attribute from the persistent data.
54   void Import (const Handle(TDataXtd_PatternStd)& theAttribute) const;
55 
56 private:
57   Standard_Integer             mySignature;
58   Standard_Boolean             myAxis1Reversed;
59   Standard_Boolean             myAxis2Reversed;
60   Handle(StdObjMgt_Persistent) myAxis1;
61   Handle(StdObjMgt_Persistent) myAxis2;
62   Handle(StdObjMgt_Persistent) myValue1;
63   Handle(StdObjMgt_Persistent) myValue2;
64   Handle(StdObjMgt_Persistent) myNb1;
65   Handle(StdObjMgt_Persistent) myNb2;
66   Handle(StdObjMgt_Persistent) myMirror;
67 };
68 
69 #endif
70