Salome HOME
23418: [OCC] Mesh: Minimization of memory usage of SMESH
[modules/smesh.git] / src / SMESH_I / SMESH_Measurements_i.cxx
index ca0103c016e6cb9994a8eb21f1d0ef7c35dcb8cf..2fcac5a7f9122551b4efb276f0f3c77fd0daf3a0 100644 (file)
@@ -255,16 +255,13 @@ static void enlargeBoundingBox(const SMESH::SMESH_IDSource_ptr theObject,
       enlargeBoundingBox( aMesh->FindNode( aElementsId[i] ), theMeasure);
     else
     {
-      const SMDS_MeshElement* elem = aMesh->FindElement( aElementsId[i] );
-      if (!elem)
-        continue;
-      SMDS_ElemIteratorPtr aNodeIter = elem->nodesIterator();
-      while( aNodeIter->more() )
-        enlargeBoundingBox( dynamic_cast<const SMDS_MeshNode*>( aNodeIter->next() ), theMeasure);
+      if ( const SMDS_MeshElement* elem = aMesh->FindElement( aElementsId[i] ))
+        for (SMDS_NodeIteratorPtr aNodeIter = elem->nodeIterator(); aNodeIter->more(); )
+          enlargeBoundingBox( aNodeIter->next(), theMeasure);
     }
   }
 }
-                               
+
 //=======================================================================
 // name    : BoundingBox
 // Purpose : compute common bounding box of entities