Skip to content

Commit

Permalink
fixed test for equality in FacePolygon. Committing the code clumsy as…
Browse files Browse the repository at this point in the history
… it is. (#30)
  • Loading branch information
lene committed Mar 27, 2014
1 parent 0748f7e commit 3417d58
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/Displayable/Object/FacePolygon.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,19 @@ FacePolygon<D, N_vertex>::operator==(const FacePolygon<D, N_vertex> &other) cons
return false;
}
print(); std::cerr << " == "; other.print(); std::cerr << "?\n";
unsigned associated_index[N_vertex];
for (unsigned i = 0; i < N_vertex; ++i) {
std::cerr << *_vertices[_indices[i]] << " == " << *other._vertices[other._indices[i]] << "?\n";
if (_vertices[_indices[i]] != other._vertices[other._indices[i]]) return false;
for (unsigned j = 0; j < N_vertex; ++j) {
if (other._indices[j] == _indices[i]) {
associated_index[i] = j;
break;
}
}
}
for (unsigned i = 0; i < N_vertex; ++i) {
std::cerr << i << ": " << *_vertices[i] << " == "
<< associated_index[i] << ": " << *other._vertices[associated_index[i]] << "?\n";
if (*_vertices[i] != *other._vertices[associated_index[i]]) return false;
}
return true;
}
Expand Down

0 comments on commit 3417d58

Please sign in to comment.