0025923: Remove small wires on face read from STEP
[occt.git] / src / MDocStd / MDocStd_XLinkRetrievalDriver.cxx
1 // Created by: DAUTRY Philippe
2 // Copyright (c) 1997-1999 Matra Datavision
3 // Copyright (c) 1999-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 //              -----------------------------
17
18 // Version:     0.0
19 //Version       Date            Purpose
20 //              0.0     Sep 17 1997     Creation
21
22
23
24 #include <MDocStd_XLinkRetrievalDriver.ixx>
25 #include <TDocStd_XLink.hxx>
26 #include <PDocStd_XLink.hxx>
27 #include <TCollection_AsciiString.hxx>
28 #include <PCollection_HAsciiString.hxx>
29 #include <CDM_MessageDriver.hxx>
30
31 #define DeclareAndSpeedCast(V,T,Vdown) Handle(T) Vdown = *((Handle(T)*)& V)
32 #define DeclareConstAndSpeedCast(V,T,Vdown) const Handle(T)& Vdown = (Handle(T)&) V
33 #define SpeedCast(V,T,Vdown) Vdown = *((Handle(T)*)& V)
34
35 //=======================================================================
36 //function : MDocStd_XLinkRetrievalDriver
37 //purpose  : 
38 //=======================================================================
39
40 MDocStd_XLinkRetrievalDriver::MDocStd_XLinkRetrievalDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ARDriver(theMsgDriver)
41 {}
42
43
44 //=======================================================================
45 //function : VersionNumber
46 //purpose  : 
47 //=======================================================================
48
49 Standard_Integer MDocStd_XLinkRetrievalDriver::VersionNumber() const
50 { return 0; }
51
52
53 //=======================================================================
54 //function : SourceType
55 //purpose  : 
56 //=======================================================================
57
58 Handle(Standard_Type) MDocStd_XLinkRetrievalDriver::SourceType() const
59 { return STANDARD_TYPE(PDocStd_XLink); }
60
61
62 //=======================================================================
63 //function : NewEmpty
64 //purpose  : 
65 //=======================================================================
66
67 Handle(TDF_Attribute) MDocStd_XLinkRetrievalDriver::NewEmpty() const
68 { return new TDocStd_XLink(); }
69
70
71 //=======================================================================
72 //function : Paste
73 //purpose  : 
74 //=======================================================================
75
76 void MDocStd_XLinkRetrievalDriver::Paste
77 (const Handle(PDF_Attribute)& aSource,
78  const Handle(TDF_Attribute)& aTarget,
79 // const Handle(MDF_RRelocationTable)& aRelocTable) const
80  const Handle(MDF_RRelocationTable)& ) const
81 {
82   DeclareConstAndSpeedCast(aSource,PDocStd_XLink,pxref);
83   DeclareConstAndSpeedCast(aTarget,TDocStd_XLink,txref);
84   txref->DocumentEntry(pxref->DocumentEntry()->Convert());
85   txref->LabelEntry(pxref->LabelEntry()->Convert());
86 }
87