summaryrefslogtreecommitdiff
path: root/media-gfx/freecad/files/freecad-0.20.2-Netgen-add-headers-to-support-recent-Netgen.patch
blob: 402c84ee4d285e44b0001e116c99a5c4da6f84f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
https://github.com/FreeCAD/FreeCAD/commit/8b056f156fd087b3df36a5223fc5ca6900649a83

From 8b056f156fd087b3df36a5223fc5ca6900649a83 Mon Sep 17 00:00:00 2001
From: Uwe <donovaly@users.noreply.github.com>
Date: Wed, 17 Aug 2022 12:32:02 +0200
Subject: [PATCH 0008/1678] [Netgen] add headers to support recent Netgen

- as reported here: https://forum.freecadweb.org/viewtopic.php?p=618174#p618174
- also fix compiler warnings about unsafe bool handling
--- a/src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_Mesher.cpp
+++ b/src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_Mesher.cpp
@@ -50,7 +50,9 @@
 
 #include <utilities.h>
 
+#include <BRepBndLib.hxx>
 #include <BRepBuilderAPI_Copy.hxx>
+#include <BRepMesh_IncrementalMesh.hxx>
 #include <BRep_Tool.hxx>
 #include <Bnd_B3d.hxx>
 #include <NCollection_Map.hxx>
@@ -66,6 +68,7 @@
 #include <TopTools_DataMapOfShapeShape.hxx>
 #include <TopTools_MapOfShape.hxx>
 #include <TopoDS.hxx>
+#include <TopoDS_Solid.hxx>
 
 #ifdef _MSC_VER
 #pragma warning(disable : 4067)
@@ -3027,7 +3030,7 @@ bool NETGENPlugin_Mesher::Compute()
         }
       }
     }
-    if (!err && mparams.secondorder > 0)
+    if (!err && mparams.secondorder)
     {
       try
       {
@@ -3302,7 +3305,7 @@ bool NETGENPlugin_Mesher::Evaluate(MapShapeNbElems& aResMap)
   // calculate total nb of segments and length of edges
   double fullLen = 0.0;
   int fullNbSeg = 0;
-  int entity = mparams.secondorder > 0 ? SMDSEntity_Quad_Edge : SMDSEntity_Edge;
+  int entity = mparams.secondorder ? SMDSEntity_Quad_Edge : SMDSEntity_Edge;
   TopTools_DataMapOfShapeInteger Edge2NbSeg;
   for (TopExp_Explorer exp(_shape, TopAbs_EDGE); exp.More(); exp.Next())
   {
@@ -3340,7 +3343,7 @@ bool NETGENPlugin_Mesher::Evaluate(MapShapeNbElems& aResMap)
   {
     vector<int>& aVec = aResMap[_mesh->GetSubMesh(Edge2NbSegIt.Key())];
     if ( aVec[ entity ] > 1 && aVec[ SMDSEntity_Node ] == 0 )
-      aVec[SMDSEntity_Node] = mparams.secondorder > 0  ? 2*aVec[ entity ]-1 : aVec[ entity ]-1;
+      aVec[SMDSEntity_Node] = mparams.secondorder ? 2*aVec[ entity ]-1 : aVec[ entity ]-1;
 
     fullNbSeg += aVec[ entity ];
     Edge2NbSeg( Edge2NbSegIt.Key() ) = aVec[ entity ];
@@ -3386,7 +3389,7 @@ bool NETGENPlugin_Mesher::Evaluate(MapShapeNbElems& aResMap)
     int nbNodes = tooManyElems ? hugeNb : (( nbFaces*3 - (nb1d-1)*2 ) / 6 + 1 );
 
     vector<int> aVec(SMDSEntity_Last, 0);
-    if( mparams.secondorder > 0 ) {
+    if (mparams.secondorder) {
       int nb1d_in = (nbFaces*3 - nb1d) / 2;
       aVec[SMDSEntity_Node] = nbNodes + nb1d_in;
       aVec[SMDSEntity_Quad_Triangle] = nbFaces;
@@ -3428,11 +3431,11 @@ bool NETGENPlugin_Mesher::Evaluate(MapShapeNbElems& aResMap)
     if ( tooManyElems ) // avoid FPE
     {
       aVec[SMDSEntity_Node] = hugeNb;
-      aVec[ mparams.secondorder > 0 ? SMDSEntity_Quad_Tetra : SMDSEntity_Tetra] = hugeNb;
+      aVec[ mparams.secondorder ? SMDSEntity_Quad_Tetra : SMDSEntity_Tetra] = hugeNb;
     }
     else
     {
-      if( mparams.secondorder > 0 ) {
+      if (mparams.secondorder) {
         aVec[SMDSEntity_Node] = nb1d_in/3 + 1 + nb1d_in;
         aVec[SMDSEntity_Quad_Tetra] = nbVols;
       }
--- a/src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cpp
+++ b/src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cpp
@@ -39,6 +39,8 @@
 #include <StdMeshers_MaxElementArea.hxx>
 #include <StdMeshers_QuadranglePreference.hxx>
 #include <StdMeshers_ViscousLayers2D.hxx>
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
 
 #include <Precision.hxx>
 #include <Standard_ErrorHandler.hxx>
-- 
2.39.1