Salome HOME
22784: EDF 8824 GHS3DPLUGIN: SetEnforcedVertexNamedWithGroup() does not add an extra... V7_5_0b1
authoreap <eap@opencascade.com>
Fri, 17 Oct 2014 14:53:28 +0000 (18:53 +0400)
committereap <eap@opencascade.com>
Fri, 17 Oct 2014 14:53:28 +0000 (18:53 +0400)
doc/salome/gui/GHS3DPLUGIN/input/ghs3d_hypo.doc
src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx

index 28ed05a42faae2588eb2b11408bd69aa2927536c..8aa14701299fb387faacea312947f1a0d90a8f4b 100644 (file)
@@ -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.
 
index b368961eab0e55488e999542c2aef3dbb0946269..1f96d332336c1852ed17d35ff18b743fd34a6506 100644 (file)
@@ -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");