From 20c4ee10bb0f0a1da08d1eb1f82e3b0bf3b65ba2 Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 17 Oct 2014 18:53:28 +0400 Subject: [PATCH] 22784: EDF 8824 GHS3DPLUGIN: SetEnforcedVertexNamedWithGroup() does not add an extra group --- doc/salome/gui/GHS3DPLUGIN/input/ghs3d_hypo.doc | 3 ++- src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx | 16 +++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/doc/salome/gui/GHS3DPLUGIN/input/ghs3d_hypo.doc b/doc/salome/gui/GHS3DPLUGIN/input/ghs3d_hypo.doc index 28ed05a..8aa1470 100644 --- a/doc/salome/gui/GHS3DPLUGIN/input/ghs3d_hypo.doc +++ b/doc/salome/gui/GHS3DPLUGIN/input/ghs3d_hypo.doc @@ -146,7 +146,8 @@ An enforced vertex is defined by: - from GEOM (Vertex, Compound) - only available on meshes with no geometry attached - or from (x,y,z) Cartesian coordinates -- A constant physical size +- A constant physical size. If this size is zero, then the mesh size is +not affected. - If a group name is given, the created node will be added to the group. If the group does not exist, it is created. diff --git a/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx b/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx index b368961..1f96d33 100644 --- a/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx +++ b/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx @@ -1038,7 +1038,9 @@ void GHS3DPluginGUI_HypothesisCreator::addEnforcedVertex(double x, double y, dou break; - if (( !isCompound && ((itemX == x) && (itemY == y) && (itemZ == z))) || /*( (itemEntry.toStdString() != "") && */ (itemEntry.toStdString() == geomEntry)/*)*/) { + if (( !isCompound && ((itemX == x) && (itemY == y) && (itemZ == z))) || + ( !itemEntry.isEmpty() && ( itemEntry == geomEntry.c_str() ))) + { // update size if (itemSize != size) { MESSAGE("Size is updated from \"" << itemSize << "\" to \"" << size << "\""); @@ -1261,10 +1263,14 @@ void GHS3DPluginGUI_HypothesisCreator::onAddEnforcedVertex() if (selEnfVertex == 1) { MESSAGE("1 GEOM object selected"); myEnfVertex = myEnfVertexWdg->GetObject< GEOM::GEOM_Object >(); - std::string entry = ""; - if (myEnfVertex != GEOM::GEOM_Object::_nil()) - entry = myEnfVertex->GetStudyEntry(); - addEnforcedVertex(x, y, z, size, myEnfVertex->GetName(),entry, groupName, myEnfVertex->GetShapeType() == GEOM::COMPOUND); + std::string entry = "", name = ""; + bool isCompound = false; + if ( !myEnfVertex->_is_nil() ) { + entry = SMESH::toStdStr( myEnfVertex->GetStudyEntry() ); + name = SMESH::toStdStr( myEnfVertex->GetName() ); + isCompound = ( myEnfVertex->GetShapeType() == GEOM::COMPOUND ); + } + addEnforcedVertex(x, y, z, size, name, entry, groupName, isCompound); } else { MESSAGE("0 GEOM object selected"); -- 2.39.2