From: vsr Date: Mon, 16 Feb 2015 11:14:13 +0000 (+0300) Subject: 0022864: [CEA 1423] Dump Export and Import XAO X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=26c962f1dd48618fffede0e36f9c93a4c5f1fbd4;p=modules%2Fgeom.git 0022864: [CEA 1423] Dump Export and Import XAO --- 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; } }