1 // Created on: 2002-10-31
2 // Created by: Michael SAZONOV
3 // Copyright (c) 2002-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
17 #include <BinDrivers.hxx>
18 #include <BinDrivers_DocumentRetrievalDriver.hxx>
19 #include <BinLDrivers_DocumentSection.hxx>
20 #include <BinMDataStd.hxx>
21 #include <BinMDF_ADriverTable.hxx>
22 #include <BinMNaming.hxx>
23 #include <BinMNaming_NamedShapeDriver.hxx>
24 #include <CDM_MessageDriver.hxx>
25 #include <Standard_ErrorHandler.hxx>
26 #include <Standard_Failure.hxx>
27 #include <Standard_IStream.hxx>
28 #include <Standard_Type.hxx>
29 #include <TCollection_ExtendedString.hxx>
30 #include <TNaming_NamedShape.hxx>
32 IMPLEMENT_STANDARD_RTTIEXT(BinDrivers_DocumentRetrievalDriver,BinLDrivers_DocumentRetrievalDriver)
34 //=======================================================================
35 //function : BinDrivers_DocumentRetrievalDriver
36 //purpose : Constructor
37 //=======================================================================
38 BinDrivers_DocumentRetrievalDriver::BinDrivers_DocumentRetrievalDriver ()
42 //=======================================================================
43 //function : AttributeDrivers
45 //=======================================================================
47 Handle(BinMDF_ADriverTable) BinDrivers_DocumentRetrievalDriver::AttributeDrivers
48 (const Handle(CDM_MessageDriver)& theMessageDriver)
50 return BinDrivers::AttributeDrivers (theMessageDriver);
53 //=======================================================================
54 //function : ReadShapeSection
56 //=======================================================================
58 void BinDrivers_DocumentRetrievalDriver::ReadShapeSection
59 (BinLDrivers_DocumentSection& /*theSection*/,
60 Standard_IStream& theIS,
61 const Standard_Boolean /*isMess*/)
65 Handle(BinMDF_ADriver) aDriver;
66 if (myDrivers->GetDriver(STANDARD_TYPE(TNaming_NamedShape),aDriver))
70 Handle(BinMNaming_NamedShapeDriver) aNamedShapeDriver =
71 Handle(BinMNaming_NamedShapeDriver)::DownCast (aDriver);
72 aNamedShapeDriver->ReadShapeSection (theIS);
74 catch(Standard_Failure) {
75 Handle(Standard_Failure) aFailure = Standard_Failure::Caught();
76 const TCollection_ExtendedString aMethStr
77 ("BinDrivers_DocumentRetrievalDriver: ");
78 WriteMessage (aMethStr + "error of Shape Section " +
79 aFailure->GetMessageString());
84 //=======================================================================
85 //function : CheckShapeSection
87 //=======================================================================
88 void BinDrivers_DocumentRetrievalDriver::CheckShapeSection(
89 const Storage_Position& /*ShapeSectionPos*/,
90 Standard_IStream& /*IS*/)
93 //=======================================================================
96 //=======================================================================
97 void BinDrivers_DocumentRetrievalDriver::Clear()
99 // Clear NamedShape driver
100 Handle(BinMDF_ADriver) aDriver;
101 if (myDrivers->GetDriver(STANDARD_TYPE(TNaming_NamedShape), aDriver))
103 Handle(BinMNaming_NamedShapeDriver) aNamedShapeDriver =
104 Handle(BinMNaming_NamedShapeDriver)::DownCast(aDriver);
105 aNamedShapeDriver->Clear();
107 BinLDrivers_DocumentRetrievalDriver::Clear();
110 //=======================================================================
111 //function : PropagateDocumentVersion
113 //=======================================================================
114 void BinDrivers_DocumentRetrievalDriver::PropagateDocumentVersion(
115 const Standard_Integer theDocVersion )
117 BinMDataStd::SetDocumentVersion(theDocVersion);
118 BinMNaming::SetDocumentVersion(theDocVersion);