Salome HOME
23418: [OCC] Mesh: Minimization of memory usage of SMESH
[modules/smesh.git] / src / SMESH / SMESH_Pattern.cxx
index b307ba31c334759c7869b2b73ec0beb83d7c857a..f032ae475df0b522a7bfba9215e39cd17377f41b 100644 (file)
@@ -801,8 +801,7 @@ bool SMESH_Pattern::Load (SMESH_Mesh*        theMesh,
             ++nbMeduimNodes;
             continue;
           }
-          const SMDS_EdgePosition* epos =
-            static_cast<const SMDS_EdgePosition*>(node->GetPosition());
+          SMDS_EdgePositionPtr epos = node->GetPosition();
           double u = epos->GetUParameter();
           paramNodeMap.insert( make_pair( u, node ));
         }
@@ -929,8 +928,7 @@ bool SMESH_Pattern::Load (SMESH_Mesh*        theMesh,
         if ( theProject || edgesUVBox.IsOut( p->myInitUV ) )
           p->myInitUV = project( node, projector );
         else {
-          const SMDS_FacePosition* pos =
-            static_cast<const SMDS_FacePosition*>(node->GetPosition());
+          SMDS_FacePositionPtr pos = node->GetPosition();
           p->myInitUV.SetCoord( pos->GetUParameter(), pos->GetVParameter() );
         }
         p->myInitXYZ.SetCoord( p->myInitUV.X(), p->myInitUV.Y(), 0 );
@@ -3288,8 +3286,7 @@ bool SMESH_Pattern::Load (SMESH_Mesh*         theMesh,
         const SMDS_MeshNode* node = nIt->next();
         if ( isQuadMesh && SMESH_MeshEditor::IsMedium( node, SMDSAbs_Edge ))
           continue;
-        const SMDS_EdgePosition* epos =
-          static_cast<const SMDS_EdgePosition*>(node->GetPosition());
+        SMDS_EdgePositionPtr epos = node->GetPosition();
         double u = ( epos->GetUParameter() - f ) / ( l - f );
         (*pIt)->myInitXYZ.SetCoord( iCoord, isForward ? u : 1 - u );
       }
@@ -4172,7 +4169,8 @@ bool SMESH_Pattern::MakeMesh(SMESH_Mesh* theMesh,
     createElements( theMesh, nodesVector, myElemPointIDs, myElements );
   }
 
-  aMeshDS->compactMesh();
+  aMeshDS->Modified();
+  aMeshDS->CompactMesh();
 
   if ( myToKeepNodes )
     myOutNodes.swap( nodesVector );