Salome HOME
#BOS 37851: cast tuple types for compilation on FD38
[plugins/netgenplugin.git] / src / NETGENPlugin / NETGENPlugin_NETGEN_3D.cxx
index d4712aaa56a84c209657f44d1069958ae0a8b56d..d5eb93eb06261c5475c78cca83056a14bff4ee98 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2022  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023  CEA, EDF, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -218,7 +218,7 @@ bool NETGENPlugin_NETGEN_3D::getSurfaceElements(
     SMESH_ProxyMesh::Ptr proxyMesh,
     NETGENPlugin_Internals &internals,
     SMESH_MesherHelper &helper,
-    std::map<const SMDS_MeshElement*, tuple<bool, bool>>& listElements
+    std::map<const SMDS_MeshElement*, tuple<bool, bool>, TIDCompare>& listElements
 )
 {
   SMESHDS_Mesh* meshDS = aMesh.GetMeshDS();
@@ -259,7 +259,7 @@ bool NETGENPlugin_NETGEN_3D::getSurfaceElements(
       if ( elem->NbCornerNodes() != 3 ){
         return error( COMPERR_BAD_INPUT_MESH, "Not triangle element encounters");
       }
-      listElements[elem] = tuple(isRev, isInternalFace);
+      listElements[elem] = tuple<bool, bool>(isRev, isInternalFace);
     }
   }
 
@@ -309,6 +309,8 @@ bool NETGENPlugin_NETGEN_3D::computeFillNgMesh(
     SMESH::Controls::TSequenceOfXYZ nodesCoords;
 
     // maps nodes to ng ID
+    // map must be sorted by ID to ensure that we will have the same number of
+    // 3D element if we recompute
     typedef map< const SMDS_MeshNode*, int, TIDCompare > TNodeToIDMap;
     typedef TNodeToIDMap::value_type                     TN2ID;
     TNodeToIDMap nodeToNetgenID;
@@ -338,7 +340,9 @@ bool NETGENPlugin_NETGEN_3D::computeFillNgMesh(
       proxyMesh.reset( Adaptor );
     }
 
-    std::map<const SMDS_MeshElement*, tuple<bool, bool>> listElements;
+    // map must be sorted by ID to ensure that we will have the same number of
+    // 3D element if we recompute
+    std::map<const SMDS_MeshElement*, tuple<bool, bool>, TIDCompare> listElements;
     bool ret = getSurfaceElements(aMesh, aShape, proxyMesh, internals, helper, listElements);
     if(ret)
       return ret;