]> SALOME platform Git repositories - tools/sat_salome.git/commitdiff
Salome HOME
Porting netgen 5.3 to OCCT 770
authorasozinov <alexey.sozinov@opencascade.com>
Thu, 13 Apr 2023 14:37:08 +0000 (15:37 +0100)
committerasozinov <alexey.sozinov@opencascade.com>
Thu, 13 Apr 2023 14:37:22 +0000 (15:37 +0100)
products/netgen.pyconf
products/patches/netgen5.3_withOCCT770.patch [new file with mode: 0644]

index 05e01d166e7a9918306d19c81421041c0a477fff..a9535f3b63a6d86b2a74d24147d1f3c1662bf7eb 100644 (file)
@@ -24,6 +24,25 @@ default_win:
    depend : ['CAS','zlib','tcltk']
 }
 
+version_6_2_2204 :
+{
+   build_source : "cmake"
+   cmake_options : " -DUSE_GUI=OFF -DUSE_PYTHON=OFF -DUSE_MPI=OFF -DUSE_OCC=ON -DUSE_INTERNAL_TCL=OFF -DBUILD_STUB_FILES=OFF -DOCC_INCLUDE_DIR=$CAS_ROOT_DIR/include/opencascade -DOCC_LIBRARY_DIR=$CAS_ROOT_DIR/lib -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_CXX_STANDARD=17  -DUSE_NATIVE_ARCH=OFF "
+   patches : ['netgen-6.2.2204-for-SALOME.patch', 'netgen-6.2.2204-for-SALOME-OCC_find.patch']
+}
+
+version_6_2_2204_win :
+{
+   build_source : "cmake"
+   cmake_options : " -DUSE_GUI=OFF -DUSE_PYTHON=OFF -DUSE_MPI=OFF -DUSE_OCC=ON -DOCC_INCLUDE_DIR=D:/S/SALOME/W64/CAS/inc -DOCC_LIBRARY_DIR=D:/S/SALOME/W64/CAS/win64/vc14/lib  -DUSE_INTERNAL_TCL=OFF -DBUILD_STUB_FILES=OFF -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_CXX_STANDARD=17  -DUSE_NATIVE_ARCH=OFF "
+   patches : ['netgen-6.2.2204-for-SALOME_windows.patch', 'netgen-6.2.2204-for-SALOME-OCC_find.patch']
+   properties :
+   {
+     incremental : "yes"
+     single_install_dir : "yes"
+   }
+}
+
 version_6_2_2101 :
 {
    build_source : "cmake"
@@ -62,7 +81,7 @@ version_5_3_1_with_CAS_7_2 :
 version_5_3_1_with_CAS_7_2_win :
 {
    compil_script :  'netgen.bat'
-   patches :  ['netgen53ForSalomeOCCT730.patch','netgen53ForWindows.patch','netgen53ForSalomeVisualStudio2017.patch']
+   patches :  ['netgen53ForSalomeOCCT730.patch','netgen53ForWindows.patch','netgen53ForSalomeVisualStudio2017.patch','netgen5.3_withOCCT770.patch']
    properties :
    {
      incremental : "yes"
@@ -74,7 +93,7 @@ version_5_3_1 :
 {
     compil_script :  "netgen_5_3_1.sh"
     archive_info: {archive_name : "netgen-5.3.1.tar.gz"}
-    patches : [ "netgen53ForSalome.patch"]
+    patches : [ "netgen53ForSalome.patch",'netgen5.3_withOCCT770.patch']
 }
 
 version_4_9_13 :
diff --git a/products/patches/netgen5.3_withOCCT770.patch b/products/patches/netgen5.3_withOCCT770.patch
new file mode 100644 (file)
index 0000000..6ca244f
--- /dev/null
@@ -0,0 +1,36 @@
+diff --git "a/libsrc/occ/occgenmesh.cpp" "b/libsrc/occ/occgenmesh.cpp"
+index 1e0127f..a385c87 100644
+--- "a/libsrc/occ/occgenmesh.cpp"
++++ "b/libsrc/occ/occgenmesh.cpp"
+@@ -4,6 +4,7 @@
+ #include <occgeom.hpp>
+ #include <meshing.hpp>
++#include <Standard_Version.hxx>
+ namespace netgen
+ {
+@@ -1240,13 +1241,18 @@ namespace netgen
+                gp_Pnt p[3];
+                gp_Pnt2d par[3];
+-               for (int k = 1; k <=3; k++)
++               for (int k = 1; k <= 3; k++)
+                {
+-                  int n = triangulation->Triangles()(j)(k);
+-                  p[k-1] = triangulation->Nodes()(n).Transformed(loc);
+-                  par[k-1] = triangulation->UVNodes()(n);
++#if OCC_VERSION_MAJOR >= 7 && OCC_VERSION_MINOR > 5
++                 int n = triangulation->Triangle(j)(k);
++                 p[k - 1] = triangulation->Node(n).Transformed(loc);
++                 par[k - 1] = triangulation->UVNode(n);
++#else
++                 int n = triangulation->Triangles()(j)(k);
++                 p[k - 1] = triangulation->Nodes()(n).Transformed(loc);
++                 par[k - 1] = triangulation->UVNodes()(n);
++#endif
+                }
+-
+                //double maxside = 0;
+                //maxside = max (maxside, p[0].Distance(p[1]));
+                //maxside = max (maxside, p[0].Distance(p[2]));