From 26c962f1dd48618fffede0e36f9c93a4c5f1fbd4 Mon Sep 17 00:00:00 2001 From: vsr Date: Mon, 16 Feb 2015 14:14:13 +0300 Subject: [PATCH] 0022864: [CEA 1423] Dump Export and Import XAO --- src/XAOPlugin/XAOPlugin_IOperations.cxx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/XAOPlugin/XAOPlugin_IOperations.cxx b/src/XAOPlugin/XAOPlugin_IOperations.cxx index d491cad2b..8f9a5512b 100644 --- a/src/XAOPlugin/XAOPlugin_IOperations.cxx +++ b/src/XAOPlugin/XAOPlugin_IOperations.cxx @@ -53,6 +53,15 @@ #include #include +namespace +{ + TCollection_AsciiString subShapeName( const Handle(GEOM_Object)& subObject ) + { + TCollection_AsciiString name = subObject->GetName(); + if ( name.IsEmpty() ) name = "[unnamed]"; + return name; + } +} XAO::Dimension shapeEnumToDimension(const TopAbs_ShapeEnum& shape) { @@ -274,16 +283,16 @@ void XAOPlugin_IOperations::exportSubshapes( const Handle(GEOM_Object)& shape, X switch (subObject->GetValue().ShapeType()) { case TopAbs_VERTEX: - geometry->changeVertexName(subIndex, subObject->GetName().ToCString()); + geometry->changeVertexName(subIndex, subShapeName( subObject ).ToCString()); break; case TopAbs_EDGE: - geometry->changeEdgeName(subIndex, subObject->GetName().ToCString()); + geometry->changeEdgeName(subIndex, subShapeName( subObject ).ToCString()); break; case TopAbs_FACE: - geometry->changeFaceName(subIndex, subObject->GetName().ToCString()); + geometry->changeFaceName(subIndex, subShapeName( subObject ).ToCString()); break; case TopAbs_SOLID: - geometry->changeSolidName(subIndex, subObject->GetName().ToCString()); + geometry->changeSolidName(subIndex, subShapeName( subObject ).ToCString()); break; } } -- 2.39.2