From b9ea741e5eb3a0a020c9d36fa8e15deb1fc87dd0 Mon Sep 17 00:00:00 2001 From: fichter Date: Fri, 19 Nov 2021 14:07:21 +0100 Subject: [PATCH] OCC7.5 to OCC7.6 -> depracated Poly_Triangulation Nodes() --- src/ifcgeom/IfcGeomFunctions.cpp | 3 +-- src/ifcgeom/IfcGeomRepresentation.cpp | 7 +++---- src/ifcgeom/IfcGeomRepresentation.h | 8 +++----- src/ifcgeom/IfcGeomSerialisation.cpp | 5 ++--- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/ifcgeom/IfcGeomFunctions.cpp b/src/ifcgeom/IfcGeomFunctions.cpp index 871bb8e0d7..ed3d8e71d8 100644 --- a/src/ifcgeom/IfcGeomFunctions.cpp +++ b/src/ifcgeom/IfcGeomFunctions.cpp @@ -3692,7 +3692,6 @@ bool IfcGeom::Kernel::triangulate_wire(const std::vector& wires, To Handle_Poly_Triangulation tri = BRep_Tool::Triangulation(face, loc); if (!tri.IsNull()) { - const TColgp_Array1OfPnt& nodes = tri->Nodes(); const Poly_Array1OfTriangle& triangles = tri->Triangles(); for (int i = 1; i <= triangles.Length(); ++i) { @@ -3708,7 +3707,7 @@ bool IfcGeom::Kernel::triangulate_wire(const std::vector& wires, To TopoDS_Vertex vs[2]; for (int k = 0; k < 2; ++k) { - const gp_Pnt& uv = nodes.Value(n123[(j + k) % 3]); + const gp_Pnt& uv = tri->Node(n123[(j + k) % 3]); uvnodes[k] = std::make_pair(uv.X(), uv.Y()); auto it = mapping.find(uvnodes[k]); diff --git a/src/ifcgeom/IfcGeomRepresentation.cpp b/src/ifcgeom/IfcGeomRepresentation.cpp index f148b97e8b..c346471aa4 100644 --- a/src/ifcgeom/IfcGeomRepresentation.cpp +++ b/src/ifcgeom/IfcGeomRepresentation.cpp @@ -148,12 +148,11 @@ namespace { TopLoc_Location loc; Handle(Poly_Triangulation) tri = BRep_Tool::Triangulation(face, loc); if (!tri.IsNull()) { - const TColgp_Array1OfPnt& nodes = tri->Nodes(); std::vector coords; - coords.reserve(nodes.Length()); + coords.reserve(tri->NbNodes()); - for (int i = 1; i <= nodes.Length(); ++i) { - coords.push_back(nodes(i).Transformed(loc).XYZ()); + for (int i = 1; i <= tri->NbNodes(); ++i) { + coords.push_back(tri->Node(i).Transformed(loc).XYZ()); } const Poly_Array1OfTriangle& triangles = tri->Triangles(); diff --git a/src/ifcgeom/IfcGeomRepresentation.h b/src/ifcgeom/IfcGeomRepresentation.h index af4ab57070..40f6718c59 100644 --- a/src/ifcgeom/IfcGeomRepresentation.h +++ b/src/ifcgeom/IfcGeomRepresentation.h @@ -200,8 +200,6 @@ namespace IfcGeom { std::map,int> edgecount; std::vector > edges_temp; - const TColgp_Array1OfPnt& nodes = tri->Nodes(); - const TColgp_Array1OfPnt2d& uvs = tri->UVNodes(); std::vector coords; BRepGProp_Face prop(face); std::map dict; @@ -210,13 +208,13 @@ namespace IfcGeom { const bool calculate_normals = !settings().get(IteratorSettings::WELD_VERTICES) && !settings().get(IteratorSettings::NO_NORMALS); - for( int i = 1; i <= nodes.Length(); ++ i ) { - coords.push_back(nodes(i).Transformed(loc).XYZ()); + for( int i = 1; i <= tri->NbNodes(); ++ i ) { + coords.push_back(tri->Node(i).Transformed(loc).XYZ()); trsf.Transforms(*coords.rbegin()); dict[i] = addVertex(surface_style_id, *coords.rbegin()); if ( calculate_normals ) { - const gp_Pnt2d& uv = uvs(i); + const gp_Pnt2d& uv = tri->UVNode(i); gp_Pnt p; gp_Vec normal_direction; prop.Normal(uv.X(),uv.Y(),p,normal_direction); diff --git a/src/ifcgeom/IfcGeomSerialisation.cpp b/src/ifcgeom/IfcGeomSerialisation.cpp index 33469c047a..a6c5521374 100644 --- a/src/ifcgeom/IfcGeomSerialisation.cpp +++ b/src/ifcgeom/IfcGeomSerialisation.cpp @@ -688,10 +688,9 @@ IfcUtil::IfcBaseClass* IfcGeom::MAKE_TYPE_NAME(tesselate_)(const TopoDS_Shape& s Handle(Poly_Triangulation) tri = BRep_Tool::Triangulation(face, loc); if (!tri.IsNull()) { - const TColgp_Array1OfPnt& nodes = tri->Nodes(); std::vector vertices; - for (int i = 1; i <= nodes.Length(); ++i) { - gp_Pnt pnt = nodes(i).Transformed(loc); + for (int i = 1; i <= tri->NbNodes(); ++i) { + gp_Pnt pnt = tri->Node(i).Transformed(loc); std::vector xyz; xyz.push_back(pnt.X()); xyz.push_back(pnt.Y()); xyz.push_back(pnt.Z()); IfcSchema::IfcCartesianPoint* cpnt = new IfcSchema::IfcCartesianPoint(xyz); vertices.push_back(cpnt);