mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-05-12 02:40:22 +08:00
1. Unification of usage of a storage version of an OCAF document by XML and binary file formats.
2. A new format version enumeration in TDocStd package: TDocStd_FormatVersion.
3. Removal of unnecessary methods for storage version like XmlLDrivers::StorageVersion() and BinLDrivers::StorageVersion().
4. Support of old documents (storage version <= 9) in binary file format (came from ESA).
New files:
- TDocStd_FormatVersion.hxx: a new storage format version enumeration for an OCAF document.
Modified files:
- CDM_Document.hxx and cxx: removal of storage format version property (moved to TDocStd_Document).
- TDocStd_Document.hxx and cxx: a storage format version property (moved from CDM_Document).
- BinLDrivers_DocumentSection.hxx and cxx: support of old document storage version in binary file format.
- BinDrivers_DocumentStorageDriver.hxx and cxx,
- BinLDrivers_DocumentStorageDriver.hxx and cxx,
- BinLDrivers_DocumentRetrievalDriver.cxx,
- XmlLDrivers_DocumentRetrievalDriver.cxx,
- XmlLDrivers_DocumentStorageDriver.cxx: usage of document storage version from TDocStd_Document in storage and retrieval drivers.
- DDocStd_ApplicationCommands.cxx: draw-command name StorageVersion is replaced by StorageFormatVersion (to be the same everywhere). A corresponding script is corrected too.
New test:
- bugs caf bug29217: a test case for old document storage version in binary file format. It checks several attributes saved by the version TDocStd_FormatVersion_VERSION_7 (old) and the latest version.
Modified test:
- caf presentation M1: the test used a file in the current folder, not in {imagedir} like all other tests.
- bugs caf bug28691
Documentation:
- dox/upgrade/upgrade.md
// All remarks are fixed.
93 lines
3.6 KiB
Plaintext
93 lines
3.6 KiB
Plaintext
puts "============"
|
|
puts "OCC28691"
|
|
puts "Storage of Ocaf documents in XML file format in old document version"
|
|
puts "============"
|
|
puts ""
|
|
|
|
NewDocument D XmlOcaf
|
|
SetExtStringArray D 0:1 0 1 3 Hello hallo Bonjour
|
|
set FileV7 ${imagedir}/bug28691_doc7.xml
|
|
set FileV9 ${imagedir}/bug28691_doc9.xml
|
|
SetNode D 0:1
|
|
AISSet D 0:1 NS
|
|
|
|
SaveAs D ${FileV9}
|
|
|
|
SetStorageFormatVersion D 7
|
|
SaveAs D ${FileV7}
|
|
|
|
Close D
|
|
|
|
puts "Testing for XML file format in new version document"
|
|
|
|
Open ${FileV9} D9
|
|
|
|
set info [Attributes D9 0:1]
|
|
if { [regexp "TDataStd_ExtStringArray" ${info}] != 1 } {
|
|
puts "Error : there is not TDataStd_ExtStringArray attribute in new version document"
|
|
} else {
|
|
puts "OK : there is TDataStd_ExtStringArray attribute in new version document"
|
|
}
|
|
if { [regexp "TDataStd_TreeNode" ${info}] != 1 } {
|
|
puts "Error : there is not TDataStd_TreeNode attribute in new version document"
|
|
} else {
|
|
puts "OK : there is TDataStd_TreeNode attribute in new version document"
|
|
}
|
|
if { [regexp "TDataXtd_Presentation" ${info}] != 1 } {
|
|
puts "Error : there is not TDataXtd_Presentation attribute in new version document"
|
|
} else {
|
|
puts "OK : there is TDataXtd_Presentation attribute in new version document"
|
|
}
|
|
set info [GetExtStringArray D9 0:1]
|
|
if { [regexp "Hello" ${info}] != 1 } {
|
|
puts "Error : there is not \"Hello\" word in TDataStd_ExtStringArray attribute in new version document"
|
|
} else {
|
|
puts "OK : there is \"Hello\" word in TDataStd_ExtStringArray attribute in new version document"
|
|
}
|
|
if { [regexp "hallo" ${info}] != 1 } {
|
|
puts "Error : there is not \"hallo\" word in TDataStd_ExtStringArray attribute in new version document"
|
|
} else {
|
|
puts "OK : there is \"hallo\" word in TDataStd_ExtStringArray attribute in new version document"
|
|
}
|
|
if { [regexp "Bonjour" ${info}] != 1 } {
|
|
puts "Error : there is not \"Bonjour\" word in TDataStd_ExtStringArray attribute in new version document"
|
|
} else {
|
|
puts "OK : there is \"Bonjour\" word in TDataStd_ExtStringArray attribute in new version document"
|
|
}
|
|
|
|
puts "\nTesting for XML file format in old version document"
|
|
Open ${FileV7} D7
|
|
|
|
set info [Attributes D7 0:1]
|
|
if { [regexp "TDataStd_ExtStringArray" ${info}] != 1 } {
|
|
puts "Error : there is not TDataStd_ExtStringArray attribute in old version document"
|
|
} else {
|
|
puts "OK : there is TDataStd_ExtStringArray attribute in old version document"
|
|
}
|
|
if { [regexp "TDataStd_TreeNode" ${info}] != 1 } {
|
|
puts "Error : there is not TDataStd_TreeNode attribute in old version document"
|
|
} else {
|
|
puts "OK : there is TDataStd_TreeNode attribute in old version document"
|
|
}
|
|
if { [regexp "TDataXtd_Presentation" ${info}] != 1 } {
|
|
puts "Error : there is not TDataXtd_Presentation attribute in old version document"
|
|
} else {
|
|
puts "OK : there is TDataXtd_Presentation attribute in old version document"
|
|
}
|
|
set info [GetExtStringArray D7 0:1]
|
|
if { [regexp "Hello" ${info}] != 1 } {
|
|
puts "Error : there is not \"Hello\" word in TDataStd_ExtStringArray attribute in old version document"
|
|
} else {
|
|
puts "OK : there is \"Hello\" word in TDataStd_ExtStringArray attribute in old version document"
|
|
}
|
|
if { [regexp "hallo" ${info}] != 1 } {
|
|
puts "Error : there is not \"hallo\" word in TDataStd_ExtStringArray attribute in old version document"
|
|
} else {
|
|
puts "OK : there is \"hallo\" word in TDataStd_ExtStringArray attribute in old version document"
|
|
}
|
|
if { [regexp "Bonjour" ${info}] != 1 } {
|
|
puts "Error : there is not \"Bonjour\" word in TDataStd_ExtStringArray attribute in old version document"
|
|
} else {
|
|
puts "OK : there is \"Bonjour\" word in TDataStd_ExtStringArray attribute in old version document"
|
|
}
|