From 279a5a2faa2dc03503047a4adec6ab0c1edba057 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Sch=C3=B6berl?= Date: Mon, 23 Sep 2019 09:40:35 +0200 Subject: [PATCH] use boundary_ht, remove unsued functions --- libsrc/stlgeom/stltool.cpp | 9 +++++++-- libsrc/stlgeom/stltool.hpp | 12 ++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/libsrc/stlgeom/stltool.cpp b/libsrc/stlgeom/stltool.cpp index 64600335..326a1b02 100644 --- a/libsrc/stlgeom/stltool.cpp +++ b/libsrc/stlgeom/stltool.cpp @@ -850,6 +850,7 @@ STLBoundary :: STLBoundary (STLGeometry * ageometry) { ; } +/* void STLBoundary :: AddOrDelSegment(const STLBoundarySeg & seg) { bool found = false; @@ -867,6 +868,7 @@ void STLBoundary :: AddOrDelSegment(const STLBoundarySeg & seg) boundary.SetSize(boundary.Size()-1); } } +*/ void STLBoundary ::AddTriangle(const STLTriangle & t) { @@ -1105,12 +1107,15 @@ bool STLBoundary :: TestSeg(const Point<3>& p1, const Point<3> & p2, const Vec<3 double maxl = max2(scalp1, scalp2); Point<3> c = Center (p1, p2); double dist1 = Dist (c, p1); - + + /* int nseg = NOSegments(); for (j = 1; j <= nseg; j++) { const STLBoundarySeg & seg = GetSegment(j); - + */ + for(auto [i2, seg] : boundary_ht) + { if (seg.IsSmoothEdge()) continue; diff --git a/libsrc/stlgeom/stltool.hpp b/libsrc/stlgeom/stltool.hpp index c2a6a493..6e1992aa 100644 --- a/libsrc/stlgeom/stltool.hpp +++ b/libsrc/stlgeom/stltool.hpp @@ -187,23 +187,23 @@ class STLBoundary private: STLGeometry * geometry; const STLChart * chart; - NgArray boundary; + // NgArray boundary; ClosedHashTable boundary_ht; BoxTree<2,INDEX_2> * searchtree = nullptr; public: STLBoundary(STLGeometry * ageometry); ~STLBoundary() { delete searchtree; } - void Clear() {boundary.SetSize(0); boundary_ht = ClosedHashTable(); } + void Clear() { /* boundary.SetSize(0); */ boundary_ht = ClosedHashTable(); } void SetChart (const STLChart * achart) { chart = achart; } //don't check, if already exists! - void AddNewSegment(const STLBoundarySeg & seg) {boundary.Append(seg);}; + // void AddNewSegment(const STLBoundarySeg & seg) {boundary.Append(seg);}; //check if segment exists - void AddOrDelSegment(const STLBoundarySeg & seg); + // void AddOrDelSegment(const STLBoundarySeg & seg); //addordelsegment for all 3 triangle segments! void AddTriangle(const STLTriangle & t); - int NOSegments() {return boundary.Size();}; - const STLBoundarySeg & GetSegment(int i) {return boundary.Get(i);} + int NOSegments() {return boundary_ht.UsedElements();}; + // const STLBoundarySeg & GetSegment(int i) {return boundary.Get(i);} void BuildSearchTree(); void DeleteSearchTree();