b311480e |
1 | // Created on: 1999-06-15 |
2 | // Created by: Sergey RUIN |
3 | // Copyright (c) 1999-1999 Matra Datavision |
973c2be1 |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | // |
973c2be1 |
6 | // This file is part of Open CASCADE Technology software library. |
b311480e |
7 | // |
d5f74e42 |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
13 | // |
973c2be1 |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | #include <MDataStd_UAttributeRetrievalDriver.ixx> |
18 | #include <PDataStd_UAttribute.hxx> |
19 | #include <TDataStd_UAttribute.hxx> |
20 | #include <MDataStd.hxx> |
21 | #include <TCollection_ExtendedString.hxx> |
22 | #include <PCollection_HExtendedString.hxx> |
23 | #include <CDM_MessageDriver.hxx> |
24 | |
25 | //======================================================================= |
26 | //function : MDataStd_UAttributeRetrievalDriver |
27 | //purpose : |
28 | //======================================================================= |
29 | |
30 | MDataStd_UAttributeRetrievalDriver::MDataStd_UAttributeRetrievalDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ARDriver(theMsgDriver) |
31 | {} |
32 | |
33 | |
34 | //======================================================================= |
35 | //function : VersionNumber |
36 | //purpose : |
37 | //======================================================================= |
38 | |
39 | Standard_Integer MDataStd_UAttributeRetrievalDriver::VersionNumber() const |
40 | { return 0; } |
41 | |
42 | |
43 | //======================================================================= |
44 | //function : SourceType |
45 | //purpose : |
46 | //======================================================================= |
47 | |
48 | Handle(Standard_Type) MDataStd_UAttributeRetrievalDriver::SourceType() const |
49 | { |
50 | static Handle(Standard_Type) sourceType = STANDARD_TYPE(PDataStd_UAttribute); |
51 | return sourceType; |
52 | } |
53 | |
54 | |
55 | //======================================================================= |
56 | //function : NewEmpty |
57 | //purpose : |
58 | //======================================================================= |
59 | |
60 | Handle(TDF_Attribute) MDataStd_UAttributeRetrievalDriver::NewEmpty () const { |
61 | |
62 | return new TDataStd_UAttribute (); |
63 | } |
64 | |
65 | |
66 | //======================================================================= |
67 | //function : Paste |
68 | //purpose : |
69 | //======================================================================= |
70 | |
71 | void MDataStd_UAttributeRetrievalDriver::Paste(const Handle(PDF_Attribute)& Source, |
72 | const Handle(TDF_Attribute)& Target, |
35e08fe8 |
73 | const Handle(MDF_RRelocationTable)& /*RelocTable*/) const |
7fd59977 |
74 | { |
75 | Handle(PDataStd_UAttribute) S = Handle(PDataStd_UAttribute)::DownCast (Source); |
76 | Handle(TDataStd_UAttribute) T = Handle(TDataStd_UAttribute)::DownCast (Target); |
77 | |
78 | TCollection_ExtendedString extstr = (S->GetID())->Convert(); |
79 | Standard_GUID guid( extstr.ToExtString() ); |
80 | |
81 | T->SetID( guid ); |
82 | } |
83 | |