Use STLTrigId instead of int in SearchTree

This commit is contained in:
Matthias Hochsteger 2019-09-30 18:43:53 +02:00
parent 693bc66d49
commit 94671a176a
3 changed files with 4 additions and 3 deletions

View File

@ -808,7 +808,7 @@ void STLChart :: BuildInnerSearchTree()
}
}
chart_bbox.Increase (1e-2*chart_bbox.Diam());
inner_searchtree = make_unique<BoxTree<2,int>> (chart_bbox);
inner_searchtree = make_unique<BoxTree<2,STLTrigId>> (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<int> trigs;
NgArray<STLTrigId> trigs;
Point<2> p2d = Project2d (p3d);
inner_searchtree->GetIntersecting(p2d, p2d, trigs);

View File

@ -125,7 +125,7 @@ private:
Vec<3> normal;
Point<3> pref;
Vec<3> t1, t2;
unique_ptr<BoxTree<2,int>> inner_searchtree;
unique_ptr<BoxTree<2,STLTrigId>> inner_searchtree;
public:
void SetNormal (const Point<3> & apref, const Vec<3> & anormal);
const Vec<3> & GetNormal () const { return normal; }

View File

@ -58,6 +58,7 @@ public:
};
inline void SetInvalid (STLTrigId & id) { id = 0; }
inline bool IsInvalid (STLTrigId & id) { return id == 0; }
}