MCPcopy Create free account
hub / github.com/Kitware/VTK / CheckPoint

Method CheckPoint

Common/DataModel/vtkGenericEdgeTable.cxx:489–522  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Check if point ptId exist in the hash table

Source from the content-addressed store, hash-verified

487//------------------------------------------------------------------------------
488// Check if point ptId exist in the hash table
489int 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

Callers 4

CopyPointMethod · 0.80
TessellateMethod · 0.80

Calls 3

HashFunctionMethod · 0.95
assertFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected