0031918: Application Framework - New binary format for fast reading part of OCAF...
authormpv <mpv@opencascade.com>
Thu, 24 Jun 2021 14:26:52 +0000 (17:26 +0300)
committerbugmaster <bugmaster@opencascade.com>
Fri, 9 Jul 2021 16:13:59 +0000 (19:13 +0300)
commitd5c71e2057bfe1cbcadd6564f207841eb9e26355
tree942b90d05a2f3330c3ba4743e00e0ebd5d95310a
parent9e5e4c0c849d2549afb3ef2b764496562545cb01
0031918: Application Framework - New binary format for fast reading part of OCAF document

Implementation of new format for quick reading and writing parts of the documents (sub-set of labels and sub-set of attributes). It consists in writing shapes and all their contents right in the TNaming_NamedShape attribute placement and skipping the shape section. New format 12 for Binary file types is assigned to this version.

Added PCDM_ReaderFilter class that could be used in Open methods of TDocStd_Application. If it is defined, it allows to read:
- into already opened document in append mode AppendMode_Protect (do not overwrite existing attributes) or AppendMode_Overwrite
- only specified sub-trees of the document using AddPath (const TCollection_AsciiString& theEntryToRead)
- only specified attributes using AddRead (const TCollection_AsciiString& theRead) where theRead could be "TDataStd_Name", for example
- to skip specified attributes read using AddSkipped (const TCollection_AsciiString& theSkipped) where theSkipped could be "TDF_Reference", for example

The current limitations:
- only in Bin format
- if shapes have in the document shared topology, loaded in "append" mode in different "load" operations, they will have no shared topology anymore

Modifications:
BinLDrivers and BinDrivers packages - modifications related to the quick part tree format flag usage, skipping shape section writing and adding labels sizes into the document to be able to pass labels during the reading quickly.
BinObjMgt_Persistent and BinObjMgt_Position - to add possibility to write directly into the stream some data just after the attribute. Before this record a data-size is recorded.
BinMXCAFDoc package modifications to write BinMXCAFDoc_LocationDriver location in the same way as shapes write location data right after the attribute (empty) data in this new format.
BinTools package: creation of ShapeReader and ShapeWriter classes with same root class ShapeSetBase with ShapeSet class. These classes allows to write/read shapes directly to the stream. If some object is already in the stream, write a reference - relative position of the duplicated object. The old format of documents is still supported by Bin_ToolsShapeSet class.
PCDM_ReaderFilter - Allows the user to create a reading filter. It contains algorithm to browse labels tree quickly, without usage of referencing by entry-strings.
TDocStd, CDF and some other packages are changed for supporting reading filters API and options.

Tests, documentation and upgrade information are also added for both issues: 31839 and 31918 related to this commit.
74 files changed:
dox/upgrade/upgrade.md
dox/user_guides/ocaf/ocaf.md
src/BinDrivers/BinDrivers_DocumentRetrievalDriver.cxx
src/BinDrivers/BinDrivers_DocumentRetrievalDriver.hxx
src/BinDrivers/BinDrivers_DocumentStorageDriver.cxx
src/BinDrivers/BinDrivers_DocumentStorageDriver.hxx
src/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.cxx
src/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.hxx
src/BinLDrivers/BinLDrivers_DocumentSection.cxx
src/BinLDrivers/BinLDrivers_DocumentStorageDriver.cxx
src/BinLDrivers/BinLDrivers_DocumentStorageDriver.hxx
src/BinMNaming/BinMNaming_NamedShapeDriver.cxx
src/BinMNaming/BinMNaming_NamedShapeDriver.hxx
src/BinMNaming/BinMNaming_NamedShapeDriver.lxx
src/BinMXCAFDoc/BinMXCAFDoc.cxx
src/BinMXCAFDoc/BinMXCAFDoc_LocationDriver.cxx
src/BinMXCAFDoc/BinMXCAFDoc_LocationDriver.hxx
src/BinMXCAFDoc/BinMXCAFDoc_LocationDriver.lxx [deleted file]
src/BinMXCAFDoc/FILES
src/BinObjMgt/BinObjMgt_Persistent.cxx
src/BinObjMgt/BinObjMgt_Persistent.hxx
src/BinObjMgt/BinObjMgt_Persistent.lxx
src/BinObjMgt/BinObjMgt_Position.cxx [new file with mode: 0644]
src/BinObjMgt/BinObjMgt_Position.hxx [new file with mode: 0644]
src/BinObjMgt/FILES
src/BinTools/BinTools.cxx
src/BinTools/BinTools.hxx
src/BinTools/BinTools_Curve2dSet.cxx
src/BinTools/BinTools_Curve2dSet.hxx
src/BinTools/BinTools_CurveSet.cxx
src/BinTools/BinTools_CurveSet.hxx
src/BinTools/BinTools_IStream.cxx [new file with mode: 0644]
src/BinTools/BinTools_IStream.hxx [new file with mode: 0644]
src/BinTools/BinTools_LocationSet.cxx
src/BinTools/BinTools_LocationSet.hxx
src/BinTools/BinTools_OStream.cxx [new file with mode: 0644]
src/BinTools/BinTools_OStream.hxx [new file with mode: 0644]
src/BinTools/BinTools_ObjectType.hxx [new file with mode: 0644]
src/BinTools/BinTools_ShapeReader.cxx [new file with mode: 0644]
src/BinTools/BinTools_ShapeReader.hxx [new file with mode: 0644]
src/BinTools/BinTools_ShapeSet.cxx
src/BinTools/BinTools_ShapeSet.hxx
src/BinTools/BinTools_ShapeSetBase.cxx [new file with mode: 0644]
src/BinTools/BinTools_ShapeSetBase.hxx [new file with mode: 0644]
src/BinTools/BinTools_ShapeWriter.cxx [new file with mode: 0644]
src/BinTools/BinTools_ShapeWriter.hxx [new file with mode: 0644]
src/BinTools/BinTools_SurfaceSet.cxx
src/BinTools/BinTools_SurfaceSet.hxx
src/BinTools/FILES
src/CDF/CDF_Application.cxx
src/CDF/CDF_Application.hxx
src/CDM/CDM_Application.hxx
src/DDocStd/DDocStd_ApplicationCommands.cxx
src/PCDM/FILES
src/PCDM/PCDM_ReadWriter.cxx
src/PCDM/PCDM_Reader.hxx
src/PCDM/PCDM_ReaderFilter.cxx [new file with mode: 0644]
src/PCDM/PCDM_ReaderFilter.hxx [new file with mode: 0644]
src/StdLDrivers/StdLDrivers_DocumentRetrievalDriver.cxx
src/StdLDrivers/StdLDrivers_DocumentRetrievalDriver.hxx
src/TDocStd/TDocStd_Application.cxx
src/TDocStd/TDocStd_Application.hxx
src/TDocStd/TDocStd_Document.cxx
src/TDocStd/TDocStd_FormatVersion.hxx
src/XDEDRAW/XDEDRAW.cxx
src/XmlLDrivers/XmlLDrivers_DocumentRetrievalDriver.cxx
src/XmlLDrivers/XmlLDrivers_DocumentRetrievalDriver.hxx
tests/bugs/caf/bug31839_1 [new file with mode: 0644]
tests/bugs/caf/bug31839_2 [new file with mode: 0644]
tests/bugs/caf/bug31918_1 [new file with mode: 0644]
tests/bugs/caf/bug31918_2 [new file with mode: 0644]
tests/caf/progress/A1
tests/caf/progress/B1
tests/caf/progress/C1