------------------------------------------------------------------------------
| 408 | |
| 409 | //------------------------------------------------------------------------------ |
| 410 | int vtkGenericEdgeTable::CheckEdgeReferenceCount(vtkIdType e1, vtkIdType e2) |
| 411 | { |
| 412 | int index; |
| 413 | OrderEdge(e1, e2); // reorder so that e1 < e2; |
| 414 | |
| 415 | // vtkDebugMacro( << "CheckEdgeReferenceCount:" << e1 << "," << e2 ); |
| 416 | |
| 417 | vtkIdType pos = this->HashFunction(e1, e2); |
| 418 | assert("check: valid range pos" && static_cast<unsigned>(pos) < this->EdgeTable->Vector.size()); |
| 419 | |
| 420 | // Need to check size first |
| 421 | vtkEdgeTableEdge::VectorEdgeTableType& vect = this->EdgeTable->Vector[pos]; |
| 422 | |
| 423 | int vectsize = static_cast<int>(vect.size()); |
| 424 | for (index = 0; index < vectsize; index++) |
| 425 | { |
| 426 | EdgeEntry& ent = vect[index]; |
| 427 | if ((ent.E1 == e1) && (ent.E2 == e2)) |
| 428 | { |
| 429 | assert("check: positive reference" && ent.Reference >= 0); |
| 430 | return ent.Reference; |
| 431 | } |
| 432 | } |
| 433 | |
| 434 | // We did not find any corresponding entry, warn user |
| 435 | vtkErrorMacro(<< "No entry were found in the hash table"); |
| 436 | return -1; |
| 437 | } |
| 438 | |
| 439 | //------------------------------------------------------------------------------ |
| 440 | vtkIdType vtkGenericEdgeTable::HashFunction(vtkIdType e1, vtkIdType e2) |
nothing calls this directly
no test coverage detected