Salome HOME
Merging with WPdev
[modules/smesh.git] / src / SMESHFiltersSelection / SMESH_NumberFilter.cxx
index 929401562be1628b5b463a4e8dc90124c87e85e4..61162a581681c69ff04e618e2371d289cfe132d0 100644 (file)
@@ -176,24 +176,26 @@ GEOM::GEOM_Object_ptr SMESH_NumberFilter::getGeom
     return anObj._retn();
 
   // Get geom object corresponding to the mesh
-  _PTR(ChildIterator) anIter = study->NewChildIterator(aSO);
-  for (; anIter->More(); anIter->Next()) {
-    _PTR(SObject) aSO = anIter->Value();
-    if (!aSO)
-      continue;
-    _PTR(SObject) aRefSO;
-    _PTR(SObject) anObj;
-    if (aSO->ReferencedObject(aRefSO))
-      anObj = aRefSO;
-
-    if (!anObj)
-      anObj = aSO;
-
-    anObject = _CAST(SObject,anObj)->GetObject();
-    GEOM::GEOM_Object_var aMeshShape = GEOM::GEOM_Object::_narrow(anObject);
-
-    if (!aMeshShape->_is_nil())
-      return aMeshShape._retn();
+  if ( myKind == "SMESH" ) {
+    _PTR(ChildIterator) anIter = study->NewChildIterator(aSO);
+    for (; anIter->More(); anIter->Next()) {
+      _PTR(SObject) aSO = anIter->Value();
+      if (!aSO)
+        continue;
+      _PTR(SObject) aRefSO;
+      _PTR(SObject) anObj;
+      if (aSO->ReferencedObject(aRefSO))
+        anObj = aRefSO;
+
+      if (!anObj)
+        anObj = aSO;
+
+      anObject = _CAST(SObject,anObj)->GetObject();
+      GEOM::GEOM_Object_var aMeshShape = GEOM::GEOM_Object::_narrow(anObject);
+
+      if (!aMeshShape->_is_nil())
+        return aMeshShape._retn();
+    }
   }
 
   return GEOM::GEOM_Object::_nil();