From: vsv Date: Tue, 4 Apr 2006 10:44:53 +0000 (+0000) Subject: Control names of homogen groups X-Git-Tag: T3_2_0b1_pre1~55 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=11075b4768aaa14e773e28b42b9f277c9f4dc4bf;p=modules%2Fsmesh.git Control names of homogen groups --- diff --git a/src/DriverUNV/DriverUNV_R_SMDS_Mesh.cxx b/src/DriverUNV/DriverUNV_R_SMDS_Mesh.cxx index 11050be8b..9037ddf06 100644 --- a/src/DriverUNV/DriverUNV_R_SMDS_Mesh.cxx +++ b/src/DriverUNV/DriverUNV_R_SMDS_Mesh.cxx @@ -277,10 +277,12 @@ Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform() //myGroupId.insert(TGroupIdMap::value_type(aNewGroup, aLabel)); int aNodesNb = aRec.NodeList.size(); + int aElementsNb = aRec.ElementList.size(); + bool useSuffix = ((aNodesNb > 0) && (aElementsNb > 0)); int i; if (aNodesNb > 0) { SMDS_MeshGroup* aNodesGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Node); - std::string aGrName = aRec.GroupName + "_Nodes"; + std::string aGrName = (useSuffix) ? aRec.GroupName + "_Nodes" : aRec.GroupName; myGroupNames.insert(TGroupNamesMap::value_type(aNodesGroup, aGrName)); myGroupId.insert(TGroupIdMap::value_type(aNodesGroup, aLabel)); @@ -290,7 +292,6 @@ Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform() aNodesGroup->Add(aNode); } } - int aElementsNb = aRec.ElementList.size(); if (aElementsNb > 0){ SMDS_MeshGroup* aEdgesGroup = 0; SMDS_MeshGroup* aFacesGroup = 0; @@ -302,7 +303,7 @@ Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform() case SMDSAbs_Edge: if (!aEdgesGroup) { aEdgesGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Edge); - std::string aEdgesGrName = aRec.GroupName + "_Edges"; + std::string aEdgesGrName = (useSuffix) ? aRec.GroupName + "_Edges" : aRec.GroupName; myGroupNames.insert(TGroupNamesMap::value_type(aEdgesGroup, aEdgesGrName)); myGroupId.insert(TGroupIdMap::value_type(aEdgesGroup, aLabel)); } @@ -311,7 +312,7 @@ Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform() case SMDSAbs_Face: if (!aFacesGroup) { aFacesGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Face); - std::string aFacesGrName = aRec.GroupName + "_Faces"; + std::string aFacesGrName = (useSuffix) ? aRec.GroupName + "_Faces" : aRec.GroupName; myGroupNames.insert(TGroupNamesMap::value_type(aFacesGroup, aFacesGrName)); myGroupId.insert(TGroupIdMap::value_type(aFacesGroup, aLabel)); }