From: vsr Date: Wed, 15 Jan 2014 10:16:32 +0000 (+0000) Subject: Update patch for Netgen (issue 0022357) X-Git-Tag: V7_4_0~19 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e5b4649610023b5114b4bc32af0b487ae50d8662;p=tools%2Finstall.git Update patch for Netgen (issue 0022357) --- diff --git a/config_files/patches/netgen-4.9.13-for-SALOME.patch b/config_files/patches/netgen-4.9.13-for-SALOME.patch index 0be0d34..0d3f344 100755 --- a/config_files/patches/netgen-4.9.13-for-SALOME.patch +++ b/config_files/patches/netgen-4.9.13-for-SALOME.patch @@ -1,6 +1,6 @@ diff -Naur netgen-4.9.13_orig/libsrc/meshing/meshtype.cpp netgen-4.9.13_new/libsrc/meshing/meshtype.cpp --- netgen-4.9.13_orig/libsrc/meshing/meshtype.cpp 2009-09-13 14:28:38.000000000 +0400 -+++ netgen-4.9.13_new/libsrc/meshing/meshtype.cpp 2011-12-20 14:50:26.000000000 +0400 ++++ netgen-4.9.13_new/libsrc/meshing/meshtype.cpp 2014-01-15 13:59:16.000000000 +0400 @@ -1,4 +1,5 @@ #include +#include // to get DBL_MIN defined @@ -101,7 +101,7 @@ diff -Naur netgen-4.9.13_orig/libsrc/meshing/meshtype.cpp netgen-4.9.13_new/libs blockfill = 1; diff -Naur netgen-4.9.13_orig/libsrc/meshing/meshtype.hpp netgen-4.9.13_new/libsrc/meshing/meshtype.hpp --- netgen-4.9.13_orig/libsrc/meshing/meshtype.hpp 2009-11-09 13:50:43.000000000 +0300 -+++ netgen-4.9.13_new/libsrc/meshing/meshtype.hpp 2011-12-20 14:50:26.000000000 +0400 ++++ netgen-4.9.13_new/libsrc/meshing/meshtype.hpp 2014-01-15 13:59:16.000000000 +0400 @@ -12,6 +12,7 @@ Classes for NETGEN */ @@ -112,7 +112,7 @@ diff -Naur netgen-4.9.13_orig/libsrc/meshing/meshtype.hpp netgen-4.9.13_new/libs SEGMENT = 1, SEGMENT3 = 2, diff -Naur netgen-4.9.13_orig/libsrc/meshing/smoothing2.cpp netgen-4.9.13_new/libsrc/meshing/smoothing2.cpp --- netgen-4.9.13_orig/libsrc/meshing/smoothing2.cpp 2009-11-09 13:47:09.000000000 +0300 -+++ netgen-4.9.13_new/libsrc/meshing/smoothing2.cpp 2011-12-20 14:50:26.000000000 +0400 ++++ netgen-4.9.13_new/libsrc/meshing/smoothing2.cpp 2014-01-15 13:59:16.000000000 +0400 @@ -302,7 +302,8 @@ vgrad = 0; badness = 0; @@ -162,9 +162,130 @@ diff -Naur netgen-4.9.13_orig/libsrc/meshing/smoothing2.cpp netgen-4.9.13_new/li } } +diff -Naur netgen-4.9.13_orig/libsrc/occ/Partition_Inter3d.cxx netgen-4.9.13_new/libsrc/occ/Partition_Inter3d.cxx +--- netgen-4.9.13_orig/libsrc/occ/Partition_Inter3d.cxx 2009-08-24 06:12:24.000000000 +0400 ++++ netgen-4.9.13_new/libsrc/occ/Partition_Inter3d.cxx 2014-01-15 13:59:16.000000000 +0400 +@@ -86,6 +86,9 @@ + #include + #include + #include ++ ++#include ++ + #include + + //======================================================================= +@@ -243,7 +246,12 @@ + Standard_Integer i, nbExt = anExtPS.NbExt(); + Extrema_POnSurf aPOnSurf; + for (i = 1; i <= nbExt; ++i ) ++#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060400 ++// porting to OCCT6.5.1 ++ if (anExtPS.SquareDistance( i ) <= TolE * TolE) { ++#else + if (anExtPS.Value( i ) <= TolE) { ++#endif + aPOnSurf = anExtPS.Point( i ); + break; + } +diff -Naur netgen-4.9.13_orig/libsrc/occ/Partition_Loop.cxx netgen-4.9.13_new/libsrc/occ/Partition_Loop.cxx +--- netgen-4.9.13_orig/libsrc/occ/Partition_Loop.cxx 2009-08-24 06:12:24.000000000 +0400 ++++ netgen-4.9.13_new/libsrc/occ/Partition_Loop.cxx 2014-01-15 13:59:16.000000000 +0400 +@@ -178,7 +178,7 @@ + } + } + +- Standard_Real anglemax = - PI; ++ Standard_Real anglemax = - M_PI; + TopoDS_Edge SelectedEdge; + for ( itl.Initialize(LE); itl.More(); itl.Next()) { + const TopoDS_Edge& E = TopoDS::Edge(itl.Value()); +diff -Naur netgen-4.9.13_orig/libsrc/occ/Partition_Loop2d.cxx netgen-4.9.13_new/libsrc/occ/Partition_Loop2d.cxx +--- netgen-4.9.13_orig/libsrc/occ/Partition_Loop2d.cxx 2009-08-24 06:12:24.000000000 +0400 ++++ netgen-4.9.13_new/libsrc/occ/Partition_Loop2d.cxx 2014-01-15 13:59:16.000000000 +0400 +@@ -22,7 +22,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -51,6 +50,15 @@ + #include + #include + ++#include ++ ++#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060400 ++// porting to OCCT6.5.1 ++#include ++#else ++#include ++#endif ++ + //======================================================================= + //function : Partition_Loop2d + //purpose : +@@ -209,7 +217,7 @@ + Cc->D1(uc, PC, CTg1); + if (!isForward) CTg1.Reverse(); + +- Standard_Real anglemin = 3 * PI, tolAng = 1.e-8; ++ Standard_Real anglemin = 3 * M_PI, tolAng = 1.e-8; + + // select an edge whose first derivative is most left of CTg1 + // ie an angle between Tg1 and CTg1 is least +@@ -233,7 +241,7 @@ + // -PI < angle < PI + Standard_Real angle = Tg1.Angle(CTg1); + +- if (PI - Abs(angle) <= tolAng) ++ if (M_PI - Abs(angle) <= tolAng) + { + // an angle is too close to PI; assure that an angle sign really + // reflects an edge position: +PI - an edge is worst, +@@ -519,7 +527,12 @@ + DC.Initialize( DegEdge, F ); + + // avoid intersecting twice the same edge ++#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060400 ++// porting to OCCT6.5.1 ++ TopTools_DataMapOfShapeReal EUMap ( EdgesList.Extent() ); ++#else + BRepOffset_DataMapOfShapeReal EUMap ( EdgesList.Extent() ); ++#endif + + Standard_Real U, f, l; + BRep_Tool::Range (DegEdge, f, l); +diff -Naur netgen-4.9.13_orig/libsrc/occ/Partition_Spliter.cxx netgen-4.9.13_new/libsrc/occ/Partition_Spliter.cxx +--- netgen-4.9.13_orig/libsrc/occ/Partition_Spliter.cxx 2009-08-24 06:12:24.000000000 +0400 ++++ netgen-4.9.13_new/libsrc/occ/Partition_Spliter.cxx 2014-01-15 13:59:16.000000000 +0400 +@@ -79,6 +79,8 @@ + #include + #include + ++#include ++ + #ifdef DEB + //# define PART_PERF + #endif +@@ -1169,7 +1171,12 @@ + for (; j<=nbj && ok; ++j) { + if (Extrema.IsMin(j)) { + hasMin = Standard_True; ++#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060400 ++// porting to OCCT6.5.1 ++ ok = Extrema.SquareDistance(j) <= tol * tol; ++#else + ok = Extrema.Value(j) <= tol; ++#endif + } + } + } diff -Naur netgen-4.9.13_orig/libsrc/occ/occconstruction.cpp netgen-4.9.13_new/libsrc/occ/occconstruction.cpp --- netgen-4.9.13_orig/libsrc/occ/occconstruction.cpp 2009-08-24 06:32:47.000000000 +0400 -+++ netgen-4.9.13_new/libsrc/occ/occconstruction.cpp 2011-12-20 14:50:26.000000000 +0400 ++++ netgen-4.9.13_new/libsrc/occ/occconstruction.cpp 2014-01-15 13:59:16.000000000 +0400 @@ -28,7 +28,7 @@ #include #include @@ -176,7 +297,7 @@ diff -Naur netgen-4.9.13_orig/libsrc/occ/occconstruction.cpp netgen-4.9.13_new/l #include diff -Naur netgen-4.9.13_orig/libsrc/occ/occgenmesh.cpp netgen-4.9.13_new/libsrc/occ/occgenmesh.cpp --- netgen-4.9.13_orig/libsrc/occ/occgenmesh.cpp 2010-03-16 09:30:07.000000000 +0300 -+++ netgen-4.9.13_new/libsrc/occ/occgenmesh.cpp 2011-12-20 14:50:26.000000000 +0400 ++++ netgen-4.9.13_new/libsrc/occ/occgenmesh.cpp 2014-01-15 13:59:16.000000000 +0400 @@ -15,6 +15,8 @@ #define DIVIDEEDGESECTIONS 1000 @@ -402,7 +523,38 @@ diff -Naur netgen-4.9.13_orig/libsrc/occ/occgenmesh.cpp netgen-4.9.13_new/libsrc } } -@@ -633,7 +700,8 @@ +@@ -497,17 +564,20 @@ + bool exists = 0; + int j; + for (j = first_ep; j <= mesh.GetNP(); j++) ++ { ++ if (!merge_solids && mesh.Point(j).GetLayer() != geomedgenr ) continue; // to support SALOME fuse edges + if ((mesh.Point(j)-Point<3>(mp[i-1])).Length() < eps) + { + exists = 1; + break; + } ++ } + + if (exists) + pnums[i] = j; + else + { +- mesh.AddPoint (mp[i-1]); ++ mesh.AddPoint (mp[i-1], geomedgenr); // to support SALOME fuse edges + (*testout) << "add meshpoint " << mp[i-1] << endl; + pnums[i] = mesh.GetNP(); + } +@@ -591,6 +661,8 @@ + // (*testout) << "edge " << mesh.LineSegment(i).edgenr << " face " << mesh.LineSegment(i).si + // << " p1 " << mesh.LineSegment(i)[0] << " p2 " << mesh.LineSegment(i)[1] << endl; + // exit(10); ++ for (int j = 1; j <= mesh.GetNP(); j++) // to support SALOME fuse edges: set level to zero ++ mesh.Point(j) = MeshPoint( (Point<3>&) mesh.Point(j) ); + + mesh.CalcSurfacesOfNode(); + multithread.task = savetask; +@@ -633,7 +705,8 @@ } (*testout) << "mesh face " << k << endl; @@ -412,7 +564,7 @@ diff -Naur netgen-4.9.13_orig/libsrc/occ/occgenmesh.cpp netgen-4.9.13_new/libsrc geom.facemeshstatus[k-1] = -1; -@@ -901,7 +969,8 @@ +@@ -901,7 +974,8 @@ // if (k != 36) continue; // (*testout) << "optimize face " << k << endl; @@ -422,14 +574,14 @@ diff -Naur netgen-4.9.13_orig/libsrc/occ/occgenmesh.cpp netgen-4.9.13_new/libsrc FaceDescriptor & fd = mesh.GetFaceDescriptor(k); -@@ -1456,3 +1525,4 @@ +@@ -1456,3 +1530,4 @@ } #endif + diff -Naur netgen-4.9.13_orig/libsrc/occ/occgeom.cpp netgen-4.9.13_new/libsrc/occ/occgeom.cpp --- netgen-4.9.13_orig/libsrc/occ/occgeom.cpp 2010-03-05 16:16:21.000000000 +0300 -+++ netgen-4.9.13_new/libsrc/occ/occgeom.cpp 2011-12-20 14:50:26.000000000 +0400 ++++ netgen-4.9.13_new/libsrc/occ/occgeom.cpp 2014-01-15 13:59:16.000000000 +0400 @@ -8,6 +8,8 @@ #include "ShapeAnalysis_CheckSmallFace.hxx" #include "ShapeAnalysis_DataMapOfShapeListOfReal.hxx" @@ -648,7 +800,7 @@ diff -Naur netgen-4.9.13_orig/libsrc/occ/occgeom.cpp netgen-4.9.13_new/libsrc/oc } diff -Naur netgen-4.9.13_orig/libsrc/occ/occgeom.hpp netgen-4.9.13_new/libsrc/occ/occgeom.hpp --- netgen-4.9.13_orig/libsrc/occ/occgeom.hpp 2010-01-14 19:56:19.000000000 +0300 -+++ netgen-4.9.13_new/libsrc/occ/occgeom.hpp 2011-12-20 14:50:26.000000000 +0400 ++++ netgen-4.9.13_new/libsrc/occ/occgeom.hpp 2014-01-15 13:59:16.000000000 +0400 @@ -15,8 +15,8 @@ #include "Geom_Curve.hxx" #include "Geom2d_Curve.hxx" @@ -728,7 +880,7 @@ diff -Naur netgen-4.9.13_orig/libsrc/occ/occgeom.hpp netgen-4.9.13_new/libsrc/oc cout << "OCCGeometry::GetSurface using PLANESPACE" << endl; diff -Naur netgen-4.9.13_orig/libsrc/occ/occmeshsurf.cpp netgen-4.9.13_new/libsrc/occ/occmeshsurf.cpp --- netgen-4.9.13_orig/libsrc/occ/occmeshsurf.cpp 2009-08-24 06:32:47.000000000 +0400 -+++ netgen-4.9.13_new/libsrc/occ/occmeshsurf.cpp 2011-12-20 14:50:26.000000000 +0400 ++++ netgen-4.9.13_new/libsrc/occ/occmeshsurf.cpp 2014-01-15 13:59:16.000000000 +0400 @@ -6,6 +6,7 @@ #include #include @@ -835,130 +987,9 @@ diff -Naur netgen-4.9.13_orig/libsrc/occ/occmeshsurf.cpp netgen-4.9.13_new/libsr -diff -Naur netgen-4.9.13_orig/libsrc/occ/Partition_Inter3d.cxx netgen-4.9.13_new/libsrc/occ/Partition_Inter3d.cxx ---- netgen-4.9.13_orig/libsrc/occ/Partition_Inter3d.cxx 2009-08-24 06:12:24.000000000 +0400 -+++ netgen-4.9.13_new/libsrc/occ/Partition_Inter3d.cxx 2011-12-20 14:50:26.000000000 +0400 -@@ -86,6 +86,9 @@ - #include - #include - #include -+ -+#include -+ - #include - - //======================================================================= -@@ -243,7 +246,12 @@ - Standard_Integer i, nbExt = anExtPS.NbExt(); - Extrema_POnSurf aPOnSurf; - for (i = 1; i <= nbExt; ++i ) -+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060400 -+// porting to OCCT6.5.1 -+ if (anExtPS.SquareDistance( i ) <= TolE * TolE) { -+#else - if (anExtPS.Value( i ) <= TolE) { -+#endif - aPOnSurf = anExtPS.Point( i ); - break; - } -diff -Naur netgen-4.9.13_orig/libsrc/occ/Partition_Loop2d.cxx netgen-4.9.13_new/libsrc/occ/Partition_Loop2d.cxx ---- netgen-4.9.13_orig/libsrc/occ/Partition_Loop2d.cxx 2009-08-24 06:12:24.000000000 +0400 -+++ netgen-4.9.13_new/libsrc/occ/Partition_Loop2d.cxx 2011-12-20 14:53:39.000000000 +0400 -@@ -22,7 +22,6 @@ - #include - #include - #include --#include - #include - #include - #include -@@ -51,6 +50,15 @@ - #include - #include - -+#include -+ -+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060400 -+// porting to OCCT6.5.1 -+#include -+#else -+#include -+#endif -+ - //======================================================================= - //function : Partition_Loop2d - //purpose : -@@ -209,7 +217,7 @@ - Cc->D1(uc, PC, CTg1); - if (!isForward) CTg1.Reverse(); - -- Standard_Real anglemin = 3 * PI, tolAng = 1.e-8; -+ Standard_Real anglemin = 3 * M_PI, tolAng = 1.e-8; - - // select an edge whose first derivative is most left of CTg1 - // ie an angle between Tg1 and CTg1 is least -@@ -233,7 +241,7 @@ - // -PI < angle < PI - Standard_Real angle = Tg1.Angle(CTg1); - -- if (PI - Abs(angle) <= tolAng) -+ if (M_PI - Abs(angle) <= tolAng) - { - // an angle is too close to PI; assure that an angle sign really - // reflects an edge position: +PI - an edge is worst, -@@ -519,7 +527,12 @@ - DC.Initialize( DegEdge, F ); - - // avoid intersecting twice the same edge -+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060400 -+// porting to OCCT6.5.1 -+ TopTools_DataMapOfShapeReal EUMap ( EdgesList.Extent() ); -+#else - BRepOffset_DataMapOfShapeReal EUMap ( EdgesList.Extent() ); -+#endif - - Standard_Real U, f, l; - BRep_Tool::Range (DegEdge, f, l); -diff -Naur netgen-4.9.13_orig/libsrc/occ/Partition_Loop.cxx netgen-4.9.13_new/libsrc/occ/Partition_Loop.cxx ---- netgen-4.9.13_orig/libsrc/occ/Partition_Loop.cxx 2009-08-24 06:12:24.000000000 +0400 -+++ netgen-4.9.13_new/libsrc/occ/Partition_Loop.cxx 2011-12-20 14:53:05.000000000 +0400 -@@ -178,7 +178,7 @@ - } - } - -- Standard_Real anglemax = - PI; -+ Standard_Real anglemax = - M_PI; - TopoDS_Edge SelectedEdge; - for ( itl.Initialize(LE); itl.More(); itl.Next()) { - const TopoDS_Edge& E = TopoDS::Edge(itl.Value()); -diff -Naur netgen-4.9.13_orig/libsrc/occ/Partition_Spliter.cxx netgen-4.9.13_new/libsrc/occ/Partition_Spliter.cxx ---- netgen-4.9.13_orig/libsrc/occ/Partition_Spliter.cxx 2009-08-24 06:12:24.000000000 +0400 -+++ netgen-4.9.13_new/libsrc/occ/Partition_Spliter.cxx 2011-12-20 14:50:26.000000000 +0400 -@@ -79,6 +79,8 @@ - #include - #include - -+#include -+ - #ifdef DEB - //# define PART_PERF - #endif -@@ -1169,7 +1171,12 @@ - for (; j<=nbj && ok; ++j) { - if (Extrema.IsMin(j)) { - hasMin = Standard_True; -+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060400 -+// porting to OCCT6.5.1 -+ ok = Extrema.SquareDistance(j) <= tol * tol; -+#else - ok = Extrema.Value(j) <= tol; -+#endif - } - } - } diff -Naur netgen-4.9.13_orig/libsrc/occ/utilities.h netgen-4.9.13_new/libsrc/occ/utilities.h --- netgen-4.9.13_orig/libsrc/occ/utilities.h 2009-08-24 06:12:24.000000000 +0400 -+++ netgen-4.9.13_new/libsrc/occ/utilities.h 2011-12-20 14:50:26.000000000 +0400 ++++ netgen-4.9.13_new/libsrc/occ/utilities.h 2014-01-15 13:59:16.000000000 +0400 @@ -33,6 +33,7 @@ #include @@ -969,7 +1000,7 @@ diff -Naur netgen-4.9.13_orig/libsrc/occ/utilities.h netgen-4.9.13_new/libsrc/oc diff -Naur netgen-4.9.13_orig/libsrc/stlgeom/stlgeommesh.cpp netgen-4.9.13_new/libsrc/stlgeom/stlgeommesh.cpp --- netgen-4.9.13_orig/libsrc/stlgeom/stlgeommesh.cpp 2009-08-10 15:40:51.000000000 +0400 -+++ netgen-4.9.13_new/libsrc/stlgeom/stlgeommesh.cpp 2011-12-20 14:50:26.000000000 +0400 ++++ netgen-4.9.13_new/libsrc/stlgeom/stlgeommesh.cpp 2014-01-15 13:59:16.000000000 +0400 @@ -1435,7 +1435,8 @@ if (!optstring || strlen(optstring) == 0) @@ -1002,7 +1033,7 @@ diff -Naur netgen-4.9.13_orig/libsrc/stlgeom/stlgeommesh.cpp netgen-4.9.13_new/l { diff -Naur netgen-4.9.13_orig/nglib/nglib.h netgen-4.9.13_new/nglib/nglib.h --- netgen-4.9.13_orig/nglib/nglib.h 2010-05-18 15:20:25.000000000 +0400 -+++ netgen-4.9.13_new/nglib/nglib.h 2011-12-20 14:50:26.000000000 +0400 ++++ netgen-4.9.13_new/nglib/nglib.h 2014-01-15 13:59:16.000000000 +0400 @@ -24,7 +24,7 @@ // Philippose - 14.02.2009 // Modifications for creating a DLL in Windows