Skip to content

Commit

Permalink
Changed GmTriSearch::SetTriActivity to set everything active when cal…
Browse files Browse the repository at this point in the history
…led with empty activity array.
  • Loading branch information
wdolinar committed Aug 7, 2018
1 parent 46222b5 commit d32ad50
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions xmsinterp/geometry/GmTriSearch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,12 @@ void GmTriSearchImpl::SetPtActivity(DynBitset& a_activity)
//------------------------------------------------------------------------------
void GmTriSearchImpl::SetTriActivity(DynBitset& a_activity)
{
if (a_activity.empty())
{
m_triActivity = a_activity;
return;
}

XM_ENSURE_TRUE_NO_ASSERT(a_activity.size() == m_tris->size() / 3);

m_triActivity.reset();
Expand Down Expand Up @@ -734,6 +740,12 @@ void TriSearchUnitTests::testTriActivity()

TS_ASSERT_EQUALS(XM_NONE, tris->TriContainingPt(pt));
TS_ASSERT_EQUALS(3, tris->TriContainingPt(pt2));

// setting to empty activity turns on everything
act.clear();
tris->SetTriActivity(act);
TS_ASSERT_EQUALS(0, tris->TriContainingPt(pt));
TS_ASSERT_EQUALS(0, tris->TriContainingPt(pt2));
} // TriSearchUnitTests::testPtActivity
//------------------------------------------------------------------------------
/// \brief A particular test case from SMS that was included
Expand Down

0 comments on commit d32ad50

Please sign in to comment.