]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
0022864: [CEA 1423] Dump Export and Import XAO vsr/22864
authorvsr <vsr@opencascade.com>
Mon, 16 Feb 2015 11:14:13 +0000 (14:14 +0300)
committervsr <vsr@opencascade.com>
Mon, 16 Feb 2015 11:14:13 +0000 (14:14 +0300)
src/XAOPlugin/XAOPlugin_IOperations.cxx

index d491cad2b49d02911a741359797061cc3ac0f928..8f9a5512bd2b914b6e2973338bc940f3478e1dea 100644 (file)
 #include <TColStd_HArray1OfReal.hxx>
 #include <TDataStd_Integer.hxx>
 
+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;
       }
     }