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 | |
83ae3591 |
17 | #include <Message_Messenger.hxx> |
42cf5bc1 |
18 | #include <Standard_Type.hxx> |
19 | #include <TNaming_NamedShape.hxx> |
7fd59977 |
20 | #include <XmlDrivers.hxx> |
42cf5bc1 |
21 | #include <XmlDrivers_DocumentRetrievalDriver.hxx> |
42cf5bc1 |
22 | #include <XmlMDF_ADriver.hxx> |
23 | #include <XmlMDF_ADriverTable.hxx> |
7fd59977 |
24 | #include <XmlMNaming_NamedShapeDriver.hxx> |
42cf5bc1 |
25 | #include <XmlObjMgt_Element.hxx> |
26 | |
92efcf78 |
27 | IMPLEMENT_STANDARD_RTTIEXT(XmlDrivers_DocumentRetrievalDriver,XmlLDrivers_DocumentRetrievalDriver) |
28 | |
7fd59977 |
29 | //======================================================================= |
30 | //function : XmlDrivers_DocumentRetrievalDriver |
31 | //purpose : Constructor |
32 | //======================================================================= |
33 | XmlDrivers_DocumentRetrievalDriver::XmlDrivers_DocumentRetrievalDriver() |
34 | { |
35 | } |
36 | |
37 | //======================================================================= |
38 | //function : AttributeDrivers |
39 | //purpose : |
40 | //======================================================================= |
41 | Handle(XmlMDF_ADriverTable) XmlDrivers_DocumentRetrievalDriver::AttributeDrivers |
83ae3591 |
42 | (const Handle(Message_Messenger)& theMessageDriver) |
7fd59977 |
43 | { |
44 | return XmlDrivers::AttributeDrivers (theMessageDriver); |
45 | } |
46 | |
7fd59977 |
47 | //======================================================================= |
48 | //function : ReadShapeSection |
49 | //purpose : Implementation of ReadShapeSection |
50 | //======================================================================= |
51 | Handle(XmlMDF_ADriver) XmlDrivers_DocumentRetrievalDriver::ReadShapeSection( |
52 | const XmlObjMgt_Element& theElement, |
83ae3591 |
53 | const Handle(Message_Messenger)& theMsgDriver) |
7fd59977 |
54 | { |
55 | if (myDrivers.IsNull()) myDrivers = AttributeDrivers (theMsgDriver); |
aa00364d |
56 | Handle(XmlMDF_ADriver) aDriver; |
57 | if (myDrivers->GetDriver (STANDARD_TYPE(TNaming_NamedShape), aDriver)) |
58 | { |
59 | Handle(XmlMNaming_NamedShapeDriver) aNamedShapeDriver = |
60 | Handle(XmlMNaming_NamedShapeDriver)::DownCast (aDriver); |
7fd59977 |
61 | aNamedShapeDriver -> ReadShapeSection (theElement); |
aa00364d |
62 | } |
63 | return aDriver; |
7fd59977 |
64 | } |
65 | |
66 | //======================================================================= |
67 | //function : ShapeSetCleaning |
68 | //purpose : definition of ShapeSetCleaning |
69 | //======================================================================= |
70 | void XmlDrivers_DocumentRetrievalDriver::ShapeSetCleaning( |
71 | const Handle(XmlMDF_ADriver)& theDriver) |
72 | { |
73 | Handle(XmlMNaming_NamedShapeDriver) aNamedShapeDriver = |
74 | Handle(XmlMNaming_NamedShapeDriver)::DownCast(theDriver); |
75 | if (aNamedShapeDriver.IsNull() == Standard_False) |
76 | aNamedShapeDriver -> Clear(); |
77 | } |
78 | |
79 | |