0028417: Using PRECOMPILED HEADER to speed up compilation time
[occt.git] / src / XmlDrivers / XmlDrivers_DocumentRetrievalDriver.cxx
CommitLineData
b311480e 1// Created on: 2001-07-09
2// Created by: Julia DOROVSKIKH
973c2be1 3// Copyright (c) 2001-2014 OPEN CASCADE SAS
b311480e 4//
973c2be1 5// This file is part of Open CASCADE Technology software library.
b311480e 6//
d5f74e42 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
973c2be1 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.
b311480e 12//
973c2be1 13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
7fd59977 15
7fd59977 16
42cf5bc1 17#include <CDM_MessageDriver.hxx>
18#include <Standard_Type.hxx>
19#include <TNaming_NamedShape.hxx>
7fd59977 20#include <XmlDrivers.hxx>
42cf5bc1 21#include <XmlDrivers_DocumentRetrievalDriver.hxx>
7fd59977 22#include <XmlMDataStd.hxx>
42cf5bc1 23#include <XmlMDF_ADriver.hxx>
24#include <XmlMDF_ADriverTable.hxx>
7fd59977 25#include <XmlMNaming.hxx>
7fd59977 26#include <XmlMNaming_NamedShapeDriver.hxx>
42cf5bc1 27#include <XmlObjMgt_Element.hxx>
28
92efcf78 29IMPLEMENT_STANDARD_RTTIEXT(XmlDrivers_DocumentRetrievalDriver,XmlLDrivers_DocumentRetrievalDriver)
30
7fd59977 31//=======================================================================
32//function : XmlDrivers_DocumentRetrievalDriver
33//purpose : Constructor
34//=======================================================================
35XmlDrivers_DocumentRetrievalDriver::XmlDrivers_DocumentRetrievalDriver()
36{
37}
38
39//=======================================================================
40//function : AttributeDrivers
41//purpose :
42//=======================================================================
43Handle(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//=======================================================================
53void XmlDrivers_DocumentRetrievalDriver::PropagateDocumentVersion(
54 const Standard_Integer theDocVersion )
55{
7fd59977 56 XmlMDataStd::SetDocumentVersion(theDocVersion);
57 XmlMNaming::SetDocumentVersion(theDocVersion);
58}
59
60//=======================================================================
61//function : ReadShapeSection
62//purpose : Implementation of ReadShapeSection
63//=======================================================================
64Handle(XmlMDF_ADriver) XmlDrivers_DocumentRetrievalDriver::ReadShapeSection(
65 const XmlObjMgt_Element& theElement,
66 const Handle(CDM_MessageDriver)& theMsgDriver)
67{
68 if (myDrivers.IsNull()) myDrivers = AttributeDrivers (theMsgDriver);
aa00364d 69 Handle(XmlMDF_ADriver) aDriver;
70 if (myDrivers->GetDriver (STANDARD_TYPE(TNaming_NamedShape), aDriver))
71 {
72 Handle(XmlMNaming_NamedShapeDriver) aNamedShapeDriver =
73 Handle(XmlMNaming_NamedShapeDriver)::DownCast (aDriver);
7fd59977 74 aNamedShapeDriver -> ReadShapeSection (theElement);
aa00364d 75 }
76 return aDriver;
7fd59977 77}
78
79//=======================================================================
80//function : ShapeSetCleaning
81//purpose : definition of ShapeSetCleaning
82//=======================================================================
83void XmlDrivers_DocumentRetrievalDriver::ShapeSetCleaning(
84 const Handle(XmlMDF_ADriver)& theDriver)
85{
86 Handle(XmlMNaming_NamedShapeDriver) aNamedShapeDriver =
87 Handle(XmlMNaming_NamedShapeDriver)::DownCast(theDriver);
88 if (aNamedShapeDriver.IsNull() == Standard_False)
89 aNamedShapeDriver -> Clear();
90}
91
92