Assume that the brep file contains DBRep_DrawableShape variable if the file header is absent
test cases
progress->Show();
Draw_SaveAndRestore* tool = Draw_First;
+ Draw_SaveAndRestore* aDBRepTool = NULL;
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);
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);
Draw::Set(name,D,tool->Disp() && autodisp);
}
+
else {
di << "Cannot restore a " << typ;
return 1;
--- /dev/null
+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
+
--- /dev/null
+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
+
--- /dev/null
+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"
+}
--- /dev/null
+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"
+}
--- /dev/null
+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"
+}
--- /dev/null
+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"
+}