mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-03 17:56:21 +03:00
Storage and retrieval of a document by means of a stream is distributed to TObj model. Modified files: -TObj_Model.hxx, cxx - the virtual methods Load() and SaveAs() obtained a stream as an argument instead of a file name. -TObj_Application.hxx, cxx - same extension: the virtual methods LoadDocument() and SaveDocument() use a stream to open and save a document. -TObjDRAW.cxx - draw-commands TObjSave and TObjLoad are extended for -stream parameter, which allows usage of a file input or output stream instead of a file name. A new test: - bugs caf bug29901 - it creates a simple TObj-model, saves it on disk using a file stream, loads it by means of a file stream and checks the content. Modified test: - bugs caf bug28425 - just improved to proper manipulate a test-file on disk.
59 lines
1.4 KiB
Plaintext
59 lines
1.4 KiB
Plaintext
puts "==========="
|
|
puts "OCC28425"
|
|
puts "==========="
|
|
puts ""
|
|
############################################################
|
|
# Open/save NamedShape changes order of shapes
|
|
############################################################
|
|
|
|
pload QAcommands
|
|
set aTestFileBin $imagedir/${casename}.cbf
|
|
set aTestFileXml $imagedir/${casename}.xml
|
|
|
|
vertex v 1 2 3
|
|
box b 10 20 30
|
|
|
|
# Test bin document
|
|
NewDocument D1 BinOcaf
|
|
BuildNamedShape D1 0:1 PRIMITIVE v b
|
|
GetNewShapes D1 0:1 s
|
|
set info [whatis s_1]
|
|
if { [regexp "SOLID" $info] != 1 } {
|
|
puts "Error: first shape should be solid"
|
|
} else {
|
|
puts "OK: order of shapes is correct"
|
|
}
|
|
SaveAs D1 ${aTestFileBin}
|
|
Close D1
|
|
Open ${aTestFileBin} D2
|
|
GetNewShapes D2 0:1 s
|
|
set info [whatis s_1]
|
|
if { [regexp "SOLID" $info] != 1 } {
|
|
puts "Error: first shape should be solid"
|
|
} else {
|
|
puts "OK: order of shapes is correct"
|
|
}
|
|
Close D2
|
|
|
|
# Test xml document
|
|
NewDocument D1 XmlOcaf
|
|
BuildNamedShape D1 0:1 PRIMITIVE v b
|
|
GetNewShapes D1 0:1 s
|
|
set info [whatis s_1]
|
|
if { [regexp "SOLID" $info] != 1 } {
|
|
puts "Error: first shape should be solid"
|
|
} else {
|
|
puts "OK: order of shapes is correct"
|
|
}
|
|
SaveAs D1 ${aTestFileXml}
|
|
Close D1
|
|
Open ${aTestFileXml} D2
|
|
GetNewShapes D2 0:1 s
|
|
set info [whatis s_1]
|
|
if { [regexp "SOLID" $info] != 1 } {
|
|
puts "Error: first shape should be solid"
|
|
} else {
|
|
puts "OK: order of shapes is correct"
|
|
}
|
|
Close D2
|