From 81f71e6418b8b0e030abf712ad7d036ecb8f8e71 Mon Sep 17 00:00:00 2001 From: Frozen Forest Reality Technologies Date: Wed, 24 Jun 2026 18:58:26 +0300 Subject: [PATCH] OCCT 8.0 Update Part 2 --- src/ifcgeom/kernels/opencascade/IfcGeomTree.h | 22 ++-- .../OpenCascadeConversionResult.cpp | 10 +- .../opencascade/OpenCascadeConversionResult.h | 3 - .../kernels/opencascade/OpenCascadeKernel.cpp | 4 +- .../kernels/opencascade/OpenCascadeKernel.h | 4 +- .../kernels/opencascade/base_utils.cpp | 22 ++-- src/ifcgeom/kernels/opencascade/base_utils.h | 8 +- .../kernels/opencascade/boolean_result.cpp | 4 +- .../kernels/opencascade/boolean_utils.cpp | 76 +++++------ .../kernels/opencascade/boolean_utils.h | 13 +- .../kernels/opencascade/clash_utils.cpp | 124 +++++++++--------- src/ifcgeom/kernels/opencascade/clash_utils.h | 4 +- src/ifcgeom/kernels/opencascade/face.cpp | 25 ++-- .../kernels/opencascade/faceset_helper.cpp | 6 +- src/ifcgeom/kernels/opencascade/layerset.cpp | 17 ++- src/ifcgeom/kernels/opencascade/loft.cpp | 8 +- src/ifcgeom/kernels/opencascade/loop.cpp | 13 +- src/ifcgeom/kernels/opencascade/shell.cpp | 4 +- .../kernels/opencascade/sweep_along_curve.cpp | 4 +- .../kernels/opencascade/sweep_utils.cpp | 10 +- .../kernels/opencascade/wire_utils.cpp | 38 +++--- src/ifcgeom/kernels/opencascade/wire_utils.h | 13 +- src/serializers/SvgSerializer.cpp | 6 +- 23 files changed, 231 insertions(+), 207 deletions(-) diff --git a/src/ifcgeom/kernels/opencascade/IfcGeomTree.h b/src/ifcgeom/kernels/opencascade/IfcGeomTree.h index d3337c4b13..a2d85597a8 100644 --- a/src/ifcgeom/kernels/opencascade/IfcGeomTree.h +++ b/src/ifcgeom/kernels/opencascade/IfcGeomTree.h @@ -36,7 +36,13 @@ #include #include #include -#include + +#include +#include +#include +#include +#include + #include #include #include @@ -145,7 +151,7 @@ namespace IfcGeom { while (exp.More()) { is_closed = true; TopoDS_Shell shell = TopoDS::Shell(exp.Current()); - TopTools_IndexedDataMapOfShapeListOfShape edgeFaceMap; + NCollection_IndexedDataMap, TopTools_ShapeMapHasher> edgeFaceMap; TopExp::MapShapesAndAncestors(s, TopAbs_EDGE, TopAbs_FACE, edgeFaceMap); for (int i = 1; i <= edgeFaceMap.Extent(); ++i) { @@ -1461,13 +1467,13 @@ namespace IfcGeom { , bounds_(b) {} - Standard_Boolean Reject(const Bnd_Box& b) const { + bool Reject(const Bnd_Box& b) const { return bounds_.IsOut(b); } - Standard_Boolean Accept(const T& o) { + bool Accept(const T& o) { results_.push_back(o); - return Standard_True; + return true; } const std::vector& results() const { @@ -1922,8 +1928,8 @@ namespace IfcGeom { std::vector original_normals; // Attempt to copy exactly what BRepExtrema_TriangleSet is doing under the hood. - const auto builder = new BVH_LinearBuilder(BVH_Constants_LeafNodeSizeDefault, BVH_Constants_MaxTreeDepth); - BVH_Triangulation triangulation(builder); + const auto builder = new BVH_LinearBuilder(BVH_Constants_LeafNodeSizeDefault, BVH_Constants_MaxTreeDepth); + BVH_Triangulation triangulation(builder); for (int i = 0; i < elem_verts.size(); i += 3) { triangulation.Vertices.Append(BVH_Vec3d(elem_verts[i], elem_verts[i + 1], elem_verts[i + 2])); @@ -2085,7 +2091,7 @@ namespace IfcGeom { } protected: - typedef TopTools_DataMapOfShapeInteger face_style_map_t; + typedef NCollection_DataMap face_style_map_t; face_style_map_t face_styles_; std::vector styles_; diff --git a/src/ifcgeom/kernels/opencascade/OpenCascadeConversionResult.cpp b/src/ifcgeom/kernels/opencascade/OpenCascadeConversionResult.cpp index 7540dafa48..71098d4d80 100644 --- a/src/ifcgeom/kernels/opencascade/OpenCascadeConversionResult.cpp +++ b/src/ifcgeom/kernels/opencascade/OpenCascadeConversionResult.cpp @@ -244,7 +244,7 @@ void ifcopenshell::geometry::OpenCascadeShape::Triangulate(ifcopenshell::geometr // TopExp_Explorer texp(s, TopAbs_EDGE, TopAbs_FACE) to find edges that do not // belong to any face. - TopTools_ListOfShape edges; + NCollection_List edges; // First collect edges part of wire in order for (TopExp_Explorer texp(shape_, TopAbs_WIRE); texp.More(); texp.Next()) { BRepTools_WireExplorer wexp(TopoDS::Wire(texp.Current())); @@ -258,7 +258,7 @@ void ifcopenshell::geometry::OpenCascadeShape::Triangulate(ifcopenshell::geometr edges.Append(texp.Current()); } - for (TopTools_ListIteratorOfListOfShape texp(edges); texp.More(); texp.Next()) { + for (NCollection_List::Iterator texp(edges); texp.More(); texp.Next()) { BRepAdaptor_Curve crv(TopoDS::Edge(texp.Value())); GCPnts_QuasiUniformDeflection tessellater(crv, settings.get().get()); int n = tessellater.NbPoints(); @@ -494,7 +494,7 @@ ConversionResultShape* ifcopenshell::geometry::OpenCascadeShape::wrap_in_compoun std::vector ifcopenshell::geometry::OpenCascadeShape::vertices() { - TopTools_IndexedMapOfShape map; + NCollection_IndexedMap map; TopExp::MapShapes(shape_, TopAbs_VERTEX, map); std::vector vec; for (int i = 1; i <= map.Extent(); ++i) { @@ -505,7 +505,7 @@ std::vector ifcopenshell::geometry::OpenCascadeShape::ve std::vector ifcopenshell::geometry::OpenCascadeShape::edges() { - TopTools_IndexedMapOfShape map; + NCollection_IndexedMap map; TopExp::MapShapes(shape_, TopAbs_EDGE, map); std::vector vec; for (int i = 1; i <= map.Extent(); ++i) { @@ -516,7 +516,7 @@ std::vector ifcopenshell::geometry::OpenCascadeShape::ed std::vector ifcopenshell::geometry::OpenCascadeShape::facets() { - TopTools_IndexedMapOfShape map; + NCollection_IndexedMap map; TopExp::MapShapes(shape_, TopAbs_FACE, map); std::vector vec; for (int i = 1; i <= map.Extent(); ++i) { diff --git a/src/ifcgeom/kernels/opencascade/OpenCascadeConversionResult.h b/src/ifcgeom/kernels/opencascade/OpenCascadeConversionResult.h index 5c25addc3b..0dcd33c6a8 100644 --- a/src/ifcgeom/kernels/opencascade/OpenCascadeConversionResult.h +++ b/src/ifcgeom/kernels/opencascade/OpenCascadeConversionResult.h @@ -24,9 +24,6 @@ #include #include -#include -#include - #include #include diff --git a/src/ifcgeom/kernels/opencascade/OpenCascadeKernel.cpp b/src/ifcgeom/kernels/opencascade/OpenCascadeKernel.cpp index b02312ed95..0c8987a225 100644 --- a/src/ifcgeom/kernels/opencascade/OpenCascadeKernel.cpp +++ b/src/ifcgeom/kernels/opencascade/OpenCascadeKernel.cpp @@ -138,7 +138,7 @@ bool IfcGeom::OpenCascadeKernel::convert_openings(const IfcUtil::IfcBaseEntity* if (!is_manifold) { // force sewing, edge identity might have been mudied by FixAdvFace.FixOrientation.MSG5 to fix interior loop winding order - TopTools_ListOfShape list; + NCollection_List list; IfcGeom::util::shape_to_face_list(entity_part, list); IfcGeom::util::create_solid_from_faces(list, entity_part, settings_.get().get(), true); is_manifold = util::is_manifold(entity_part); @@ -205,7 +205,7 @@ bool IfcGeom::OpenCascadeKernel::convert_openings(const IfcUtil::IfcBaseEntity* for (;; ++it) { if (it == opening_vector.end() || jt->first / it->first > 10.) { - TopTools_ListOfShape opening_list; + NCollection_List opening_list; for (auto kt = jt; kt < it; ++kt) { opening_list.Append(kt->second); } diff --git a/src/ifcgeom/kernels/opencascade/OpenCascadeKernel.h b/src/ifcgeom/kernels/opencascade/OpenCascadeKernel.h index 9bbd0d0f72..e4f3e299d2 100644 --- a/src/ifcgeom/kernels/opencascade/OpenCascadeKernel.h +++ b/src/ifcgeom/kernels/opencascade/OpenCascadeKernel.h @@ -37,8 +37,6 @@ #include #include #include -#include -#include #include #include #include @@ -105,7 +103,7 @@ private: bool edge(int A, int B, TopoDS_Edge& e); bool wire(const ifcopenshell::geometry::taxonomy::loop::ptr loop, TopoDS_Wire& wire); - bool wires(const ifcopenshell::geometry::taxonomy::loop::ptr loop, TopTools_ListOfShape& wires); + bool wires(const ifcopenshell::geometry::taxonomy::loop::ptr loop, NCollection_List& wires); }; faceset_helper* faceset_helper_; diff --git a/src/ifcgeom/kernels/opencascade/base_utils.cpp b/src/ifcgeom/kernels/opencascade/base_utils.cpp index 3b0425c727..f218d0bc63 100644 --- a/src/ifcgeom/kernels/opencascade/base_utils.cpp +++ b/src/ifcgeom/kernels/opencascade/base_utils.cpp @@ -48,7 +48,9 @@ #include -#include +#include +#include +#include #include @@ -73,7 +75,7 @@ bool IfcGeom::util::axis_equal(const gp_Ax2d & a, const gp_Ax2d & b, double tole int IfcGeom::util::count(const TopoDS_Shape& s, TopAbs_ShapeEnum t, bool unique) { if (unique) { - TopTools_IndexedMapOfShape map; + NCollection_IndexedMap map; TopExp::MapShapes(s, t, map); return map.Extent(); } else { @@ -108,7 +110,7 @@ bool IfcGeom::util::is_manifold(const TopoDS_Shape& a) { } return true; } else { - NCollection_IndexedDataMap map; + NCollection_IndexedDataMap, TopTools_ShapeMapHasher> map; TopExp::MapShapesAndAncestors(a, TopAbs_EDGE, TopAbs_FACE, map); for (int i = 1; i <= map.Extent(); ++i) { @@ -590,10 +592,10 @@ TopoDS_Shape IfcGeom::util::halfspace_from_plane(const gp_Pln& pln, const gp_Pnt gp_Pln IfcGeom::util::plane_from_face(const TopoDS_Face& face) { BRepGProp_Face prop(face); - Standard_Real u1, u2, v1, v2; + double u1, u2, v1, v2; prop.Bounds(u1, u2, v1, v2); - Standard_Real u = (u1 + u2) / 2.0; - Standard_Real v = (v1 + v2) / 2.0; + double u = (u1 + u2) / 2.0; + double v = (v1 + v2) / 2.0; gp_Pnt p; gp_Vec n; prop.Normal(u, v, p, n); @@ -616,7 +618,7 @@ bool IfcGeom::util::is_compound_of_faces(const TopoDS_Shape& shape) { return has_compounds && has_faces && !has_solids && !has_shells; } -bool IfcGeom::util::shape_to_face_list(const TopoDS_Shape& s, TopTools_ListOfShape& li) { +bool IfcGeom::util::shape_to_face_list(const TopoDS_Shape& s, NCollection_List& li) { TopExp_Explorer exp(s, TopAbs_FACE); for (; exp.More(); exp.Next()) { TopoDS_Face face = TopoDS::Face(exp.Current()); @@ -626,7 +628,7 @@ bool IfcGeom::util::shape_to_face_list(const TopoDS_Shape& s, TopTools_ListOfSha } bool IfcGeom::util::create_solid_from_compound(const TopoDS_Shape& compound, TopoDS_Shape& shape, double tol) { - TopTools_ListOfShape face_list; + NCollection_List face_list; shape_to_face_list(compound, face_list); if (face_list.Extent() == 0) { return false; @@ -634,7 +636,7 @@ bool IfcGeom::util::create_solid_from_compound(const TopoDS_Shape& compound, Top return create_solid_from_faces(face_list, shape, tol); } -bool IfcGeom::util::create_solid_from_faces(const TopTools_ListOfShape& face_list, TopoDS_Shape& shape, double tol, bool force_sewing) { +bool IfcGeom::util::create_solid_from_faces(const NCollection_List& face_list, TopoDS_Shape& shape, double tol, bool force_sewing) { bool valid_shell = false; if (face_list.Extent() == 1) { @@ -645,7 +647,7 @@ bool IfcGeom::util::create_solid_from_faces(const TopTools_ListOfShape& face_lis return false; } - TopTools_ListIteratorOfListOfShape face_iterator; + NCollection_List::Iterator face_iterator; bool has_shared_edges = false; NCollection_Map edge_set; diff --git a/src/ifcgeom/kernels/opencascade/base_utils.h b/src/ifcgeom/kernels/opencascade/base_utils.h index fc6212d5b0..672f1c4f9e 100644 --- a/src/ifcgeom/kernels/opencascade/base_utils.h +++ b/src/ifcgeom/kernels/opencascade/base_utils.h @@ -13,7 +13,9 @@ #include #include -#include +#include +#include + #include #include #include @@ -49,8 +51,8 @@ namespace IfcGeom { // Creates a solid from a compound of faces. When there are multiple connected components, // a compound of solids is returned. IFC_GEOMLIBRARY_API bool create_solid_from_compound(const TopoDS_Shape& compound, TopoDS_Shape& solid, double tol); - IFC_GEOMLIBRARY_API bool shape_to_face_list(const TopoDS_Shape& s, TopTools_ListOfShape& li); - IFC_GEOMLIBRARY_API bool create_solid_from_faces(const TopTools_ListOfShape& face_list, TopoDS_Shape& solid, double tol, bool force_sewing = false); + IFC_GEOMLIBRARY_API bool shape_to_face_list(const TopoDS_Shape& s, NCollection_List& li); + IFC_GEOMLIBRARY_API bool create_solid_from_faces(const NCollection_List& face_list, TopoDS_Shape& solid, double tol, bool force_sewing = false); IFC_GEOMLIBRARY_API bool is_compound_of_faces(const TopoDS_Shape& shape); IFC_GEOMLIBRARY_API bool is_convex(const TopoDS_Wire& wire, double tol); IFC_GEOMLIBRARY_API TopoDS_Shape halfspace_from_plane(const gp_Pln& pln, const gp_Pnt& cent); diff --git a/src/ifcgeom/kernels/opencascade/boolean_result.cpp b/src/ifcgeom/kernels/opencascade/boolean_result.cpp index 2965d8590d..64ce43eca1 100644 --- a/src/ifcgeom/kernels/opencascade/boolean_result.cpp +++ b/src/ifcgeom/kernels/opencascade/boolean_result.cpp @@ -23,7 +23,7 @@ namespace { for (;; ++it) { if (it == opening_vector.end() || jt->first / it->first > 10.) { - TopTools_ListOfShape opening_list; + NCollection_List opening_list; for (auto kt = jt; kt < it; ++kt) { opening_list.Append(kt->second); } @@ -90,7 +90,7 @@ bool OpenCascadeKernel::convert_impl(const taxonomy::boolean_result::ptr br, Con const double tol = settings_.get().get(); TopoDS_Shape a; - TopTools_ListOfShape b; + NCollection_List b; taxonomy::style::ptr first_item_style; diff --git a/src/ifcgeom/kernels/opencascade/boolean_utils.cpp b/src/ifcgeom/kernels/opencascade/boolean_utils.cpp index 88d67e3795..caa4f6dc24 100644 --- a/src/ifcgeom/kernels/opencascade/boolean_utils.cpp +++ b/src/ifcgeom/kernels/opencascade/boolean_utils.cpp @@ -30,7 +30,7 @@ #include #include -void IfcGeom::util::copy_operand(const TopTools_ListOfShape & l, TopTools_ListOfShape & r) { +void IfcGeom::util::copy_operand(const NCollection_List& l, NCollection_List& r) { #if OCC_VERSION_HEX < 0x70000 r.Clear(); TopTools_ListIteratorOfListOfShape it(l); @@ -80,7 +80,7 @@ double IfcGeom::util::min_edge_length(const TopoDS_Shape & a) { double IfcGeom::util::min_vertex_edge_distance(const TopoDS_Shape & a, double min_search, double max_search) { double M = std::numeric_limits::infinity(); - TopTools_IndexedMapOfShape vertices, edges; + NCollection_IndexedMap vertices, edges; TopExp::MapShapes(a, TopAbs_VERTEX, vertices); TopExp::MapShapes(a, TopAbs_EDGE, edges); @@ -160,7 +160,7 @@ double IfcGeom::util::min_face_face_distance(const TopoDS_Shape & a, double max_ */ double M = std::numeric_limits::infinity(); - TopTools_IndexedMapOfShape faces; + NCollection_IndexedMap faces; TopExp::MapShapes(a, TopAbs_FACE, faces); @@ -279,7 +279,7 @@ bool IfcGeom::util::get_edge_axis(const TopoDS_Edge & e, gp_Ax1 & ax) { return false; } -bool IfcGeom::util::is_subset(const TopTools_IndexedMapOfShape & lhs, const TopTools_IndexedMapOfShape & rhs) { +bool IfcGeom::util::is_subset(const NCollection_IndexedMap& lhs, const NCollection_IndexedMap& rhs) { if (rhs.Extent() < lhs.Extent()) { return false; } @@ -296,12 +296,12 @@ bool IfcGeom::util::is_extrusion(const gp_Vec & v, const TopoDS_Shape & s, TopoD // This assumes UnifySameDomain has been processed on s, so that // the extrusion top and bottom are a single face. - NCollection_IndexedDataMap mapping; + NCollection_IndexedDataMap, TopTools_ShapeMapHasher> mapping; TopExp::MapShapesAndAncestors(s, TopAbs_EDGE, TopAbs_FACE, mapping); TopExp::MapShapesAndAncestors(s, TopAbs_VERTEX, TopAbs_FACE, mapping); - TopTools_ListOfShape parallel; - TopTools_IndexedMapOfShape curved_orthogonal; + NCollection_List parallel; + NCollection_IndexedMap curved_orthogonal; gp_Ax1 ax; gp_Ax1 V(gp::Origin(), v); @@ -332,9 +332,9 @@ bool IfcGeom::util::is_extrusion(const gp_Vec & v, const TopoDS_Shape & s, TopoD // Select the two faces for which their edges are subsets // of the ortho/curved edges - TopTools_IndexedMapOfShape ortho_faces; + NCollection_IndexedMap ortho_faces; for (TopExp_Explorer exp(s, TopAbs_FACE); exp.More(); exp.Next()) { - TopTools_IndexedMapOfShape face_edges; + NCollection_IndexedMap face_edges; TopExp::MapShapes(exp.Current(), TopAbs_EDGE, face_edges); if (is_subset(face_edges, curved_orthogonal)) { ortho_faces.Add(exp.Current()); @@ -348,18 +348,18 @@ bool IfcGeom::util::is_extrusion(const gp_Vec & v, const TopoDS_Shape & s, TopoD // For the parallel edges assert that its two vertices are part // of both the basis and the top face. - for (TopTools_ListIteratorOfListOfShape it(parallel); + for (NCollection_List::Iterator it(parallel); it.More(); it.Next()) { TopoDS_Vertex v01[2]; TopExp::Vertices(TopoDS::Edge(it.Value()), v01[0], v01[1]); - TopTools_IndexedMapOfShape v_ortho_faces; + NCollection_IndexedMap v_ortho_faces; int nb_ortho_faces[2] = { 0,0 }; for (int i = 0; i < 2; ++i) { auto& faces = mapping.FindFromKey(v01[i]); - for (TopTools_ListIteratorOfListOfShape jt(faces); + for (NCollection_List::Iterator jt(faces); jt.More(); jt.Next()) { if (ortho_faces.Contains(jt.Value())) { nb_ortho_faces[i] ++; @@ -430,7 +430,7 @@ int IfcGeom::util::eliminate_narrow_operands(double prec, const NCollection_List } int IfcGeom::util::eliminate_touching_operands(double prec, const TopoDS_Shape & a, const NCollection_List & bs, NCollection_List & c) { - TopTools_IndexedMapOfShape a_faces; + NCollection_IndexedMap a_faces; TopExp::MapShapes(a, TopAbs_FACE, a_faces); // Check if any of the faces in a are non-planar, which is @@ -442,7 +442,7 @@ int IfcGeom::util::eliminate_touching_operands(double prec, const TopoDS_Shape & } } - TopTools_IndexedMapOfShape a_vertices; + NCollection_IndexedMap a_vertices; TopExp::MapShapes(a, TopAbs_VERTEX, a_vertices); IfcGeom::impl::tree tree; @@ -454,13 +454,13 @@ int IfcGeom::util::eliminate_touching_operands(double prec, const TopoDS_Shape & int N = 0; - TopTools_ListIteratorOfListOfShape it(bs); + NCollection_List::Iterator it(bs); for (; it.More(); it.Next()) { bool is_touching = false; auto& b = it.Value(); - TopTools_IndexedMapOfShape b_faces; + NCollection_IndexedMap b_faces; TopExp::MapShapes(b, TopAbs_FACE, b_faces); // Check if any of the faces in b are non-planar, which is @@ -478,7 +478,7 @@ int IfcGeom::util::eliminate_touching_operands(double prec, const TopoDS_Shape & continue; } - TopTools_IndexedMapOfShape b_vertices; + NCollection_IndexedMap b_vertices; TopExp::MapShapes(b, TopAbs_VERTEX, b_vertices); for (int k = 1; k <= b_faces.Extent(); ++k) { @@ -490,7 +490,7 @@ int IfcGeom::util::eliminate_touching_operands(double prec, const TopoDS_Shape & for (auto& i : tree.select_box(B, false)) { const TopoDS_Face& f_a = TopoDS::Face(a_faces(i)); - TopTools_IndexedMapOfShape f_a_vertices; + NCollection_IndexedMap f_a_vertices; TopExp::MapShapes(f_a, TopAbs_VERTEX, f_a_vertices); BRepGProp_Face prop_a(f_a); @@ -531,7 +531,7 @@ int IfcGeom::util::eliminate_touching_operands(double prec, const TopoDS_Shape & // Check if faces are co-planar if (std::abs((p_b.XYZ() - p_a.XYZ()).Dot(v_a.XYZ())) <= prec) { - TopTools_IndexedMapOfShape f_b_vertices; + NCollection_IndexedMap f_b_vertices; TopExp::MapShapes(f_b, TopAbs_VERTEX, f_b_vertices); bool all_vertices_behind_f_b = true; @@ -678,10 +678,10 @@ bool IfcGeom::util::boolean_subtraction_2d_using_builder(const TopoDS_Shape & a_ // to see whether inside tolerance. Current DY is hardcoded. The sensible default // for walls. gp_Vec vec(p1, p2); - Standard_Real d = vec.Dot(gp::DY()); + double d = vec.Dot(gp::DY()); gp_Vec projected = d * gp::DY(); gp_Vec ortho_remainder = vec - projected; - Standard_Real ortho_distance = ortho_remainder.Magnitude(); + double ortho_distance = ortho_remainder.Magnitude(); const bool unbounded_intersects = ortho_distance < eps; if (unbounded_intersects) { @@ -877,7 +877,7 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To // @todo, it does seem a bit odd, we first triangulate non-planar faces // to later unify them again. Can we make this a bit more intelligent? TopoDS_Shape a; - TopTools_ListOfShape b; + NCollection_List b; if (do_unify) { PERF("boolean operation: unifying operands"); @@ -893,7 +893,7 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To ); { - TopTools_ListIteratorOfListOfShape it(b_input); + NCollection_List::Iterator it(b_input); for (; it.More(); it.Next()) { b.Append(unify(it.Value(), fuzziness)); Logger::Root().Message( @@ -914,7 +914,7 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To bool success = false; std::unique_ptr builder; - TopTools_ListOfShape b_tmp; + NCollection_List b_tmp; if (op == BOPAlgo_CUT) { builder.reset(new BRepAlgoAPI_Cut()); @@ -972,7 +972,7 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To Logger::Root().Notice("GEO", 133, "Operand A is " + (is_manifold(a) ? ""s : "non-"s) + "manifold"); } - TopTools_ListIteratorOfListOfShape it(b); + NCollection_List::Iterator it(b); for (int i = 0; it.More(); it.Next(), ++i) { Logger::Root().Notice("GEO", 134, "Operand B " + std::to_string(i) + " is " + (is_manifold(it.Value()) ? ""s : "non-"s) + "manifold"); } @@ -986,7 +986,7 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To PERF("boolean operation: min edge length"); min_length_orig = min_edge_length(a); - TopTools_ListIteratorOfListOfShape it(b); + NCollection_List::Iterator it(b); for (; it.More(); it.Next()) { double d = min_edge_length(it.Value()); if (d < min_length_orig) { @@ -1003,7 +1003,7 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To min_length_orig = d; } - TopTools_ListIteratorOfListOfShape it(b); + NCollection_List::Iterator it(b); for (; it.More(); it.Next()) { d = min_vertex_edge_distance(it.Value(), settings.precision, min_length_orig); if (d < min_length_orig) { @@ -1019,14 +1019,14 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To const double new_fuzziness = fuzziness * 10.; const bool allow_retry = new_fuzziness - 1e-15 <= settings.precision * 10000. && new_fuzziness < min_length_orig; - TopTools_ListOfShape s1s; + NCollection_List s1s; s1s.Append(copy_operand(a)); if (debug) { - TopTools_ListOfShape* lists[2] = { &s1s, &b }; + NCollection_List* lists[2] = {&s1s, &b}; static std::string operand_names[2] = { "a", "b" }; for (int i = 0; i < 2; ++i) { - TopTools_ListIteratorOfListOfShape it(*lists[i]); + NCollection_List::Iterator it(*lists[i]); for (int j = 0; it.More(); it.Next(), ++j) { std::string fn = debug_identifier + "-" + operand_names[i] + "-" + std::to_string(j) + ".brep"; BRepTools::Write(it.Value(), fn.c_str()); @@ -1038,7 +1038,7 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To TopoDS_Face a_face; std::pair a_interval; - TopTools_ListOfShape b_faces, b_remainder_3d; + NCollection_List b_faces, b_remainder_3d; bool is_extrusion_a = false; if (do_attempt_2d_boolean) { @@ -1050,7 +1050,7 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To if (is_extrusion_a) { Logger::Root().Notice("GEO", 136, "Operand A 1/1 is an extrusion"); - TopTools_ListIteratorOfListOfShape it(b); + NCollection_List::Iterator it(b); for (int nb = 1; it.More(); it.Next(), ++nb) { bool process_2d = false; TopoDS_Face b_face; @@ -1232,9 +1232,9 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To // An exemption for the requirement to be manifold: When the cut operands have overlapping edge belonging to faces that do not overlap. bool operands_nonmanifold = false; if (op == BOPAlgo_CUT) { - TopTools_IndexedMapOfShape edges; - NCollection_IndexedDataMap map; - for (TopTools_ListIteratorOfListOfShape it2(b); it2.More(); it2.Next()) { + NCollection_IndexedMap edges; + NCollection_IndexedDataMap, TopTools_ShapeMapHasher> map; + for (NCollection_List::Iterator it2(b); it2.More(); it2.Next()) { auto& bb = it2.Value(); TopExp::MapShapes(bb, TopAbs_EDGE, edges); TopExp::MapShapesAndAncestors(bb, TopAbs_EDGE, TopAbs_FACE, map); @@ -1261,9 +1261,9 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To auto faces_i = map.FindFromKey(edges.FindKey(i)); auto faces_j = map.FindFromKey(edges.FindKey(j)); bool overlap = false; - for (TopTools_ListIteratorOfListOfShape it4(faces_i); it4.More(); it4.Next()) { + for (NCollection_List::Iterator it4(faces_i); it4.More(); it4.Next()) { auto& fi = it4.Value(); - for (TopTools_ListIteratorOfListOfShape it2(faces_j); it2.More(); it2.Next()) { + for (NCollection_List::Iterator it2(faces_j); it2.More(); it2.Next()) { auto& fj = it2.Value(); if (faces_overlap(TopoDS::Face(fi), TopoDS::Face(fj))) { overlap = true; @@ -1426,7 +1426,7 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To } bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const TopoDS_Shape& a, const TopoDS_Shape& b, BOPAlgo_Operation op, TopoDS_Shape& result, double fuzziness) { - TopTools_ListOfShape bs; + NCollection_List bs; bs.Append(b); return boolean_operation(settings, a, bs, op, result, fuzziness); } diff --git a/src/ifcgeom/kernels/opencascade/boolean_utils.h b/src/ifcgeom/kernels/opencascade/boolean_utils.h index 001d6595ed..34bf4906b8 100644 --- a/src/ifcgeom/kernels/opencascade/boolean_utils.h +++ b/src/ifcgeom/kernels/opencascade/boolean_utils.h @@ -21,13 +21,18 @@ #define BOOLEAN_UTILS_H #include -#include + +#include +#include +#include +#include + #include #include #include #include #include -#include + #include #include "../ifc_geomlibrary_api.h" @@ -35,7 +40,7 @@ namespace IfcGeom { namespace util { - void copy_operand(const TopTools_ListOfShape& l, TopTools_ListOfShape& r); + void copy_operand(const NCollection_List& l, NCollection_List& r); TopoDS_Shape copy_operand(const TopoDS_Shape& s); @@ -77,7 +82,7 @@ namespace IfcGeom { bool get_edge_axis(const TopoDS_Edge& e, gp_Ax1& ax); - bool is_subset(const TopTools_IndexedMapOfShape& lhs, const TopTools_IndexedMapOfShape& rhs); + bool is_subset(const NCollection_IndexedMap& lhs, const NCollection_IndexedMap& rhs); bool is_extrusion(const gp_Vec& v, const TopoDS_Shape& s, TopoDS_Face& base, std::pair& interval); diff --git a/src/ifcgeom/kernels/opencascade/clash_utils.cpp b/src/ifcgeom/kernels/opencascade/clash_utils.cpp index cfc7687b73..97c0aa9862 100644 --- a/src/ifcgeom/kernels/opencascade/clash_utils.cpp +++ b/src/ifcgeom/kernels/opencascade/clash_utils.cpp @@ -43,7 +43,7 @@ bool is_intersect_ray_box(const struct ray *ray, const struct box *box) { // More reading: https://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algorithm bool intersectRayTriangle( const gp_Vec& orig, const gp_Vec& dir, const gp_Vec& vert0, const gp_Vec& vert1, const gp_Vec& vert2, - Standard_Real& at, Standard_Real& au, Standard_Real& av, + double& at, double& au, double& av, bool cull, float enlarge) { // Find vectors for two edges sharing vert0 const gp_Vec edge1 = vert1 - vert0; @@ -53,7 +53,7 @@ bool intersectRayTriangle( const gp_Vec& orig, const gp_Vec& dir, const gp_Vec pvec = dir.Crossed(edge2); // error ~ |v2-v0| // If determinant is near zero, ray lies in plane of triangle - const Standard_Real det = edge1.Dot(pvec); // error ~ |v2-v0|*|v1-v0| + const double det = edge1.Dot(pvec); // error ~ |v2-v0|*|v1-v0| if(cull) { @@ -64,11 +64,11 @@ bool intersectRayTriangle( const gp_Vec& orig, const gp_Vec& dir, const gp_Vec tvec = orig - vert0; // Calculate U parameter and test bounds - const Standard_Real u = tvec.Dot(pvec); + const double u = tvec.Dot(pvec); - const Standard_Real enlargeCoeff = enlarge*det; - const Standard_Real uvlimit = -enlargeCoeff; - const Standard_Real uvlimit2 = det + enlargeCoeff; + const double enlargeCoeff = enlarge*det; + const double uvlimit = -enlargeCoeff; + const double uvlimit2 = det + enlargeCoeff; if(uuvlimit2) return false; @@ -77,14 +77,14 @@ bool intersectRayTriangle( const gp_Vec& orig, const gp_Vec& dir, const gp_Vec qvec = tvec.Crossed(edge1); // Calculate V parameter and test bounds - const Standard_Real v = dir.Dot(qvec); + const double v = dir.Dot(qvec); if(vuvlimit2) return false; // Calculate t, scale parameters, ray intersects triangle - const Standard_Real t = edge2.Dot(qvec); + const double t = edge2.Dot(qvec); - const Standard_Real inv_det = 1.0f / det; + const double inv_det = 1.0f / det; at = t*inv_det; au = u*inv_det; av = v*inv_det; @@ -95,26 +95,26 @@ bool intersectRayTriangle( const gp_Vec& orig, const gp_Vec& dir, if(std::abs(det)1.0f+enlarge) + const double u = tvec.Dot(pvec) * inv_det; + if(u<-enlarge || u>1.0+enlarge) return false; // prepare to test V parameter const gp_Vec qvec = tvec.Crossed(edge1); // Calculate V parameter and test bounds - const Standard_Real v = dir.Dot(qvec) * inv_det; - if(v<-enlarge || (u+v)>1.0f+enlarge) + const double v = dir.Dot(qvec) * inv_det; + if(v<-enlarge || (u+v)>1.0+enlarge) return false; // Calculate t, ray intersects triangle - const Standard_Real t = edge2.Dot(qvec) * inv_det; + const double t = edge2.Dot(qvec) * inv_det; at = t; au = u; @@ -142,45 +142,45 @@ void edgeEdgeDist(gp_Vec& x, gp_Vec& y, // closest points // u parameterizes ray (q, b) // Compute t for the closest point on ray (p, a) to ray (q, b) - const Standard_Real Denom = ADotA*BDotB - ADotB*ADotB; + const double Denom = ADotA*BDotB - ADotB*ADotB; - Standard_Real t; // We will clamp result so t is on the segment (p, a) - if(Denom!=0.0f) + double t; // We will clamp result so t is on the segment (p, a) + if(Denom!=0.0) t = ios_clamp((ADotT*BDotB - BDotT*ADotB) / Denom, 0.0, 1.0); else - t = 0.0f; + t = 0.0; // find u for point on ray (q, b) closest to point at t - Standard_Real u; - if(BDotB!=0.0f) + double u; + if(BDotB!=0.0) { u = (t*ADotB - BDotT) / BDotB; // if u is on segment (q, b), t and u correspond to closest points, otherwise, clamp u, recompute and clamp t - if(u<0.0f) + if(u<0.0) { - u = 0.0f; - if(ADotA!=0.0f) + u = 0.0; + if(ADotA!=0.0) t = ios_clamp(ADotT / ADotA, 0.0, 1.0); else - t = 0.0f; + t = 0.0; } - else if(u > 1.0f) + else if(u > 1.0) { - u = 1.0f; - if(ADotA!=0.0f) + u = 1.0; + if(ADotA!=0.0) t = ios_clamp((ADotB + ADotT) / ADotA, 0.0, 1.0); else - t = 0.0f; + t = 0.0; } } else { - u = 0.0f; - if(ADotA!=0.0f) + u = 0.0; + if(ADotA!=0.0) t = ios_clamp(ADotT / ADotA, 0.0, 1.0); else - t = 0.0f; + t = 0.0; } x = p + a * t; @@ -191,7 +191,7 @@ void edgeEdgeDist(gp_Vec& x, gp_Vec& y, // closest points // https://github.com/NVIDIA-Omniverse/PhysX/blob/main/LICENSE.md // https://github.com/NVIDIA-Omniverse/PhysX/blob/main/physx/source/geomutils/src/distance/GuDistanceTriangleTriangle.cpp // With minor modifications to use gp_Vec type. -float distanceTriangleTriangleSquared(gp_Vec& cp, gp_Vec& cq, const std::array p, const std::array q) +double distanceTriangleTriangleSquared(gp_Vec& cp, gp_Vec& cq, const std::array p, const std::array q) { std::array Sv; Sv[0] = p[1] - p[0]; @@ -206,7 +206,7 @@ float distanceTriangleTriangleSquared(gp_Vec& cp, gp_Vec& cq, const std::array=3) id-=3; gp_Vec Z = p[id] - cp; - float a = Z.Dot(V); + double a = Z.Dot(V); id = j+2; if(id>=3) id-=3; Z = q[id] - cq; - float b = Z.Dot(V); + double b = Z.Dot(V); if((a<=0.0f) && (b>=0.0f)) return V.Dot(V); @@ -246,7 +246,7 @@ float distanceTriangleTriangleSquared(gp_Vec& cp, gp_Vec& cq, const std::array1e-15f) { @@ -294,7 +294,7 @@ float distanceTriangleTriangleSquared(gp_Vec& cp, gp_Vec& cq, const std::array1e-15f) { @@ -359,8 +359,8 @@ float distanceTriangleTriangleSquared(gp_Vec& cp, gp_Vec& cq, const std::array max) { max = d; maxPoint = p; } @@ -407,7 +407,7 @@ namespace { // https://github.com/NVIDIA-Omniverse/PhysX/blob/main/LICENSE.md // https://github.com/NVIDIA-Omniverse/PhysX/blob/main/physx/source/geomutils/src/intersection/GuIntersectionTriangleTriangle.cpp // With minor modifications to use gp_Vec type. -static Interval computeInterval(Standard_Real distanceA, Standard_Real distanceB, Standard_Real distanceC, const gp_Vec& a, const gp_Vec& b, const gp_Vec& c, const gp_Vec& dir) +static Interval computeInterval(double distanceA, double distanceB, double distanceC, const gp_Vec& a, const gp_Vec& b, const gp_Vec& c, const gp_Vec& dir) { Interval i; @@ -441,7 +441,7 @@ static Interval computeInterval(Standard_Real distanceA, Standard_Real distanceB // https://github.com/NVIDIA-Omniverse/PhysX/blob/main/LICENSE.md // https://github.com/NVIDIA-Omniverse/PhysX/blob/main/physx/source/geomutils/src/intersection/GuIntersectionTriangleTriangle.cpp // With minor modifications to use gp_Vec type. -Standard_Real orient2d(const gp_Vec& a, const gp_Vec& b, const gp_Vec& c, PxU32 x, PxU32 y) +double orient2d(const gp_Vec& a, const gp_Vec& b, const gp_Vec& c, PxU32 x, PxU32 y) { return (a.Coord(y) - c.Coord(y)) * (b.Coord(x) - c.Coord(x)) - (a.Coord(x) - c.Coord(x)) * (b.Coord(y) - c.Coord(y)); } @@ -450,11 +450,11 @@ Standard_Real orient2d(const gp_Vec& a, const gp_Vec& b, const gp_Vec& c, PxU32 // https://github.com/NVIDIA-Omniverse/PhysX/blob/main/LICENSE.md // https://github.com/NVIDIA-Omniverse/PhysX/blob/main/physx/source/geomutils/src/intersection/GuIntersectionTriangleTriangle.cpp // With minor modifications to use gp_Vec type. -Standard_Real pointInTriangle(const gp_Vec& a, const gp_Vec& b, const gp_Vec& c, const gp_Vec& point, PxU32 x, PxU32 y) +double pointInTriangle(const gp_Vec& a, const gp_Vec& b, const gp_Vec& c, const gp_Vec& point, PxU32 x, PxU32 y) { - const Standard_Real ab = orient2d(a, b, point, x, y); - const Standard_Real bc = orient2d(b, c, point, x, y); - const Standard_Real ca = orient2d(c, a, point, x, y); + const double ab = orient2d(a, b, point, x, y); + const double bc = orient2d(b, c, point, x, y); + const double ca = orient2d(c, a, point, x, y); if ((ab >= 0) == (bc >= 0) && (ab >= 0) == (ca >= 0)) return true; @@ -466,16 +466,16 @@ Standard_Real pointInTriangle(const gp_Vec& a, const gp_Vec& b, const gp_Vec& c, // https://github.com/NVIDIA-Omniverse/PhysX/blob/main/LICENSE.md // https://github.com/NVIDIA-Omniverse/PhysX/blob/main/physx/source/geomutils/src/intersection/GuIntersectionTriangleTriangle.cpp // With minor modifications to use gp_Vec type. -Standard_Real linesIntersect(const gp_Vec& startA, const gp_Vec& endA, const gp_Vec& startB, const gp_Vec& endB, PxU32 x, PxU32 y) +double linesIntersect(const gp_Vec& startA, const gp_Vec& endA, const gp_Vec& startB, const gp_Vec& endB, PxU32 x, PxU32 y) { - const Standard_Real aaS = orient2d(startA, endA, startB, x, y); - const Standard_Real aaE = orient2d(startA, endA, endB, x, y); + const double aaS = orient2d(startA, endA, startB, x, y); + const double aaE = orient2d(startA, endA, endB, x, y); if ((aaS >= 0) == (aaE >= 0)) return false; - const Standard_Real bbS = orient2d(startB, endB, startA, x, y); - const Standard_Real bbE = orient2d(startB, endB, endA, x, y); + const double bbS = orient2d(startB, endB, startA, x, y); + const double bbE = orient2d(startB, endB, endA, x, y); if ((bbS >= 0) == (bbE >= 0)) return false; @@ -521,7 +521,7 @@ bool trianglesIntersectCoplanar(const gp_Vec& p1_n, const gp_Vec& a1, const gp_V PxU32 y = 0; getProjectionIndices(p1_n, x, y); - const Standard_Real third = (1.0f / 3.0f); + const double third = (1.0 / 3.0); //A bit of the computations done inside the following functions could be shared but it's kept simple since the //difference is not very big and the coplanar case is not expected to be the most common case @@ -541,14 +541,14 @@ bool trianglesIntersectCoplanar(const gp_Vec& p1_n, const gp_Vec& a1, const gp_V // Also with minor modification to return intersection points. bool trianglesIntersect(const gp_Vec& a1, const gp_Vec& b1, const gp_Vec& c1, const gp_Vec& a2, const gp_Vec& b2, const gp_Vec& c2/*, Segment* intersection*/, gp_Vec& int1, gp_Vec& int2, bool ignoreCoplanar) { - const Standard_Real tolerance = 1e-8f; + const double tolerance = 1e-8f; gp_Vec p1_n((b1 - a1).Crossed(c1 - a1).Normalized()); double p1_d = -a1.Dot(p1_n); // const PxPlane p1(a1, b1, c1); - const Standard_Real p1ToA = a2.Dot(p1_n) + p1_d; - const Standard_Real p1ToB = b2.Dot(p1_n) + p1_d; - const Standard_Real p1ToC = c2.Dot(p1_n) + p1_d; + const double p1ToA = a2.Dot(p1_n) + p1_d; + const double p1ToB = b2.Dot(p1_n) + p1_d; + const double p1ToC = c2.Dot(p1_n) + p1_d; if(std::abs(p1ToA) < tolerance && std::abs(p1ToB) < tolerance &&std::abs(p1ToC) < tolerance) return ignoreCoplanar ? false : trianglesIntersectCoplanar(p1_n, a1, b1, c1, a2, b2, c2); //Coplanar triangles @@ -559,15 +559,15 @@ bool trianglesIntersect(const gp_Vec& a1, const gp_Vec& b1, const gp_Vec& c1, co gp_Dir p2_n((b2 - a2).Crossed(c2 - a2).Normalized()); double p2_d = -a2.Dot(p2_n); // const PxPlane p2(a2, b2, c2); - const Standard_Real p2ToA = a1.Dot(p2_n) + p2_d; - const Standard_Real p2ToB = b1.Dot(p2_n) + p2_d; - const Standard_Real p2ToC = c1.Dot(p2_n) + p2_d; + const double p2ToA = a1.Dot(p2_n) + p2_d; + const double p2ToB = b1.Dot(p2_n) + p2_d; + const double p2ToC = c1.Dot(p2_n) + p2_d; if ((p2ToA > 0) == (p2ToB > 0) && (p2ToA > 0) == (p2ToC > 0)) return false; //All points of triangle 1 on same side of triangle 2 -> no intersection gp_Vec intersectionDirection = p1_n.Crossed(p2_n); - const Standard_Real l2 = intersectionDirection.SquareMagnitude(); + const double l2 = intersectionDirection.SquareMagnitude(); intersectionDirection *= 1.0f / std::sqrt(l2); const Interval i1 = computeInterval(p2ToA, p2ToB, p2ToC, a1, b1, c1, intersectionDirection); diff --git a/src/ifcgeom/kernels/opencascade/clash_utils.h b/src/ifcgeom/kernels/opencascade/clash_utils.h index d10f703b7f..f8a1cb677c 100644 --- a/src/ifcgeom/kernels/opencascade/clash_utils.h +++ b/src/ifcgeom/kernels/opencascade/clash_utils.h @@ -19,13 +19,13 @@ IFC_GEOMLIBRARY_API bool is_intersect_ray_box(const struct ray *ray, const struc IFC_GEOMLIBRARY_API bool intersectRayTriangle( const gp_Vec& orig, const gp_Vec& dir, const gp_Vec& vert0, const gp_Vec& vert1, const gp_Vec& vert2, - Standard_Real& at, Standard_Real& au, Standard_Real& av, + double& at, double& au, double& av, bool cull, float enlarge=0.0f); IFC_GEOMLIBRARY_API void edgeEdgeDist(gp_Vec& x, gp_Vec& y, // closest points const gp_Vec& p, const gp_Vec& a, // seg 1 origin, vector const gp_Vec& q, const gp_Vec& b); // seg 2 origin, vector -IFC_GEOMLIBRARY_API float distanceTriangleTriangleSquared(gp_Vec& cp, gp_Vec& cq, const std::array p, const std::array q); +IFC_GEOMLIBRARY_API double distanceTriangleTriangleSquared(gp_Vec& cp, gp_Vec& cq, const std::array p, const std::array q); IFC_GEOMLIBRARY_API bool trianglesIntersect(const gp_Vec& a1, const gp_Vec& b1, const gp_Vec& c1, const gp_Vec& a2, const gp_Vec& b2, const gp_Vec& c2/*, Segment* intersection*/, gp_Vec& int1, gp_Vec& int2, bool ignoreCoplanar); diff --git a/src/ifcgeom/kernels/opencascade/face.cpp b/src/ifcgeom/kernels/opencascade/face.cpp index d4b41b5851..024ff0f13b 100644 --- a/src/ifcgeom/kernels/opencascade/face.cpp +++ b/src/ifcgeom/kernels/opencascade/face.cpp @@ -31,7 +31,12 @@ #include #include #include -#include + +#include +#include +#include +#include + #include #include #include @@ -275,7 +280,7 @@ bool OpenCascadeKernel::convert(const taxonomy::face::ptr face, TopoDS_Shape& re fd.surface() = convert_surface(face->basis); } - const int num_bounds = face->children.size(); + const size_t num_bounds = face->children.size(); int num_outer_bounds = 0; for (auto& bound : face->children) { @@ -298,7 +303,7 @@ bool OpenCascadeKernel::convert(const taxonomy::face::ptr face, TopoDS_Shape& re fd.all_outer() = true; } - TopTools_DataMapOfShapeInteger wire_senses; + NCollection_DataMap wire_senses; for (int process_interior = 0; process_interior <= 1; ++process_interior) { for (auto& bound : face->children) { @@ -334,7 +339,7 @@ bool OpenCascadeKernel::convert(const taxonomy::face::ptr face, TopoDS_Shape& re 0., settings_.get().get() }; - TopTools_ListOfShape results; + NCollection_List results; if (settings.use_wire_intersection_check && util::wire_intersections(wire, results, settings)) { Logger::Root().Warning("GEO", 161, "Self-intersections with " + boost::lexical_cast(results.Extent()) + " cycles detected"); util::select_largest(results, wire); @@ -400,7 +405,7 @@ bool OpenCascadeKernel::convert(const taxonomy::face::ptr face, TopoDS_Shape& re } } - TopTools_ListOfShape face_list; + NCollection_List face_list; if (fd.surface().IsNull()) { // The set of wires is triangulated in case no surface can be found @@ -408,7 +413,7 @@ bool OpenCascadeKernel::convert(const taxonomy::face::ptr face, TopoDS_Shape& re if (fd.all_outer()) { for (const auto& w : fd.wires()) { - TopTools_ListOfShape fl; + NCollection_List fl; auto r = triangulate_wire({ w }, fl); if (r == util::TRIANGULATE_WIRE_FAIL) { continue; @@ -500,7 +505,7 @@ bool OpenCascadeKernel::convert(const taxonomy::face::ptr face, TopoDS_Shape& re // In case of (non-planar) face surface, p-curves need to be computed. // For planar faces, Open Cascade generates p-curves on the fly. - for (TopTools_ListIteratorOfListOfShape it(face_list); it.More(); it.Next()) { + for (NCollection_List::Iterator it(face_list); it.More(); it.Next()) { ShapeFix_Shape sfs(it.Value()); Handle(ShapeExtend_MsgRegistrator) msg; @@ -533,7 +538,7 @@ bool OpenCascadeKernel::convert(const taxonomy::face::ptr face, TopoDS_Shape& re } } - for (TopTools_ListIteratorOfListOfShape it(face_list); it.More(); it.Next()) { + for (NCollection_List::Iterator it(face_list); it.More(); it.Next()) { const TopoDS_Face& occ_face = TopoDS::Face(it.Value()); ShapeFix_Face sfs(TopoDS::Face(occ_face)); @@ -558,7 +563,7 @@ bool OpenCascadeKernel::convert(const taxonomy::face::ptr face, TopoDS_Shape& re it.Value() = sfs.Face(); } - for (TopTools_ListIteratorOfListOfShape it(face_list); it.More(); it.Next()) { + for (NCollection_List::Iterator it(face_list); it.More(); it.Next()) { TopoDS_Face& occ_face = TopoDS::Face(it.Value()); bool all_reversed = true; @@ -582,7 +587,7 @@ bool OpenCascadeKernel::convert(const taxonomy::face::ptr face, TopoDS_Shape& re TopoDS_Compound compound; BRep_Builder builder; builder.MakeCompound(compound); - for (TopTools_ListIteratorOfListOfShape it(face_list); it.More(); it.Next()) { + for (NCollection_List::Iterator it(face_list); it.More(); it.Next()) { TopoDS_Face& occ_face = TopoDS::Face(it.Value()); builder.Add(compound, occ_face); } diff --git a/src/ifcgeom/kernels/opencascade/faceset_helper.cpp b/src/ifcgeom/kernels/opencascade/faceset_helper.cpp index dd943fd5e4..e86276f1c6 100644 --- a/src/ifcgeom/kernels/opencascade/faceset_helper.cpp +++ b/src/ifcgeom/kernels/opencascade/faceset_helper.cpp @@ -241,7 +241,7 @@ bool IfcGeom::OpenCascadeKernel::faceset_helper::edge(int A, int B, TopoDS_Edge& } bool IfcGeom::OpenCascadeKernel::faceset_helper::wire(const ifcopenshell::geometry::taxonomy::loop::ptr loop, TopoDS_Wire& w) { - TopTools_ListOfShape ws; + NCollection_List ws; if (!wires(loop, ws)) { return false; } @@ -249,7 +249,7 @@ bool IfcGeom::OpenCascadeKernel::faceset_helper::wire(const ifcopenshell::geomet return true; } -bool IfcGeom::OpenCascadeKernel::faceset_helper::wires(const ifcopenshell::geometry::taxonomy::loop::ptr loop, TopTools_ListOfShape& wires) { +bool IfcGeom::OpenCascadeKernel::faceset_helper::wires(const ifcopenshell::geometry::taxonomy::loop::ptr loop, NCollection_List& wires) { if (duplicates_.find(loop->identity()) != duplicates_.end()) { return false; } @@ -270,7 +270,7 @@ bool IfcGeom::OpenCascadeKernel::faceset_helper::wires(const ifcopenshell::geome if (count >= 3) { wire.Closed(true); - TopTools_ListOfShape results; + NCollection_List results; if (!kernel_->settings().get().get() && util::wire_intersections(wire, results, { !kernel_->settings().get().get(), !kernel_->settings().get().get(), 0., diff --git a/src/ifcgeom/kernels/opencascade/layerset.cpp b/src/ifcgeom/kernels/opencascade/layerset.cpp index 4e9fa1918d..5090e3b02d 100644 --- a/src/ifcgeom/kernels/opencascade/layerset.cpp +++ b/src/ifcgeom/kernels/opencascade/layerset.cpp @@ -13,7 +13,10 @@ #include #include #include -#include + +#include +#include +#include #include @@ -43,14 +46,14 @@ namespace { } #if OCC_VERSION_HEX >= 0x70200 - bool split(const TopoDS_Shape& input, const TopTools_ListOfShape& operands, double eps, std::vector& slices) { + bool split(const TopoDS_Shape& input, const NCollection_List& operands, double eps, std::vector& slices) { if (operands.Extent() < 2) { // Needs to have at least two cutting surfaces for the ordering based on surface containment to work. return false; } BRepAlgoAPI_Splitter split; - TopTools_ListOfShape input_list; + NCollection_List input_list; input_list.Append(input); split.SetArguments(input_list); split.SetTools(operands); @@ -66,7 +69,7 @@ namespace { // NB 1, since first surface has been excluded int i = 1; - for (TopTools_ListIteratorOfListOfShape it(operands); it.More(); it.Next(), ++i) { + for (NCollection_List::Iterator it(operands); it.More(); it.Next(), ++i) { TopExp_Explorer exp(it.Value(), TopAbs_FACE); for (; exp.More(); exp.Next()) { surfaces.insert(std::make_pair(BRep_Tool::Surface(TopoDS::Face(exp.Current())).get(), i)); @@ -172,7 +175,7 @@ bool IfcGeom::util::apply_folded_layerset(const ConversionResults& items, const typedef std::vector< std::vector> > folded_surfaces_t; typedef std::vector< std::pair< TopoDS_Face, std::pair > > faces_with_mass_t; - TopTools_ListOfShape shells; + NCollection_List shells; for (folded_surfaces_t::const_iterator it = surfaces.begin(); it != surfaces.end(); ++it) { if (it->empty()) { @@ -336,7 +339,7 @@ bool IfcGeom::util::apply_layerset(const ConversionResults& items, const std::ve const TopoDS_Shape& s = std::static_pointer_cast(it->Shape())->shape(); TopoDS_Shape sld = ensure_fit_for_subtraction(s, tol); - TopTools_ListOfShape operands; + NCollection_List operands; for (unsigned i = 1; i < surfaces.size() - 1; ++i) { double u1, v1, u2, v2; if (!project(surfaces[i], sld, u1, v1, u2, v2)) { @@ -406,7 +409,7 @@ bool IfcGeom::util::split_solid_by_shell(const TopoDS_Shape& input, const TopoDS } #if OCC_VERSION_HEX >= 0x70300 - TopTools_ListOfShape shapes; + NCollection_List shapes; #else BOPCol_ListOfShape shapes; #endif diff --git a/src/ifcgeom/kernels/opencascade/loft.cpp b/src/ifcgeom/kernels/opencascade/loft.cpp index e7226c59ec..9c37a80ff3 100644 --- a/src/ifcgeom/kernels/opencascade/loft.cpp +++ b/src/ifcgeom/kernels/opencascade/loft.cpp @@ -157,7 +157,7 @@ bool OpenCascadeKernel::convert(const taxonomy::loft::ptr loft, TopoDS_Shape& re return true; } - TopTools_ListOfShape faces; + NCollection_List faces; TopoDS_Compound comp; BRep_Builder BB; BB.MakeCompound(comp); @@ -307,7 +307,7 @@ bool OpenCascadeKernel::convert(const taxonomy::loft::ptr loft, TopoDS_Shape& re all_tags.begin() + std::distance(shps.begin(), jt)}; for (size_t i = 0; i < 2; ++i) { - NCollection_IndexedDataMap ancestors; + NCollection_IndexedDataMap, TopTools_ShapeMapHasher> ancestors; const auto& wire = wp[i]; auto& result = profile_points[i]; @@ -328,9 +328,9 @@ bool OpenCascadeKernel::convert(const taxonomy::loft::ptr loft, TopoDS_Shape& re break; } - const TopTools_ListOfShape& incidentEdges = ancestors.FindFromKey(curr); + const NCollection_List& incidentEdges = ancestors.FindFromKey(curr); - for (TopTools_ListIteratorOfListOfShape it(incidentEdges); it.More(); it.Next()) { + for (NCollection_List::Iterator it(incidentEdges); it.More(); it.Next()) { const TopoDS_Edge& e = TopoDS::Edge(it.Value()); TopoDS_Vertex ev0, ev1; diff --git a/src/ifcgeom/kernels/opencascade/loop.cpp b/src/ifcgeom/kernels/opencascade/loop.cpp index 8cda46b644..29d74f2c31 100644 --- a/src/ifcgeom/kernels/opencascade/loop.cpp +++ b/src/ifcgeom/kernels/opencascade/loop.cpp @@ -9,14 +9,15 @@ #include #include #include -#include -#include -#include #include #include #include -#include + +#include +#include +#include + #include #include @@ -233,7 +234,7 @@ OpenCascadeKernel::curve_creation_visitor_result_type OpenCascadeKernel::convert #include "../../../ifcparse/IfcFile.h" bool OpenCascadeKernel::convert(const taxonomy::loop::ptr loop, TopoDS_Wire& wire) { - TopTools_ListOfShape converted_segments; + NCollection_List converted_segments; for (auto& segment : loop->children) { TopoDS_Wire segment_wire; @@ -273,7 +274,7 @@ bool OpenCascadeKernel::convert(const taxonomy::loop::ptr loop, TopoDS_Wire& wir BRepBuilderAPI_MakeWire w; TopoDS_Vertex wire_first_vertex, wire_last_vertex, edge_first_vertex, edge_last_vertex; - TopTools_ListIteratorOfListOfShape it(converted_segments); + NCollection_List::Iterator it(converted_segments); bool force_close = false; if (loop->instance && loop->instance->as() && loop->instance->as()->file_) { diff --git a/src/ifcgeom/kernels/opencascade/shell.cpp b/src/ifcgeom/kernels/opencascade/shell.cpp index 943b3f0efb..0f7fce4389 100644 --- a/src/ifcgeom/kernels/opencascade/shell.cpp +++ b/src/ifcgeom/kernels/opencascade/shell.cpp @@ -38,7 +38,7 @@ bool OpenCascadeKernel::convert(const taxonomy::shell::ptr l, TopoDS_Shape& shap ? (faceset_helper_->epsilon() * faceset_helper_->epsilon() / 20.) : minimal_face_area; - TopTools_ListOfShape face_list; + NCollection_List face_list; for (auto& face : l->children) { bool success = false; TopoDS_Face occ_face; @@ -96,7 +96,7 @@ bool OpenCascadeKernel::convert(const taxonomy::shell::ptr l, TopoDS_Shape& shap BRep_Builder builder; builder.MakeCompound(compound); - TopTools_ListIteratorOfListOfShape face_iterator; + NCollection_List::Iterator face_iterator; for (face_iterator.Initialize(face_list); face_iterator.More(); face_iterator.Next()) { builder.Add(compound, face_iterator.Value()); } diff --git a/src/ifcgeom/kernels/opencascade/sweep_along_curve.cpp b/src/ifcgeom/kernels/opencascade/sweep_along_curve.cpp index 208d18755e..a5169864fb 100644 --- a/src/ifcgeom/kernels/opencascade/sweep_along_curve.cpp +++ b/src/ifcgeom/kernels/opencascade/sweep_along_curve.cpp @@ -40,7 +40,7 @@ namespace { bool wire_is_c1_continuous(const TopoDS_Wire& w, double tol) { // NB Note that c0 continuity is NOT checked! - NCollection_IndexedDataMap map; + NCollection_IndexedDataMap, TopTools_ShapeMapHasher> map; TopExp::MapShapesAndAncestors(w, TopAbs_VERTEX, TopAbs_EDGE, map); for (int i = 1; i <= map.Extent(); ++i) { const auto& li = map.FindFromIndex(i); @@ -188,7 +188,7 @@ bool OpenCascadeKernel::convert(const taxonomy::sweep_along_curve::ptr scs, Topo { TopoDS_Vertex v0, v1; TopExp::Vertices(wire, v0, v1); - NCollection_IndexedDataMap m; + NCollection_IndexedDataMap, TopTools_ShapeMapHasher> m; TopExp::MapShapesAndAncestors(wire, TopAbs_VERTEX, TopAbs_EDGE, m); const TopoDS_Edge& edge = TopoDS::Edge(m.FindFromKey(v0).First()); double u0, u1; diff --git a/src/ifcgeom/kernels/opencascade/sweep_utils.cpp b/src/ifcgeom/kernels/opencascade/sweep_utils.cpp index 5280895b5d..628d522a84 100644 --- a/src/ifcgeom/kernels/opencascade/sweep_utils.cpp +++ b/src/ifcgeom/kernels/opencascade/sweep_utils.cpp @@ -27,7 +27,7 @@ bool IfcGeom::util::wire_is_c1_continuous(const TopoDS_Wire & w, double tol) { // NB Note that c0 continuity is NOT checked! - NCollection_IndexedDataMap map; + NCollection_IndexedDataMap, TopTools_ShapeMapHasher> map; TopExp::MapShapesAndAncestors(w, TopAbs_VERTEX, TopAbs_EDGE, map); for (int i = 1; i <= map.Extent(); ++i) { const auto& li = map.FindFromIndex(i); @@ -66,7 +66,7 @@ bool IfcGeom::util::wire_to_ax(const TopoDS_Wire & wire, gp_Ax2 & directrix) { // Find first edge TopoDS_Vertex v0, v1; TopExp::Vertices(wire, v0, v1); - NCollection_IndexedDataMap map; + NCollection_IndexedDataMap, TopTools_ShapeMapHasher> map; TopExp::MapShapesAndAncestors(wire, TopAbs_VERTEX, TopAbs_EDGE, map); if (v0.IsSame(v1) && map.Contains(v0) && map.FindFromKey(v0).Extent() == 2) { // Closed wire, with more than 1 edges @@ -182,7 +182,7 @@ void IfcGeom::util::process_sweep_as_pipe(const TopoDS_Wire & wire, const TopoDS } void IfcGeom::util::sort_edges(const TopoDS_Wire & wire, std::vector& sorted_edges) { - NCollection_IndexedDataMap map; + NCollection_IndexedDataMap, TopTools_ShapeMapHasher> map; TopExp::MapShapesAndAncestors(wire, TopAbs_VERTEX, TopAbs_EDGE, map); for (int i = 1; i <= map.Extent(); ++i) { @@ -209,9 +209,9 @@ void IfcGeom::util::sort_edges(const TopoDS_Wire & wire, std::vector& es = map.FindFromKey(v0); TopoDS_Vertex ve0, ve1; - TopTools_ListIteratorOfListOfShape it(es); + NCollection_List::Iterator it(es); bool added = false; for (; it.More(); it.Next()) { const TopoDS_Edge& e = TopoDS::Edge(it.Value()); diff --git a/src/ifcgeom/kernels/opencascade/wire_utils.cpp b/src/ifcgeom/kernels/opencascade/wire_utils.cpp index 7bb67e7681..41b82c794b 100644 --- a/src/ifcgeom/kernels/opencascade/wire_utils.cpp +++ b/src/ifcgeom/kernels/opencascade/wire_utils.cpp @@ -19,7 +19,11 @@ #include #include #include -#include + +#include +#include +#include + #include #include #include @@ -116,7 +120,7 @@ bool IfcGeom::util::flatten_wire(TopoDS_Wire& wire, double eps) { if (!proj.IsDone()) { return false; } - TopTools_ListOfShape list; + NCollection_List list; proj.BuildWire(list); if (list.Extent() != 1) { return false; @@ -283,11 +287,11 @@ IfcGeom::util::triangulate_wire_result IfcGeom::util::triangulate_wire(const std } } - NCollection_IndexedDataMap mape, mapn; + NCollection_IndexedDataMap, TopTools_ShapeMapHasher> mape, mapn; for (auto& wire : wires) { TopExp::MapShapesAndAncestors(wire, TopAbs_EDGE, TopAbs_WIRE, mape); } - TopTools_ListIteratorOfListOfShape it(faces); + NCollection_List::Iterator it(faces); for (; it.More(); it.Next()) { TopExp::MapShapesAndAncestors(it.Value(), TopAbs_EDGE, TopAbs_WIRE, mapn); } @@ -297,12 +301,12 @@ IfcGeom::util::triangulate_wire_result IfcGeom::util::triangulate_wire(const std for (int i = 1; i <= mape.Extent(); ++i) { #if OCC_VERSION_HEX >= 0x70000 - TopTools_ListOfShape val; + NCollection_List val; if (!mapn.FindFromKey(mape.FindKey(i), val)) { #else bool contains = false; try { - TopTools_ListOfShape val = mapn.FindFromKey(mape.FindKey(i)); + NCollection_List val = mapn.FindFromKey(mape.FindKey(i)); contains = true; } catch (Standard_NoSuchObject&) {} if (!contains) { @@ -597,7 +601,7 @@ void IfcGeom::util::select_largest(const NCollection_List& shapes, } -bool IfcGeom::util::wire_to_sequence_of_point(const TopoDS_Wire& w, TColgp_SequenceOfPnt& p) { +bool IfcGeom::util::wire_to_sequence_of_point(const TopoDS_Wire& w, NCollection_Sequence& p) { TopExp_Explorer exp(w, TopAbs_EDGE); for (; exp.More(); exp.Next()) { double a, b; @@ -624,7 +628,7 @@ bool IfcGeom::util::wire_to_sequence_of_point(const TopoDS_Wire& w, TColgp_Seque return true; } -void IfcGeom::util::sequence_of_point_to_wire(const TColgp_SequenceOfPnt& p, TopoDS_Wire& w, bool close) { +void IfcGeom::util::sequence_of_point_to_wire(const NCollection_Sequence& p, TopoDS_Wire& w, bool close) { BRepBuilderAPI_MakePolygon builder; for (int i = 1; i <= p.Length(); ++i) { builder.Add(p.Value(i)); @@ -635,7 +639,7 @@ void IfcGeom::util::sequence_of_point_to_wire(const TColgp_SequenceOfPnt& p, Top w = builder.Wire(); } -void IfcGeom::util::remove_collinear_points_from_loop(TColgp_SequenceOfPnt& polygon, bool closed, double tol) { +void IfcGeom::util::remove_collinear_points_from_loop(NCollection_Sequence& polygon, bool closed, double tol) { const int start = closed ? 1 : 2; const int end = polygon.Length() - (closed ? 0 : 1); std::vector to_remove(polygon.Length(), false); @@ -659,7 +663,7 @@ void IfcGeom::util::remove_collinear_points_from_loop(TColgp_SequenceOfPnt& poly } } -void IfcGeom::util::remove_duplicate_points_from_loop(TColgp_SequenceOfPnt& polygon, bool closed, double tol) { +void IfcGeom::util::remove_duplicate_points_from_loop(NCollection_Sequence& polygon, bool closed, double tol) { tol *= tol; for (;;) { @@ -697,9 +701,9 @@ namespace { return TopoDS_Vertex(); } - TopoDS_Edge find_next(const TopTools_IndexedMapOfShape& edge_set, const NCollection_IndexedDataMap& vertex_to_edges, const TopoDS_Vertex& current, const TopoDS_Edge& previous_edge) { - const TopTools_ListOfShape& edges = vertex_to_edges.FindFromKey(current); - TopTools_ListIteratorOfListOfShape eit; + TopoDS_Edge find_next(const NCollection_IndexedMap& edge_set, const NCollection_IndexedDataMap, TopTools_ShapeMapHasher>& vertex_to_edges, const TopoDS_Vertex& current, const TopoDS_Edge& previous_edge) { + const NCollection_List& edges = vertex_to_edges.FindFromKey(current); + NCollection_List::Iterator eit; for (eit.Initialize(edges); eit.More(); eit.Next()) { const TopoDS_Edge& edge = TopoDS::Edge(eit.Value()); if (edge.IsSame(previous_edge)) continue; @@ -716,8 +720,8 @@ bool IfcGeom::util::fill_nonmanifold_wires_with_planar_faces(TopoDS_Shape& shape BRepOffsetAPI_Sewing sew; sew.Add(shape); - NCollection_IndexedDataMap edge_to_faces; - NCollection_IndexedDataMap vertex_to_edges; + NCollection_IndexedDataMap, TopTools_ShapeMapHasher> edge_to_faces; + NCollection_IndexedDataMap, TopTools_ShapeMapHasher> vertex_to_edges; std::set visited; NCollection_IndexedMap edge_set; @@ -725,7 +729,7 @@ bool IfcGeom::util::fill_nonmanifold_wires_with_planar_faces(TopoDS_Shape& shape const int num_edges = edge_to_faces.Extent(); for (int i = 1; i <= num_edges; ++i) { - const TopTools_ListOfShape& faces = edge_to_faces.FindFromIndex(i); + const NCollection_List& faces = edge_to_faces.FindFromIndex(i); const int count = faces.Extent(); // Find only the non-manifold edges: Edges that are only part of a // single face and therefore part of the wire(s) we want to fill. @@ -841,7 +845,7 @@ void IfcGeom::util::assert_closed_wire(TopoDS_Wire& wire, double tol) { bool IfcGeom::util::convert_wire_to_face(const TopoDS_Wire& w, TopoDS_Face& face, const IfcGeom::util::wire_tolerance_settings& settings) { TopoDS_Wire wire = w; - TopTools_ListOfShape results; + NCollection_List results; if (settings.use_wire_intersection_check && util::wire_intersections(wire, results, settings)) { Logger::Root().Warning("GEO", 227, "Self-intersections with " + boost::lexical_cast(results.Extent()) + " cycles detected"); diff --git a/src/ifcgeom/kernels/opencascade/wire_utils.h b/src/ifcgeom/kernels/opencascade/wire_utils.h index fcf8f0a5dd..995f272233 100644 --- a/src/ifcgeom/kernels/opencascade/wire_utils.h +++ b/src/ifcgeom/kernels/opencascade/wire_utils.h @@ -12,8 +12,9 @@ #include #include -#include -#include +#include +#include +#include #include @@ -50,10 +51,10 @@ namespace IfcGeom { IFC_GEOMLIBRARY_API void assert_closed_wire(TopoDS_Wire& wire, double tol); IFC_GEOMLIBRARY_API bool fill_nonmanifold_wires_with_planar_faces(TopoDS_Shape& shape, double tol); - IFC_GEOMLIBRARY_API void remove_duplicate_points_from_loop(TColgp_SequenceOfPnt& polygon, bool closed, double tol); - IFC_GEOMLIBRARY_API void remove_collinear_points_from_loop(TColgp_SequenceOfPnt& polygon, bool closed, double tol); - IFC_GEOMLIBRARY_API bool wire_to_sequence_of_point(const TopoDS_Wire&, TColgp_SequenceOfPnt&); - IFC_GEOMLIBRARY_API void sequence_of_point_to_wire(const TColgp_SequenceOfPnt&, TopoDS_Wire&, bool closed); + IFC_GEOMLIBRARY_API void remove_duplicate_points_from_loop(NCollection_Sequence& polygon, bool closed, double tol); + IFC_GEOMLIBRARY_API void remove_collinear_points_from_loop(NCollection_Sequence& polygon, bool closed, double tol); + IFC_GEOMLIBRARY_API bool wire_to_sequence_of_point(const TopoDS_Wire&, NCollection_Sequence&); + IFC_GEOMLIBRARY_API void sequence_of_point_to_wire(const NCollection_Sequence&, TopoDS_Wire&, bool closed); IFC_GEOMLIBRARY_API bool convert_curve_to_wire(const opencascade::handle& curve, TopoDS_Wire& wire); } diff --git a/src/serializers/SvgSerializer.cpp b/src/serializers/SvgSerializer.cpp index 56aba97859..1b27ce2159 100644 --- a/src/serializers/SvgSerializer.cpp +++ b/src/serializers/SvgSerializer.cpp @@ -1119,7 +1119,7 @@ void SvgSerializer::write(const geometry_data& data) { TopoDS_Compound profile_edges; if (profile_threshold_ != -1 && !(data.product->declaration().is("IfcWall") || data.product->declaration().is("IfcSlab"))) { - NCollection_IndexedDataMap map; + NCollection_IndexedDataMap, TopTools_ShapeMapHasher> map; TopExp::MapShapesAndAncestors(*compound_to_hlr, TopAbs_EDGE, TopAbs_FACE, map); if (map.Extent() > profile_threshold_) { BRep_Builder BB; @@ -1434,8 +1434,8 @@ void SvgSerializer::write(const geometry_data& data) { result = make_transform_mirror_.Shape(); } - opencascade::handle edges = new TopTools_HSequenceOfShape(); - opencascade::handle wires = new TopTools_HSequenceOfShape(); + opencascade::handle> edges = new NCollection_HSequence(); + opencascade::handle> wires = new NCollection_HSequence(); { TopExp_Explorer exp(result, TopAbs_EDGE); for (; exp.More(); exp.Next()) {