------------------------------------------------------------------------------ Check if point ptId exist in the hash table
| 487 | //------------------------------------------------------------------------------ |
| 488 | // Check if point ptId exist in the hash table |
| 489 | int vtkGenericEdgeTable::CheckPoint(vtkIdType ptId) |
| 490 | { |
| 491 | int index; |
| 492 | vtkIdType pos = this->HashFunction(ptId); |
| 493 | |
| 494 | if (static_cast<unsigned>(pos) >= this->HashPoints->PointVector.size()) |
| 495 | { |
| 496 | return 0; |
| 497 | } |
| 498 | |
| 499 | assert( |
| 500 | "check: valid range pos" && static_cast<unsigned>(pos) < this->HashPoints->PointVector.size()); |
| 501 | |
| 502 | // Be careful with reference the equal is not overloaded |
| 503 | vtkEdgeTablePoints::VectorPointTableType& vect = this->HashPoints->PointVector[pos]; |
| 504 | |
| 505 | int vectsize = static_cast<int>(vect.size()); |
| 506 | for (index = 0; index < vectsize; index++) |
| 507 | { |
| 508 | if (vect[index].PointId == ptId) |
| 509 | { |
| 510 | return 1; |
| 511 | } |
| 512 | } |
| 513 | |
| 514 | if (index == vectsize) |
| 515 | { |
| 516 | // We did not find any corresponding entry |
| 517 | return 0; |
| 518 | } |
| 519 | |
| 520 | vtkErrorMacro(<< "Error, impossible case"); |
| 521 | return -1; |
| 522 | } |
| 523 | |
| 524 | //------------------------------------------------------------------------------ |
| 525 | // Find point coordinate and scalar associated of point ptId |
no test coverage detected