From 007cb019bbbc2e847faa9c1da4e30cf7a98b0d37 Mon Sep 17 00:00:00 2001 From: vtn Date: Tue, 4 Dec 2007 11:28:38 +0000 Subject: [PATCH] NPAL16716: Compound. To create the groups of the initial meshes. Awoiding to create empty groups. --- src/SMESH_I/SMESH_Gen_i.cxx | 62 +++++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index 357b8d77f..61b323772 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -1512,52 +1512,60 @@ SMESH_Gen_i::ConcatenateCommon(const SMESH::mesh_array& theMeshesArray, str += aMeshSObj->GetName(); str += "_"; + int anLen = 0; + switch(aGroupType) { case SMESH::NODE: - str += "Nodes"; - anIDsNodes->length(anNbNodes++); - break; + str += "Nodes"; + anIDsNodes->length(anNbNodes); + anLen = anNbNodes; + break; case SMESH::EDGE: - str += "Edges"; - anIDsEdges->length(anNbEdges++); - break; + str += "Edges"; + anIDsEdges->length(anNbEdges); + anLen = anNbEdges; + break; case SMESH::FACE: - str += "Faces"; - anIDsFaces->length(anNbFaces++); - break; + str += "Faces"; + anIDsFaces->length(anNbFaces); + anLen = anNbFaces; + break; case SMESH::VOLUME: - str += "Volumes"; - anIDsVolumes->length(anNbVolumes++); - break; + str += "Volumes"; + anIDsVolumes->length(anNbVolumes); + anLen = anNbVolumes; + break; default: - break; + break; } - - aGroupName = str.c_str(); - // add a new group in the mesh - aNewGroup = aNewImpl->CreateGroup(aGroupType, aGroupName); + if(anLen) { + aGroupName = str.c_str(); - switch(aGroupType) { - case SMESH::NODE: + // add a new group in the mesh + aNewGroup = aNewImpl->CreateGroup(aGroupType, aGroupName); + + switch(aGroupType) { + case SMESH::NODE: aNewGroup->Add( anIDsNodes ); break; - case SMESH::EDGE: + case SMESH::EDGE: aNewGroup->Add( anIDsEdges ); break; - case SMESH::FACE: + case SMESH::FACE: aNewGroup->Add( anIDsFaces ); break; - case SMESH::VOLUME: + case SMESH::VOLUME: aNewGroup->Add( anIDsVolumes ); break; - default: + default: break; - } + } - aListOfNewGroups.clear(); - aListOfNewGroups.push_back(aNewGroup); - aGroupsMap.insert(make_pair( make_pair(aGroupName, aGroupType), aListOfNewGroups )); + aListOfNewGroups.clear(); + aListOfNewGroups.push_back(aNewGroup); + aGroupsMap.insert(make_pair( make_pair(aGroupName, aGroupType), aListOfNewGroups )); + } } } -- 2.39.2