change precompiler if to allow for occt 8

This commit is contained in:
Sebastian Hirnschall 2025-05-10 15:52:39 +02:00
parent a9e8f2a1c9
commit 430601bbe6
4 changed files with 12 additions and 12 deletions

View File

@ -21,7 +21,7 @@
#include "meshing.hpp" #include "meshing.hpp"
#if OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=4 #if (OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=4) || OCC_VERSION_MAJOR>=8
#define OCC_HAVE_DUMP_JSON #define OCC_HAVE_DUMP_JSON
#endif #endif

View File

@ -31,7 +31,7 @@
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
#include <Transfer_FinderProcess.hxx> #include <Transfer_FinderProcess.hxx>
#if OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=4 #if (OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=4) || OCC_VERSION_MAJOR>=8
#define OCC_HAVE_HISTORY #define OCC_HAVE_HISTORY
#endif #endif

View File

@ -14,7 +14,7 @@
#pragma clang diagnostic push #pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations" #pragma clang diagnostic ignored "-Wdeprecated-declarations"
#if OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=6 #if (OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=6) || OCC_VERSION_MAJOR>=8
#include <BinTools_ShapeWriter.hxx> #include <BinTools_ShapeWriter.hxx>
#endif // OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=4 #endif // OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=4
#include <BOPAlgo_Builder.hxx> #include <BOPAlgo_Builder.hxx>
@ -856,7 +856,7 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
{ {
if(binary) if(binary)
{ {
#if OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=6 #if (OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=6) || OCC_VERSION_MAJOR>=8
BinTools_FormatVersion v = version ? BinTools_FormatVersion(*version) : BinTools_FormatVersion_CURRENT; BinTools_FormatVersion v = version ? BinTools_FormatVersion(*version) : BinTools_FormatVersion_CURRENT;
BinTools::Write(shape, filename.c_str(), withTriangles, withNormals, v); BinTools::Write(shape, filename.c_str(), withTriangles, withNormals, v);
# else // OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=6 # else // OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=6
@ -865,7 +865,7 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
} }
else else
{ {
#if OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=6 #if (OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=6) || OCC_VERSION_MAJOR>=8
TopTools_FormatVersion v = version ? (TopTools_FormatVersion)(*version) : TopTools_FormatVersion_CURRENT; TopTools_FormatVersion v = version ? (TopTools_FormatVersion)(*version) : TopTools_FormatVersion_CURRENT;
BRepTools::Write(shape, filename.c_str(), withTriangles, withNormals, v); BRepTools::Write(shape, filename.c_str(), withTriangles, withNormals, v);
#else // OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=6 #else // OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=6
@ -1191,7 +1191,7 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
}, py::arg("edges"), py::arg("r"), "make fillets for edges 'edges' of radius 'r'") }, py::arg("edges"), py::arg("r"), "make fillets for edges 'edges' of radius 'r'")
.def("MakeChamfer", [](const TopoDS_Shape & shape, std::vector<TopoDS_Shape> edges, double d) { .def("MakeChamfer", [](const TopoDS_Shape & shape, std::vector<TopoDS_Shape> edges, double d) {
#if OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=4 #if (OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=4) || OCC_VERSION_MAJOR>=8
BRepFilletAPI_MakeChamfer mkChamfer(shape); BRepFilletAPI_MakeChamfer mkChamfer(shape);
for (auto e : edges) for (auto e : edges)
mkChamfer.Add (d, TopoDS::Edge(e)); mkChamfer.Add (d, TopoDS::Edge(e));
@ -2526,7 +2526,7 @@ tangents : Dict[int, gp_Vec]
points.SetValue(i+1, j+1, gp_Pnt(pnts_unchecked(i, j, 0), pnts_unchecked(i, j, 1), pnts_unchecked(i, j, 2))); points.SetValue(i+1, j+1, gp_Pnt(pnts_unchecked(i, j, 0), pnts_unchecked(i, j, 1), pnts_unchecked(i, j, 2)));
GeomAPI_PointsToBSplineSurface builder; GeomAPI_PointsToBSplineSurface builder;
#if OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=4 #if (OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=4) || OCC_VERSION_MAJOR>=8
builder.Init(points, approx_type, deg_min, deg_max, continuity, tol, periodic); builder.Init(points, approx_type, deg_min, deg_max, continuity, tol, periodic);
#else #else
if(periodic) if(periodic)
@ -2596,7 +2596,7 @@ degen_tol : double
points.SetValue(i+1, j+1, gp_Pnt(pnts_unchecked(i, j, 0), pnts_unchecked(i, j, 1), pnts_unchecked(i, j, 2))); points.SetValue(i+1, j+1, gp_Pnt(pnts_unchecked(i, j, 0), pnts_unchecked(i, j, 1), pnts_unchecked(i, j, 2)));
GeomAPI_PointsToBSplineSurface builder; GeomAPI_PointsToBSplineSurface builder;
#if OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=4 #if (OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=4) || OCC_VERSION_MAJOR>=8
builder.Interpolate(points, approx_type, periodic); builder.Interpolate(points, approx_type, periodic);
#else #else
if(periodic) if(periodic)

View File

@ -464,7 +464,7 @@ namespace netgen
for (int j = 1; j <= nbnodes; j++) for (int j = 1; j <= nbnodes; j++)
{ {
/* /*
#if OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=5 #if (OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=5) || OCC_VERSION_MAJOR>=8
gp_Pnt p = T -> Node(aEdgePoly->Nodes()(j)).Transformed(aEdgeLoc); gp_Pnt p = T -> Node(aEdgePoly->Nodes()(j)).Transformed(aEdgeLoc);
#else #else
gp_Pnt p = T -> Nodes()(aEdgePoly->Nodes()(j)).Transformed(aEdgeLoc); gp_Pnt p = T -> Nodes()(aEdgePoly->Nodes()(j)).Transformed(aEdgeLoc);
@ -518,7 +518,7 @@ namespace netgen
for (int j = 1; j <= nbnodes; j++) for (int j = 1; j <= nbnodes; j++)
{ {
/* /*
#if OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=5 #if (OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=5) || OCC_VERSION_MAJOR>=8
gp_Pnt p = T -> Node(aEdgePoly->Node(j)).Transformed(aEdgeLoc); gp_Pnt p = T -> Node(aEdgePoly->Node(j)).Transformed(aEdgeLoc);
#else #else
gp_Pnt p = (T -> Nodes())(aEdgePoly->Nodes()(j)).Transformed(aEdgeLoc); gp_Pnt p = (T -> Nodes())(aEdgePoly->Nodes()(j)).Transformed(aEdgeLoc);
@ -584,7 +584,7 @@ namespace netgen
for (int j = 1; j <= ntriangles; j++) for (int j = 1; j <= ntriangles; j++)
{ {
/* /*
#if OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=5 #if (OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=5) || OCC_VERSION_MAJOR>=8
Poly_Triangle triangle = triangulation -> Triangle(j); Poly_Triangle triangle = triangulation -> Triangle(j);
#else #else
Poly_Triangle triangle = triangulation -> Triangles()(j); Poly_Triangle triangle = triangulation -> Triangles()(j);
@ -598,7 +598,7 @@ namespace netgen
for (int k = 1; k <= 3; k++) for (int k = 1; k <= 3; k++)
{ {
#if OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=5 #if (OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=5) || OCC_VERSION_MAJOR>=8
uv = triangulation -> UVNode(triangle(k)); uv = triangulation -> UVNode(triangle(k));
#else #else
uv = triangulation -> UVNodes()(triangle(k)); uv = triangulation -> UVNodes()(triangle(k));