7fd59977 |
1 | // File: MXCAFDoc_DatumRetrievalDriver.cxx |
2 | // Created: 10.12.08 09:46:46 |
3 | // Author: Pavel TELKOV |
4 | // Copyright: Open CASCADE 2008 |
5 | |
6 | #include <MXCAFDoc_DatumRetrievalDriver.ixx> |
7 | #include <PXCAFDoc_Datum.hxx> |
8 | #include <XCAFDoc_Datum.hxx> |
9 | |
10 | #include <TCollection_HAsciiString.hxx> |
11 | #include <PCollection_HAsciiString.hxx> |
12 | |
13 | |
14 | //======================================================================= |
15 | //function : MCAFDoc_DatumRetrievalDriver |
16 | //purpose : |
17 | //======================================================================= |
18 | |
19 | MXCAFDoc_DatumRetrievalDriver::MXCAFDoc_DatumRetrievalDriver |
20 | (const Handle(CDM_MessageDriver)& theMsgDriver) : MDF_ARDriver (theMsgDriver) |
21 | {} |
22 | |
23 | //======================================================================= |
24 | //function : VersionNumber |
25 | //purpose : |
26 | //======================================================================= |
27 | |
28 | Standard_Integer MXCAFDoc_DatumRetrievalDriver::VersionNumber() const |
29 | { return 0; } |
30 | |
31 | //======================================================================= |
32 | //function : SourceType |
33 | //purpose : |
34 | //======================================================================= |
35 | |
36 | Handle(Standard_Type) MXCAFDoc_DatumRetrievalDriver::SourceType() const |
37 | { |
38 | static Handle(Standard_Type) sourceType = STANDARD_TYPE(PXCAFDoc_Datum); |
39 | return sourceType; |
40 | } |
41 | |
42 | //======================================================================= |
43 | //function : NewEmpty |
44 | //purpose : |
45 | //======================================================================= |
46 | |
47 | Handle(TDF_Attribute) MXCAFDoc_DatumRetrievalDriver::NewEmpty() const |
48 | { |
49 | return new XCAFDoc_Datum(); |
50 | } |
51 | |
52 | //======================================================================= |
53 | //function : Paste |
54 | //purpose : |
55 | //======================================================================= |
56 | |
57 | void MXCAFDoc_DatumRetrievalDriver::Paste(const Handle(PDF_Attribute)& Source, |
58 | const Handle(TDF_Attribute)& Target, |
59 | const Handle(MDF_RRelocationTable)& RelocTable) const |
60 | { |
61 | Handle(PXCAFDoc_Datum) S = Handle(PXCAFDoc_Datum)::DownCast (Source); |
62 | Handle(XCAFDoc_Datum) T = Handle(XCAFDoc_Datum)::DownCast (Target); |
63 | |
7fd59977 |
64 | Handle(TCollection_HAsciiString) aName, aDescr, anId; |
65 | if ( !S->GetName().IsNull() ) |
66 | aName = new TCollection_HAsciiString( (S->GetName())->Convert() ); |
67 | if ( !S->GetDescription().IsNull() ) |
68 | aDescr = new TCollection_HAsciiString( (S->GetDescription())->Convert() ); |
69 | if ( !S->GetIdentification().IsNull() ) |
70 | anId = new TCollection_HAsciiString( (S->GetIdentification())->Convert() ); |
71 | |
72 | T->Set(aName, aDescr, anId); |
73 | } |