X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_Gen_i.cxx;h=363e8d7aa78c5e390fc971d3dcd83c7ebd3b3eb3;hp=93c981ec317b108464d66716735b16411d9de801;hb=6b5dcfe0005f2a725fd721fe10abd1c3259e25ad;hpb=60bb6273b99dc88e3d6f360d7ae5792a77c68d06 diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index 93c981ec3..363e8d7aa 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -460,18 +460,17 @@ GenericHypothesisCreator_i* SMESH_Gen_i::getHypothesisCreator(const char* theHyp // load plugin library if(MYDEBUG) MESSAGE("Loading server meshers plugin library ..."); #ifdef WIN32 -#ifdef UNICODE +# ifdef UNICODE const wchar_t* path = Kernel_Utils::decode_s(aPlatformLibName); -#else + SMESHUtils::ArrayDeleter deleter( path ); +# else const char* path = aPlatformLibName.c_str(); -#endif +# endif #else const char* path = aPlatformLibName.c_str(); #endif LibHandle libHandle = LoadLib( path ); -#if defined(WIN32) && defined(UNICODE) - delete path; -#endif + if (!libHandle) { // report any error, if occurred @@ -2707,10 +2706,10 @@ SMESH_Gen_i::ConcatenateCommon(const SMESH::ListOfIDSources& theMeshesArray, { // type names const char* typeNames[] = { "All","Nodes","Edges","Faces","Volumes","0DElems","Balls" }; - { // check of typeNames: compilation failure mains that NB_ELEMENT_TYPES changed: - const int nbNames = sizeof(typeNames) / sizeof(const char*); - int _assert[( nbNames == SMESH::NB_ELEMENT_TYPES ) ? 2 : -1 ]; _assert[0]=_assert[1]=0; - } + + // check of typeNames: compilation failure mains that NB_ELEMENT_TYPES changed: + static_assert( sizeof(typeNames) / sizeof(const char*) ==SMESH::NB_ELEMENT_TYPES, + "Update names of ElementType's!!!" ); SMESH::smIdType_array_var curState = newMesh->GetNbElementsByType(); @@ -4206,8 +4205,9 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent, system(cmd.ToCString()); // MED writer to be used by storage process - DriverMED_W_SMESHDS_Mesh myWriter; - myWriter.SetFile( meshfile.ToCString() ); + DriverMED_W_SMESHDS_Mesh writer; + writer.SetFile( meshfile.ToCString() ); + //writer.SetSaveNumbers( false ); // bos #24400 -- it leads to change of element IDs // IMP issue 20918 // SetStoreName() to groups before storing hypotheses to let them refer to @@ -4414,8 +4414,8 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent, // check if the mesh is not empty if ( mySMESHDSMesh->NbNodes() > 0 ) { // write mesh data to med file - myWriter.SetMesh( mySMESHDSMesh ); - myWriter.SetMeshId( id ); + writer.SetMesh( mySMESHDSMesh ); + writer.SetMeshId( id ); strHasData = "1"; } aSize[ 0 ] = strHasData.length() + 1; @@ -4889,7 +4889,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent, // Pass SMESHDS_Group to MED writer SMESHDS_Group* aGrpDS = dynamic_cast( aGrpBaseDS ); if ( aGrpDS ) - myWriter.AddGroup( aGrpDS ); + writer.AddGroup( aGrpDS ); // write reference on a shape if exists SMESHDS_GroupOnGeom* aGeomGrp = @@ -4914,7 +4914,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent, else // shape ref is invalid: { // save a group on geometry as ordinary group - myWriter.AddGroup( aGeomGrp ); + writer.AddGroup( aGeomGrp ); } } else if ( SMESH_GroupOnFilter_i* aFilterGrp_i = @@ -4937,7 +4937,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent, if ( strcmp( strHasData.c_str(), "1" ) == 0 ) { // Flush current mesh information into MED file - myWriter.Perform(); + writer.Perform(); // save info on nb of elements SMESH_PreMeshInfo::SaveToFile( myImpl, id, aFile ); @@ -5193,7 +5193,8 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent, TCollection_AsciiString aStudyName( "" ); if ( isMultiFile ) { CORBA::WString_var url = aStudy->URL(); - aStudyName = (char*)SALOMEDS_Tool::GetNameFromPath( Kernel_Utils::encode(url.in()) ).c_str(); + SMESHUtils::ArrayDeleter urlMulibyte( Kernel_Utils::encode( url.in()) ); + aStudyName = (char*)SALOMEDS_Tool::GetNameFromPath( urlMulibyte.get() ).c_str(); } // Set names of temporary files TCollection_AsciiString filename = tmpDir + aStudyName + "_SMESH.hdf"; @@ -5547,7 +5548,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent, } } // reading MESHes - // As all object that can be referred by hypothesis are created, + // As all objects that can be referred by hypothesis are created, // we can restore hypothesis data list< pair< SMESH_Hypothesis_i*, string > >::iterator hyp_data;