Salome HOME
23418: [OCC] Mesh: Minimization of memory usage of SMESH V8_5_0b1
authoreap <eap@opencascade.com>
Fri, 22 Dec 2017 11:18:34 +0000 (14:18 +0300)
committereap <eap@opencascade.com>
Thu, 5 Apr 2018 14:23:43 +0000 (17:23 +0300)
src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx

index 405ef09fb2d542ccabe8b5f1e04e46ff6ff7167c..1f7e0eade0e316b7dd7a033c4f88ffdeaa764e12 100644 (file)
@@ -1484,12 +1484,8 @@ namespace
     bool operator()( const SMDS_MeshNode* n1, const SMDS_MeshNode* n2 ) const
     {
       // NEW ORDER: nodes earlier added to sub-mesh are considered "less"
-      return n1->getIdInShape() < n2->getIdInShape();
-      // SMDS_TypeOfPosition pos1 = n1->GetPosition()->GetTypeOfPosition();
-      // SMDS_TypeOfPosition pos2 = n2->GetPosition()->GetTypeOfPosition();
-      // if ( pos1 == pos2 ) return 0;
-      // if ( pos1 < pos2 || pos1 == SMDS_TOP_3DSPACE ) return 1;
-      // return -1;
+      //return n1->getIdInShape() < n2->getIdInShape();
+      return n1->GetID() < n2->GetID(); // earlier created nodes have less IDs
     }
     // sort sub-meshes in order: EDGE, VERTEX
     bool operator()( const SMESHDS_SubMesh* s1, const SMESHDS_SubMesh* s2 ) const
@@ -1525,11 +1521,10 @@ namespace
     }
     case TopAbs_EDGE: {
       std::multimap< double, const SMDS_MeshNode* > u2node;
-      const SMDS_EdgePosition* ePos;
       while ( nIt->more() )
       {
         const SMDS_MeshNode* n = nIt->next();
-        if (( ePos = dynamic_cast< const SMDS_EdgePosition* >( n->GetPosition() )))
+        if ( SMDS_EdgePositionPtr ePos = n->GetPosition() )
           u2node.insert( make_pair( ePos->GetUParameter(), n ));
       }
       if ( u2node.size() < 2 ) return;
@@ -1776,7 +1771,7 @@ namespace
       const SMDS_MeshNode* nodes[27];
       const SMDS_MeshNode* nullNode = 0;
       double xyz[3];
-      SMDS_FaceIteratorPtr fIt = GetMeshDS()->facesIterator(/*idInceasingOrder=*/true);
+      SMDS_FaceIteratorPtr fIt = GetMeshDS()->facesIterator();
       while ( fIt->more() )
       {
         const SMDS_MeshElement* f = fIt->next();
@@ -2945,7 +2940,7 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHelpe
   // set node coordinates
   if ( meshDS->NbNodes() != meshDS->MaxNodeID() )
   {
-    meshDS->compactMesh();
+    meshDS->CompactMesh();
   }
   SMESH_NodeXYZ nXYZ;
   nodeIt = meshDS->nodesIterator();