From 3d999c609040bde95727268a30f4e578558c5270 Mon Sep 17 00:00:00 2001 From: kgv Date: Thu, 13 Dec 2018 10:32:45 +0300 Subject: [PATCH] 0030411: Data Exchange - attached model is exported as empty JT and VRML file VrmlData_ShapeConvert::ConvertDocument() now handles reference labels within free shapes in the document. --- src/VrmlData/VrmlData_ShapeConvert.cxx | 12 ++++++++---- tests/bugs/xde/bug30411 | 13 +++++++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 tests/bugs/xde/bug30411 diff --git a/src/VrmlData/VrmlData_ShapeConvert.cxx b/src/VrmlData/VrmlData_ShapeConvert.cxx index 2b7373c201..151d5f9b61 100644 --- a/src/VrmlData/VrmlData_ShapeConvert.cxx +++ b/src/VrmlData/VrmlData_ShapeConvert.cxx @@ -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 index 0000000000..6232fbea25 --- /dev/null +++ b/tests/bugs/xde/bug30411 @@ -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