From 94671a176aa983840d8504138cba43656a42ed31 Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Mon, 30 Sep 2019 18:43:53 +0200 Subject: [PATCH] Use STLTrigId instead of int in SearchTree --- libsrc/stlgeom/stltool.cpp | 4 ++-- libsrc/stlgeom/stltool.hpp | 2 +- libsrc/stlgeom/stltopology.hpp | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libsrc/stlgeom/stltool.cpp b/libsrc/stlgeom/stltool.cpp index 8c8963e5..b7134357 100644 --- a/libsrc/stlgeom/stltool.cpp +++ b/libsrc/stlgeom/stltool.cpp @@ -808,7 +808,7 @@ void STLChart :: BuildInnerSearchTree() } } chart_bbox.Increase (1e-2*chart_bbox.Diam()); - inner_searchtree = make_unique> (chart_bbox); + inner_searchtree = make_unique> (chart_bbox); for (STLTrigId trigid : charttrigs) { Box<2> bbox(Box<2>::EMPTY_BOX); @@ -831,7 +831,7 @@ STLTrigId STLChart :: ProjectNormal (Point<3> & p3d) const if (inner_searchtree) { - NgArray trigs; + NgArray trigs; Point<2> p2d = Project2d (p3d); inner_searchtree->GetIntersecting(p2d, p2d, trigs); diff --git a/libsrc/stlgeom/stltool.hpp b/libsrc/stlgeom/stltool.hpp index 8472f395..9312167e 100644 --- a/libsrc/stlgeom/stltool.hpp +++ b/libsrc/stlgeom/stltool.hpp @@ -125,7 +125,7 @@ private: Vec<3> normal; Point<3> pref; Vec<3> t1, t2; - unique_ptr> inner_searchtree; + unique_ptr> inner_searchtree; public: void SetNormal (const Point<3> & apref, const Vec<3> & anormal); const Vec<3> & GetNormal () const { return normal; } diff --git a/libsrc/stlgeom/stltopology.hpp b/libsrc/stlgeom/stltopology.hpp index 2cd65427..ba6bce7e 100644 --- a/libsrc/stlgeom/stltopology.hpp +++ b/libsrc/stlgeom/stltopology.hpp @@ -58,6 +58,7 @@ public: }; inline void SetInvalid (STLTrigId & id) { id = 0; } + inline bool IsInvalid (STLTrigId & id) { return id == 0; } }