mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-16 10:08:36 +03:00
0027264: Weird difference between two BRepTools::Write() overloads
Assume that the brep file contains DBRep_DrawableShape variable if the file header is absent test cases
This commit is contained in:
parent
b2fbf11a4f
commit
4aa09e317f
@ -227,15 +227,29 @@ static Standard_Integer restore(Draw_Interpretor& di, Standard_Integer n, const
|
|||||||
progress->Show();
|
progress->Show();
|
||||||
|
|
||||||
Draw_SaveAndRestore* tool = Draw_First;
|
Draw_SaveAndRestore* tool = Draw_First;
|
||||||
|
Draw_SaveAndRestore* aDBRepTool = NULL;
|
||||||
while (tool) {
|
while (tool) {
|
||||||
if (!strcmp(typ,tool->Name())) break;
|
const char* toolName = tool->Name();
|
||||||
|
if (!strcmp(typ,toolName)) break;
|
||||||
|
if (!strcmp("DBRep_DrawableShape",toolName))
|
||||||
|
aDBRepTool = tool;
|
||||||
Draw::SetProgressBar(progress);
|
Draw::SetProgressBar(progress);
|
||||||
tool = tool->Next();
|
tool = tool->Next();
|
||||||
}
|
}
|
||||||
if (tool) {
|
|
||||||
|
if (!tool)
|
||||||
|
{
|
||||||
|
//assume that this file stores a DBRep_DrawableShape variable
|
||||||
|
tool = aDBRepTool;
|
||||||
|
in.seekg(0, ios::beg);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tool)
|
||||||
|
{
|
||||||
Handle(Draw_Drawable3D) D = tool->Restore(in);
|
Handle(Draw_Drawable3D) D = tool->Restore(in);
|
||||||
Draw::Set(name,D,tool->Disp() && autodisp);
|
Draw::Set(name,D,tool->Disp() && autodisp);
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
di << "Cannot restore a " << typ;
|
di << "Cannot restore a " << typ;
|
||||||
return 1;
|
return 1;
|
||||||
|
14
tests/bugs/modalg_6/bug27264_1
Normal file
14
tests/bugs/modalg_6/bug27264_1
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC27264"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
###############################
|
||||||
|
## Weird difference between two BRepTools::Write() overloads
|
||||||
|
###############################
|
||||||
|
|
||||||
|
restore [locate_data_file bug27264_1.brep] a
|
||||||
|
|
||||||
|
checknbshapes a -vertex 8 -edge 12 -face 6
|
||||||
|
checkprops a -s 6
|
||||||
|
checkshape a
|
||||||
|
|
14
tests/bugs/modalg_6/bug27264_2
Normal file
14
tests/bugs/modalg_6/bug27264_2
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC27264"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
###############################
|
||||||
|
## Weird difference between two BRepTools::Write() overloads
|
||||||
|
###############################
|
||||||
|
|
||||||
|
restore [locate_data_file bug27264_2.brep] a
|
||||||
|
|
||||||
|
checknbshapes a -vertex 2 -edge 3 -face 1
|
||||||
|
checkprops a -s 1256.64
|
||||||
|
checkshape a
|
||||||
|
|
15
tests/bugs/modalg_6/bug27264_3
Normal file
15
tests/bugs/modalg_6/bug27264_3
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC27264"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
###############################
|
||||||
|
## Weird difference between two BRepTools::Write() overloads
|
||||||
|
###############################
|
||||||
|
|
||||||
|
restore [locate_data_file bug27264_3.brep] a
|
||||||
|
|
||||||
|
set info [nbshapes a]
|
||||||
|
|
||||||
|
if {[string compare $info ""] != 0} {
|
||||||
|
puts "ERROR: null shape is expected here"
|
||||||
|
}
|
15
tests/bugs/modalg_6/bug27264_4
Normal file
15
tests/bugs/modalg_6/bug27264_4
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC27264"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
###############################
|
||||||
|
## Weird difference between two BRepTools::Write() overloads
|
||||||
|
###############################
|
||||||
|
|
||||||
|
restore [locate_data_file bug27264_4.brep] a
|
||||||
|
|
||||||
|
set info [nbshapes a]
|
||||||
|
|
||||||
|
if {[string compare $info ""] != 0} {
|
||||||
|
puts "ERROR: null shape is expected here"
|
||||||
|
}
|
15
tests/bugs/modalg_6/bug27264_5
Normal file
15
tests/bugs/modalg_6/bug27264_5
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC27264"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
###############################
|
||||||
|
## Weird difference between two BRepTools::Write() overloads
|
||||||
|
###############################
|
||||||
|
|
||||||
|
restore [locate_data_file bug27264_5.brep] a
|
||||||
|
|
||||||
|
set info [nbshapes a]
|
||||||
|
|
||||||
|
if {[string compare $info ""] != 0} {
|
||||||
|
puts "ERROR: null shape is expected here"
|
||||||
|
}
|
15
tests/bugs/modalg_6/bug27264_6
Normal file
15
tests/bugs/modalg_6/bug27264_6
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC27264"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
###############################
|
||||||
|
## Weird difference between two BRepTools::Write() overloads
|
||||||
|
###############################
|
||||||
|
|
||||||
|
restore [locate_data_file bug27264_6.brep] a
|
||||||
|
|
||||||
|
set info [nbshapes a]
|
||||||
|
|
||||||
|
if {[string compare $info ""] != 0} {
|
||||||
|
puts "ERROR: null shape is expected here"
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user