From: eap Date: Fri, 17 Oct 2014 14:53:28 +0000 (+0400) Subject: 22784: EDF 8824 GHS3DPLUGIN: SetEnforcedVertexNamedWithGroup() does not add an extra... X-Git-Tag: V7_5_0b1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f766c3acbc1e9f1aaea8137ace4b2ce0f53b2db6;p=plugins%2Fghs3dplugin.git 22784: EDF 8824 GHS3DPLUGIN: SetEnforcedVertexNamedWithGroup() does not add an extra group --- 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");