From 08993ae5e2b687e6c21d045b0a9a3f7e8722f17d Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Tue, 31 Aug 2021 00:37:41 +0200 Subject: [PATCH] fixes for OCCT 7.6.0-dev --- libsrc/occ/occgenmesh.cpp | 10 +++++++--- libsrc/occ/python_occ_shapes.cpp | 21 ++++++++++----------- libsrc/occ/vsocc.cpp | 22 ++++++++++++---------- 3 files changed, 29 insertions(+), 24 deletions(-) diff --git a/libsrc/occ/occgenmesh.cpp b/libsrc/occ/occgenmesh.cpp index ef5e969a..0e86714a 100644 --- a/libsrc/occ/occgenmesh.cpp +++ b/libsrc/occ/occgenmesh.cpp @@ -1236,9 +1236,13 @@ namespace netgen 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); + // int n = triangulation->Triangles()(j)(k); + // p[k-1] = triangulation->Nodes()(n).Transformed(loc); + // par[k-1] = triangulation->UVNodes()(n); + // fix for OCC7.6.0-dev + int n = triangulation->Triangle(j)(k); + p[k-1] = triangulation->Node(n).Transformed(loc); + par[k-1] = triangulation->UVNode(n); } //double maxside = 0; diff --git a/libsrc/occ/python_occ_shapes.cpp b/libsrc/occ/python_occ_shapes.cpp index ddcd75f2..f589400d 100644 --- a/libsrc/occ/python_occ_shapes.cpp +++ b/libsrc/occ/python_occ_shapes.cpp @@ -104,14 +104,14 @@ void ExtractEdgeData( const TopoDS_Edge & edge, int index, std::vector * int nbnodes = poly -> NbNodes(); for (int j = 1; j < nbnodes; j++) - { - auto p0 = occ2ng((T -> Nodes())(poly->Nodes()(j)).Transformed(loc)); - auto p1 = occ2ng((T -> Nodes())(poly->Nodes()(j+1)).Transformed(loc)); + { + auto p0 = occ2ng((T -> Node(poly->Node(j))).Transformed(loc)); + auto p1 = occ2ng((T -> Node(poly->Node(j+1))).Transformed(loc)); for(auto k : Range(3)) - { + { p[0].push_back(p0[k]); p[1].push_back(p1[k]); - } + } p[0].push_back(index); p[1].push_back(index); box.Add(p0); @@ -138,15 +138,15 @@ void ExtractFaceData( const TopoDS_Face & face, int index, std::vector * int ntriangles = triangulation -> NbTriangles(); for (int j = 1; j <= ntriangles; j++) { - Poly_Triangle triangle = (triangulation -> Triangles())(j); + Poly_Triangle triangle = triangulation -> Triangle(j); std::array,3> pts; std::array,3> normals; for (int k = 0; k < 3; k++) - pts[k] = occ2ng( (triangulation -> Nodes())(triangle(k+1)).Transformed(loc) ); + pts[k] = occ2ng( (triangulation -> Node(triangle(k+1))).Transformed(loc) ); for (int k = 0; k < 3; k++) { - auto uv = (triangulation -> UVNodes())(triangle(k+1)); + auto uv = triangulation -> UVNode(triangle(k+1)); prop.SetParameters (uv.X(), uv.Y()); if (!prop.IsNormalDefined()) throw Exception("No normal defined on face"); @@ -1011,11 +1011,10 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m) Array< std::array,3> > triangles; for (int j = 1; j <= ntriangles; j++) { - Poly_Triangle triangle = (triangulation -> Triangles())(j); + Poly_Triangle triangle = triangulation -> Triangle(j); std::array,3> pts; for (int k = 0; k < 3; k++) - pts[k] = occ2ng( (triangulation -> Nodes())(triangle(k+1)).Transformed(loc) ); - + pts[k] = occ2ng( (triangulation -> Node(triangle(k+1))).Transformed(loc) ); triangles.Append ( pts ); } diff --git a/libsrc/occ/vsocc.cpp b/libsrc/occ/vsocc.cpp index 4d806006..da741dd9 100644 --- a/libsrc/occ/vsocc.cpp +++ b/libsrc/occ/vsocc.cpp @@ -463,8 +463,9 @@ namespace netgen glBegin (GL_LINE_STRIP); for (int j = 1; j <= nbnodes; j++) { - gp_Pnt p = (T -> Nodes())(aEdgePoly->Nodes()(j)).Transformed(aEdgeLoc); - glVertex3f (p.X(), p.Y(), p.Z()); + // gp_Pnt p = (T -> Nodes())(aEdgePoly->Nodes()(j)).Transformed(aEdgeLoc); + gp_Pnt p = (T -> Node(aEdgePoly->Nodes()(j))).Transformed(aEdgeLoc); + glVertex3f (p.X(), p.Y(), p.Z()); } glEnd (); } @@ -509,10 +510,11 @@ namespace netgen int nbnodes = aEdgePoly -> NbNodes(); glBegin (GL_LINE_STRIP); for (int j = 1; j <= nbnodes; j++) - { - gp_Pnt p = (T -> Nodes())(aEdgePoly->Nodes()(j)).Transformed(aEdgeLoc); - glVertex3f (p.X(), p.Y(), p.Z()); - } + { + // gp_Pnt p = (T -> Nodes())(aEdgePoly->Nodes()(j)).Transformed(aEdgeLoc); + gp_Pnt p = (T -> Node(aEdgePoly->Node(j))).Transformed(aEdgeLoc); + glVertex3f (p.X(), p.Y(), p.Z()); + } glEnd (); } @@ -582,18 +584,18 @@ namespace netgen gp_Vec n; glBegin (GL_TRIANGLES); - int ntriangles = triangulation -> NbTriangles(); for (int j = 1; j <= ntriangles; j++) { - Poly_Triangle triangle = (triangulation -> Triangles())(j); + Poly_Triangle triangle = (triangulation -> Triangle(j)); gp_Pnt p[3]; for (int k = 1; k <= 3; k++) - p[k-1] = (triangulation -> Nodes())(triangle(k)).Transformed(loc); + p[k-1] = (triangulation -> Node(triangle(k))).Transformed(loc); for (int k = 1; k <= 3; k++) { - uv = (triangulation -> UVNodes())(triangle(k)); + // uv = (triangulation -> UVNodes())(triangle(k)); + uv = triangulation -> UVNode(triangle(k)); prop.SetParameters (uv.X(), uv.Y()); // surf->D0 (uv.X(), uv.Y(), pnt);