File indexing completed on 2026-10-01 08:59:54
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 <Standard_Transient.hxx>
0023 #include <NCollection_IndexedMap.hxx>
0024 #include <TDF_Label.hxx>
0025 #include <NCollection_List.hxx>
0026 #include <NCollection_Map.hxx>
0027 #include <NCollection_DynamicArray.hxx>
0028 #include <BinLDrivers_DocumentSection.hxx>
0029 #include <PCDM_StorageDriver.hxx>
0030 #include <Standard_OStream.hxx>
0031 #include <Standard_Type.hxx>
0032 #include <TDocStd_FormatVersion.hxx>
0033 class BinMDF_ADriverTable;
0034 class Message_Messenger;
0035 class CDM_Document;
0036 class TDF_Label;
0037 class TCollection_AsciiString;
0038 class BinLDrivers_DocumentSection;
0039 class BinObjMgt_Position;
0040
0041
0042 class BinLDrivers_DocumentStorageDriver : public PCDM_StorageDriver
0043 {
0044
0045 public:
0046
0047 Standard_EXPORT BinLDrivers_DocumentStorageDriver();
0048
0049
0050 Standard_EXPORT void Write(
0051 const occ::handle<CDM_Document>& theDocument,
0052 const TCollection_ExtendedString& theFileName,
0053 const Message_ProgressRange& theRange = Message_ProgressRange()) override;
0054
0055
0056 Standard_EXPORT void Write(
0057 const occ::handle<CDM_Document>& theDocument,
0058 Standard_OStream& theOStream,
0059 const Message_ProgressRange& theRange = Message_ProgressRange()) override;
0060
0061 Standard_EXPORT virtual occ::handle<BinMDF_ADriverTable> AttributeDrivers(
0062 const occ::handle<Message_Messenger>& theMsgDriver);
0063
0064
0065 Standard_EXPORT void AddSection(const TCollection_AsciiString& theName,
0066 const bool isPostRead = true);
0067
0068
0069 Standard_EXPORT bool IsQuickPart(const int theVersion) const;
0070
0071 DEFINE_STANDARD_RTTIEXT(BinLDrivers_DocumentStorageDriver, PCDM_StorageDriver)
0072
0073 protected:
0074
0075 Standard_EXPORT void WriteSubTree(
0076 const TDF_Label& theData,
0077 Standard_OStream& theOS,
0078 const bool& theQuickPart,
0079 const Message_ProgressRange& theRange = Message_ProgressRange());
0080
0081
0082 Standard_EXPORT virtual void WriteSection(const TCollection_AsciiString& ,
0083 const occ::handle<CDM_Document>& ,
0084 Standard_OStream& );
0085
0086
0087 Standard_EXPORT virtual void WriteShapeSection(
0088 BinLDrivers_DocumentSection& theDocSection,
0089 Standard_OStream& theOS,
0090 const TDocStd_FormatVersion theDocVer,
0091 const Message_ProgressRange& theRange = Message_ProgressRange());
0092
0093
0094 Standard_EXPORT virtual void EnableQuickPartWriting(
0095 const occ::handle<Message_Messenger>& ,
0096 const bool )
0097 {
0098 }
0099
0100
0101 Standard_EXPORT virtual void Clear();
0102
0103 occ::handle<BinMDF_ADriverTable> myDrivers;
0104 NCollection_IndexedMap<occ::handle<Standard_Transient>> myRelocTable;
0105 occ::handle<Message_Messenger> myMsgDriver;
0106
0107 private:
0108 Standard_EXPORT void FirstPass(const TDF_Label& theRoot);
0109
0110
0111
0112 Standard_EXPORT bool FirstPassSubTree(const TDF_Label& L,
0113 NCollection_List<TDF_Label>& ListOfEmptyL);
0114
0115
0116 Standard_EXPORT void WriteInfoSection(const occ::handle<CDM_Document>& theDocument,
0117 Standard_OStream& theOStream);
0118
0119 Standard_EXPORT void UnsupportedAttrMsg(const occ::handle<Standard_Type>& theType);
0120
0121
0122 Standard_EXPORT void WriteSizes(Standard_OStream& theOS);
0123
0124 BinObjMgt_Persistent myPAtt;
0125 NCollection_List<TDF_Label> myEmptyLabels;
0126 NCollection_Map<occ::handle<Standard_Transient>> myMapUnsupported;
0127 NCollection_IndexedMap<occ::handle<Standard_Transient>> myTypesMap;
0128 NCollection_DynamicArray<BinLDrivers_DocumentSection> mySections;
0129 TCollection_ExtendedString myFileName;
0130
0131 NCollection_List<occ::handle<BinObjMgt_Position>> mySizesToWrite;
0132 };
0133
0134 #endif