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( |
7e785937 |
52 | const XmlObjMgt_Element& theElement, |
6d8f9f4a |
53 | const Handle(Message_Messenger)& theMsgDriver, |
7e785937 |
54 | const Message_ProgressRange& theRange) |
7fd59977 |
55 | { |
56 | if (myDrivers.IsNull()) myDrivers = AttributeDrivers (theMsgDriver); |
aa00364d |
57 | Handle(XmlMDF_ADriver) aDriver; |
58 | if (myDrivers->GetDriver (STANDARD_TYPE(TNaming_NamedShape), aDriver)) |
59 | { |
60 | Handle(XmlMNaming_NamedShapeDriver) aNamedShapeDriver = |
61 | Handle(XmlMNaming_NamedShapeDriver)::DownCast (aDriver); |
7e785937 |
62 | aNamedShapeDriver->ReadShapeSection (theElement, theRange); |
aa00364d |
63 | } |
64 | return aDriver; |
7fd59977 |
65 | } |
66 | |
67 | //======================================================================= |
68 | //function : ShapeSetCleaning |
69 | //purpose : definition of ShapeSetCleaning |
70 | //======================================================================= |
71 | void XmlDrivers_DocumentRetrievalDriver::ShapeSetCleaning( |
72 | const Handle(XmlMDF_ADriver)& theDriver) |
73 | { |
74 | Handle(XmlMNaming_NamedShapeDriver) aNamedShapeDriver = |
75 | Handle(XmlMNaming_NamedShapeDriver)::DownCast(theDriver); |
76 | if (aNamedShapeDriver.IsNull() == Standard_False) |
77 | aNamedShapeDriver -> Clear(); |
78 | } |
79 | |
80 | |