X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FDriverSTL%2FDriverSTL_W_SMDS_Mesh.cxx;h=333c72d96af80d11dfb031cad24825458e0aecba;hb=refs%2Fheads%2Fimn%2FIMACS_8_3_0;hp=6f9d02a3070e2d4970d99e8f4452b00ac22843b5;hpb=081f12102e2a2aebef15760d5f6d06b4834ae26e;p=modules%2Fsmesh.git diff --git a/src/DriverSTL/DriverSTL_W_SMDS_Mesh.cxx b/src/DriverSTL/DriverSTL_W_SMDS_Mesh.cxx index 6f9d02a30..333c72d96 100644 --- a/src/DriverSTL/DriverSTL_W_SMDS_Mesh.cxx +++ b/src/DriverSTL/DriverSTL_W_SMDS_Mesh.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -176,7 +176,7 @@ static void writeFloat( const Standard_ShortReal& theVal, SMESH_File& ofile) { union { Standard_ShortReal f; - char c[4]; + char c[4]; } u; u.f = theVal; @@ -485,7 +485,8 @@ Driver_Mesh::Status DriverSTL_W_SMDS_Mesh::writeAscii() const SMESH_File aFile( myFile, /*openForReading=*/false ); aFile.openForWriting(); - std::string buf("solid\n"); + std::string buf("solid "); + buf += myName + "\n"; aFile.writeRaw( buf.c_str(), buf.size() ); char sval[128]; @@ -520,7 +521,8 @@ Driver_Mesh::Status DriverSTL_W_SMDS_Mesh::writeAscii() const " endfacet\n", 21 ); } } - aFile.writeRaw ("endsolid\n" , 9 ); + buf = "endsolid " + myName + "\n"; + aFile.writeRaw( buf.c_str(), buf.size() ); return aResult; } @@ -554,6 +556,11 @@ Driver_Mesh::Status DriverSTL_W_SMDS_Mesh::writeBinary() const } } std::string sval( LABEL_SIZE, ' ' ); + if ( !myName.empty() ) + { + sval = "name: " + myName; + sval.resize( LABEL_SIZE, ' ' ); + } aFile.write( sval.c_str(), LABEL_SIZE ); // write number of triangles