From 54fa0d81ec3d0fe4b8cacd59206c8bdbc5c85521 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Sch=C3=B6berl?= Date: Tue, 24 Sep 2019 10:14:52 +0200 Subject: [PATCH] little stl cleanup --- libsrc/stlgeom/stltool.cpp | 29 ++--------------------------- libsrc/stlgeom/stltool.hpp | 7 +++---- 2 files changed, 5 insertions(+), 31 deletions(-) diff --git a/libsrc/stlgeom/stltool.cpp b/libsrc/stlgeom/stltool.cpp index 326a1b02..f5f08865 100644 --- a/libsrc/stlgeom/stltool.cpp +++ b/libsrc/stlgeom/stltool.cpp @@ -691,11 +691,6 @@ void STLChart :: AddOuterTrig(STLTrigId i) bool STLChart :: IsInWholeChart(int nr) const { - // for (int i = 1; i <= charttrigs.Size(); i++) - // if (charttrigs.Get(i) == nr) return true; - // for (int i = 1; i <= outertrigs.Size(); i++) - // if (outertrigs.Get(i) == nr) return true; - // return false; return charttrigs.Contains(nr) || outertrigs.Contains(nr); } @@ -1014,30 +1009,10 @@ void STLBoundary ::AddTriangle(const STLTriangle & t) INDEX_2 op(seg[1], seg[0]); if (boundary_ht.Used(op)) - { - // cout << "delete " << op << endl; - boundary_ht.Delete(op); - } + boundary_ht.Delete(op); else - { - // cout << "insert " << seg << endl; - boundary_ht[seg] = bseg; - } + boundary_ht[seg] = bseg; } - /* - // cout << "bounds = " << boundary << endl; - cout << "bounds:"; - for (auto & val : boundary) - cout << val.I1() << "-" << val.I2() << endl; - cout << "ht = " << boundary_ht << endl; - if (boundary_ht.UsedElements() != boundary.Size()) - { - cout << "wrong count" << endl; - char key; - cin >> key; - } - */ - // NgProfiler::StopTimer (timer_new); } bool STLBoundary :: TestSeg(const Point<3>& p1, const Point<3> & p2, const Vec<3> & sn, diff --git a/libsrc/stlgeom/stltool.hpp b/libsrc/stlgeom/stltool.hpp index 6e1992aa..01ffd34d 100644 --- a/libsrc/stlgeom/stltool.hpp +++ b/libsrc/stlgeom/stltool.hpp @@ -140,11 +140,10 @@ class STLBoundarySeg Point<3> p1, p2, center; Point<2> p2d1, p2d2; Box<2> boundingbox; - // Point<2> p2dmin, p2dmax; double rad; STLPointId i1, i2; - int smoothedge; + bool smoothedge; public: STLBoundarySeg () { ; } STLBoundarySeg (STLPointId ai1, STLPointId ai2, const Array,STLPointId> & points, @@ -177,8 +176,8 @@ public: const Box<2> & BoundingBox() const { return boundingbox; } double Radius () const { return rad; } - void SetSmoothEdge (int se) { smoothedge = se; } - int IsSmoothEdge () const { return smoothedge; } + void SetSmoothEdge (bool se) { smoothedge = se; } + bool IsSmoothEdge () const { return smoothedge; } friend class STLBoundary; };