0030411: Data Exchange - attached model is exported as empty JT and VRML file IR-2018-12-14 IR-WEEK50
authorkgv <kgv@opencascade.com>
Thu, 13 Dec 2018 07:32:45 +0000 (10:32 +0300)
committerapn <apn@opencascade.com>
Fri, 14 Dec 2018 09:08:42 +0000 (12:08 +0300)
VrmlData_ShapeConvert::ConvertDocument() now handles reference labels within free shapes in the document.

src/VrmlData/VrmlData_ShapeConvert.cxx
tests/bugs/xde/bug30411 [new file with mode: 0644]

index 2b7373c..151d5f9 100644 (file)
@@ -862,13 +862,17 @@ void VrmlData_ShapeConvert::ConvertDocument(const Handle(TDocStd_Document) &theD
   for (TDF_LabelSequence::Iterator aRootIter(aFreeShapeLabels); aRootIter.More(); aRootIter.Next())
   {
     const TDF_Label& aFreeShapeLabel = aRootIter.Value();
-    if (aShapeTool->IsSimpleShape(aFreeShapeLabel))
+    if (aShapeTool->IsAssembly (aFreeShapeLabel))
     {
-      addShape(aGroup, aFreeShapeLabel, theDoc);
+      addAssembly (aGroup, aFreeShapeLabel, theDoc, Standard_True);
     }
-    else if (aShapeTool->IsAssembly(aFreeShapeLabel))
+    else if (aShapeTool->IsReference (aFreeShapeLabel))
     {
-      addAssembly(aGroup, aFreeShapeLabel, theDoc, Standard_True);
+      addInstance (aGroup, aFreeShapeLabel, theDoc);
+    }
+    else if (aShapeTool->IsSimpleShape (aFreeShapeLabel))
+    {
+      addShape (aGroup, aFreeShapeLabel, theDoc);
     }
   }
 }
diff --git a/tests/bugs/xde/bug30411 b/tests/bugs/xde/bug30411
new file mode 100644 (file)
index 0000000..6232fbe
--- /dev/null
@@ -0,0 +1,13 @@
+puts "================"
+puts "0030411: Data Exchange - attached model is exported as empty JT and VRML file"
+puts "================"
+puts ""
+
+pload XDE VISUALIZATION
+restore [locate_data_file bug27821_nullsurf.brep] s
+explode s F
+XNewDoc D
+XAddShape D s_6 0
+WriteVrml D $imagedir/${casename}.wrl
+loadvrml  w $imagedir/${casename}.wrl
+checktrinfo w -tri 18 -nod 20