0024927: Getting rid of "Persistent" functionality -- Code
[occt.git] / src / MXCAFDoc / MXCAFDoc_LocationRetrievalDriver.cxx
1 // Created on: 2000-08-15
2 // Created by: data exchange team
3 // Copyright (c) 2000-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 #include <MDF_RRelocationTable.hxx>
17 #include <MXCAFDoc_LocationRetrievalDriver.ixx>
18 #include <MgtTopLoc.hxx>
19 #include <PTColStd_PersistentTransientMap.hxx>
20 #include <PXCAFDoc_Location.hxx>
21 #include <XCAFDoc_Location.hxx>
22
23
24 //=======================================================================
25 //function : Constructor
26 //purpose  : 
27 //=======================================================================
28
29 MXCAFDoc_LocationRetrievalDriver::MXCAFDoc_LocationRetrievalDriver(const Handle(CDM_MessageDriver)& theMsgDriver) : MDF_ARDriver (theMsgDriver)
30 {
31 }
32
33 //=======================================================================
34 //function : VersionNumber
35 //purpose  : 
36 //=======================================================================
37
38  Standard_Integer MXCAFDoc_LocationRetrievalDriver::VersionNumber() const
39 {
40   return 0;
41 }
42
43 //=======================================================================
44 //function : SourceType
45 //purpose  : 
46 //=======================================================================
47
48  Handle(Standard_Type) MXCAFDoc_LocationRetrievalDriver::SourceType() const
49 {
50   static Handle(Standard_Type) sourceType = STANDARD_TYPE(PXCAFDoc_Location);
51   return sourceType;
52 }
53
54 //=======================================================================
55 //function : NewEmpty
56 //purpose  : 
57 //=======================================================================
58
59  Handle(TDF_Attribute) MXCAFDoc_LocationRetrievalDriver::NewEmpty() const
60 {
61   return new XCAFDoc_Location();
62 }
63
64 //=======================================================================
65 //function : Paste
66 //purpose  : 
67 //=======================================================================
68
69  void MXCAFDoc_LocationRetrievalDriver::Paste(const Handle(PDF_Attribute)& Source,
70                                                     const Handle(TDF_Attribute)& Target,
71                                                     const Handle(MDF_RRelocationTable)& RelocTable) const
72 {
73   Handle(PXCAFDoc_Location) S = Handle(PXCAFDoc_Location)::DownCast (Source);
74   Handle(XCAFDoc_Location) T = Handle(XCAFDoc_Location)::DownCast (Target);
75   
76   PTColStd_PersistentTransientMap& PTMap = RelocTable->OtherTable();
77   T->Set(MgtTopLoc::Translate(S->Get(), PTMap));
78
79 }
80