File indexing completed on 2025-01-18 10:02:59
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _BinLDrivers_DocumentStorageDriver_HeaderFile
0017 #define _BinLDrivers_DocumentStorageDriver_HeaderFile
0018
0019 #include <Standard.hxx>
0020
0021 #include <BinObjMgt_Persistent.hxx>
0022 #include <BinObjMgt_SRelocationTable.hxx>
0023 #include <TDF_LabelList.hxx>
0024 #include <TColStd_MapOfTransient.hxx>
0025 #include <TColStd_IndexedMapOfTransient.hxx>
0026 #include <BinLDrivers_VectorOfDocumentSection.hxx>
0027 #include <PCDM_StorageDriver.hxx>
0028 #include <Standard_OStream.hxx>
0029 #include <Standard_Type.hxx>
0030 #include <TDocStd_FormatVersion.hxx>
0031 class BinMDF_ADriverTable;
0032 class Message_Messenger;
0033 class CDM_Document;
0034 class TDF_Label;
0035 class TCollection_AsciiString;
0036 class BinLDrivers_DocumentSection;
0037 class BinObjMgt_Position;
0038
0039
0040 class BinLDrivers_DocumentStorageDriver;
0041 DEFINE_STANDARD_HANDLE(BinLDrivers_DocumentStorageDriver, PCDM_StorageDriver)
0042
0043
0044 class BinLDrivers_DocumentStorageDriver : public PCDM_StorageDriver
0045 {
0046
0047 public:
0048
0049
0050
0051 Standard_EXPORT BinLDrivers_DocumentStorageDriver();
0052
0053
0054 Standard_EXPORT virtual void Write (const Handle(CDM_Document)& theDocument,
0055 const TCollection_ExtendedString& theFileName,
0056 const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
0057
0058
0059 Standard_EXPORT virtual void Write (const Handle(CDM_Document)& theDocument,
0060 Standard_OStream& theOStream,
0061 const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
0062
0063 Standard_EXPORT virtual Handle(BinMDF_ADriverTable) AttributeDrivers (const Handle(Message_Messenger)& theMsgDriver);
0064
0065
0066 Standard_EXPORT void AddSection (const TCollection_AsciiString& theName, const Standard_Boolean isPostRead = Standard_True);
0067
0068
0069 Standard_EXPORT Standard_Boolean IsQuickPart (const Standard_Integer theVersion) const;
0070
0071
0072 DEFINE_STANDARD_RTTIEXT(BinLDrivers_DocumentStorageDriver,PCDM_StorageDriver)
0073
0074 protected:
0075
0076
0077
0078 Standard_EXPORT void WriteSubTree (const TDF_Label& theData,
0079 Standard_OStream& theOS,
0080 const Standard_Boolean& theQuickPart,
0081 const Message_ProgressRange& theRange = Message_ProgressRange());
0082
0083
0084 Standard_EXPORT virtual void WriteSection (const TCollection_AsciiString& ,
0085 const Handle(CDM_Document)& ,
0086 Standard_OStream& );
0087
0088
0089 Standard_EXPORT virtual void WriteShapeSection (BinLDrivers_DocumentSection& theDocSection,
0090 Standard_OStream& theOS,
0091 const TDocStd_FormatVersion theDocVer,
0092 const Message_ProgressRange& theRange = Message_ProgressRange());
0093
0094
0095 Standard_EXPORT virtual void EnableQuickPartWriting (
0096 const Handle(Message_Messenger)& , const Standard_Boolean ) {}
0097
0098
0099 Standard_EXPORT virtual void Clear();
0100
0101 Handle(BinMDF_ADriverTable) myDrivers;
0102 BinObjMgt_SRelocationTable myRelocTable;
0103 Handle(Message_Messenger) myMsgDriver;
0104
0105 private:
0106
0107 Standard_EXPORT void FirstPass (const TDF_Label& theRoot);
0108
0109
0110
0111 Standard_EXPORT Standard_Boolean FirstPassSubTree (const TDF_Label& L, TDF_LabelList& ListOfEmptyL);
0112
0113
0114 Standard_EXPORT void WriteInfoSection (const Handle(CDM_Document)& theDocument, Standard_OStream& theOStream);
0115
0116 Standard_EXPORT void UnsupportedAttrMsg (const Handle(Standard_Type)& theType);
0117
0118
0119 Standard_EXPORT void WriteSizes (Standard_OStream& theOS);
0120
0121 BinObjMgt_Persistent myPAtt;
0122 TDF_LabelList myEmptyLabels;
0123 TColStd_MapOfTransient myMapUnsupported;
0124 TColStd_IndexedMapOfTransient myTypesMap;
0125 BinLDrivers_VectorOfDocumentSection mySections;
0126 TCollection_ExtendedString myFileName;
0127
0128 NCollection_List<Handle(BinObjMgt_Position)> mySizesToWrite;
0129 };
0130
0131 #endif