Salome HOME
23418: [OCC] Mesh: Minimization of memory usage of SMESH
[modules/smesh.git] / src / StdMeshers / StdMeshers_Penta_3D.cxx
index 0223a7a074cb9b2852fb11bc345510b3fbb8cc21..f22b5fe67dad5aa45ba2e2d67c9aeecbb56192a1 100644 (file)
@@ -234,8 +234,7 @@ void StdMeshers_Penta_3D::MakeNodes()
       aTNode.SetBaseNodeID(aNodeID);
       //
       if ( SMESH_Block::IsEdgeID (aSID)) {
-        const SMDS_EdgePosition* epos =
-          static_cast<const SMDS_EdgePosition*>(aNode->GetPosition());
+        SMDS_EdgePositionPtr epos = aNode->GetPosition();
         myBlock.ComputeParameters( epos->GetUParameter(), aS, aCoords );
       }
       else {
@@ -1465,11 +1464,9 @@ bool StdMeshers_Penta_3D::LoadIJNodes(StdMeshers_IJNodeMap & theIJNodes,
     node = nIt->next();
     if(myTool->IsMedium(node))
       continue;
-    const SMDS_EdgePosition* pos =
-      dynamic_cast<const SMDS_EdgePosition*>( node->GetPosition() );
-    if ( !pos ) {
+    SMDS_EdgePositionPtr pos = node->GetPosition();
+    if ( !pos )
       return false;
-    }
     double u = ( pos->GetUParameter() - f ) / range;
     vector<const SMDS_MeshNode*> & nVec = theIJNodes[ u ];
     nVec.resize( vsize, nullNode );
@@ -1488,11 +1485,9 @@ bool StdMeshers_Penta_3D::LoadIJNodes(StdMeshers_IJNodeMap & theIJNodes,
     node = nIt->next();
     if(myTool->IsMedium(node))
       continue;
-    const SMDS_EdgePosition* pos =
-      dynamic_cast<const SMDS_EdgePosition*>( node->GetPosition() );
-    if ( !pos ) {
+    SMDS_EdgePositionPtr pos = node->GetPosition();
+    if ( !pos )
       return false;
-    }
     sortedNodes.insert( make_pair( pos->GetUParameter(), node ));
   }
   loadedNodes.insert( nVecf[ vsize - 1 ] = smVft->GetNodes()->next() );