0026936: Drawbacks of inlining in new type system in OCCT 7.0 -- automatic
[occt.git] / src / XmlDrivers / XmlDrivers_DocumentRetrievalDriver.cxx
1 // Created on: 2001-07-09
2 // Created by: Julia DOROVSKIKH
3 // Copyright (c) 2001-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 #include <CDM_MessageDriver.hxx>
18 #include <Standard_Type.hxx>
19 #include <TNaming_NamedShape.hxx>
20 #include <XmlDrivers.hxx>
21 #include <XmlDrivers_DocumentRetrievalDriver.hxx>
22 #include <XmlMDataStd.hxx>
23 #include <XmlMDF_ADriver.hxx>
24 #include <XmlMDF_ADriverTable.hxx>
25 #include <XmlMNaming.hxx>
26 #include <XmlMNaming_NamedShapeDriver.hxx>
27 #include <XmlObjMgt_Element.hxx>
28
29 IMPLEMENT_STANDARD_RTTIEXT(XmlDrivers_DocumentRetrievalDriver,XmlLDrivers_DocumentRetrievalDriver)
30
31 //=======================================================================
32 //function : XmlDrivers_DocumentRetrievalDriver
33 //purpose  : Constructor
34 //=======================================================================
35 XmlDrivers_DocumentRetrievalDriver::XmlDrivers_DocumentRetrievalDriver()
36 {
37 }
38
39 //=======================================================================
40 //function : AttributeDrivers
41 //purpose  : 
42 //=======================================================================
43 Handle(XmlMDF_ADriverTable) XmlDrivers_DocumentRetrievalDriver::AttributeDrivers
44        (const Handle(CDM_MessageDriver)& theMessageDriver) 
45 {
46   return XmlDrivers::AttributeDrivers (theMessageDriver);
47 }
48
49 //=======================================================================
50 //function : PropagateDocumentVersion
51 //purpose  : 
52 //=======================================================================
53 void XmlDrivers_DocumentRetrievalDriver::PropagateDocumentVersion(
54                                    const Standard_Integer theDocVersion )
55 {
56   XmlMDataStd::SetDocumentVersion(theDocVersion);
57   XmlMNaming::SetDocumentVersion(theDocVersion);
58 }
59
60 //=======================================================================
61 //function : ReadShapeSection
62 //purpose  : Implementation of ReadShapeSection
63 //=======================================================================
64 Handle(XmlMDF_ADriver) XmlDrivers_DocumentRetrievalDriver::ReadShapeSection(
65                                const XmlObjMgt_Element&       theElement,
66                                const Handle(CDM_MessageDriver)& theMsgDriver)
67 {
68   if (myDrivers.IsNull()) myDrivers = AttributeDrivers (theMsgDriver);
69   Handle(XmlMNaming_NamedShapeDriver) aNamedShapeDriver;
70   if (myDrivers -> GetDriver (STANDARD_TYPE(TNaming_NamedShape),
71                               aNamedShapeDriver))
72     aNamedShapeDriver -> ReadShapeSection (theElement);
73   return aNamedShapeDriver;
74 }
75
76 //=======================================================================
77 //function : ShapeSetCleaning
78 //purpose  : definition of ShapeSetCleaning
79 //=======================================================================
80 void XmlDrivers_DocumentRetrievalDriver::ShapeSetCleaning(
81                               const Handle(XmlMDF_ADriver)& theDriver) 
82 {
83   Handle(XmlMNaming_NamedShapeDriver) aNamedShapeDriver = 
84     Handle(XmlMNaming_NamedShapeDriver)::DownCast(theDriver);
85   if (aNamedShapeDriver.IsNull() == Standard_False)
86     aNamedShapeDriver -> Clear();
87 }
88
89