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

Method FindVertex

Common/DataModel/vtkGraph.cxx:516–542  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

514
515//------------------------------------------------------------------------------
516vtkIdType vtkGraph::FindVertex(const vtkVariant& pedigreeId)
517{
518 vtkAbstractArray* pedigrees = this->GetVertexData()->GetPedigreeIds();
519 if (pedigrees == nullptr)
520 {
521 return -1;
522 }
523
524 if (vtkDistributedGraphHelper* helper = this->GetDistributedGraphHelper())
525 {
526 vtkIdType myRank = this->Information->Get(vtkDataObject::DATA_PIECE_NUMBER());
527 if (helper->GetVertexOwnerByPedigreeId(pedigreeId) != myRank)
528 {
529 // The vertex is remote; ask the distributed graph helper to find it.
530 return helper->FindVertex(pedigreeId);
531 }
532
533 vtkIdType result = pedigrees->LookupValue(pedigreeId);
534 if (result == -1)
535 {
536 return -1;
537 }
538 return helper->MakeDistributedId(myRank, result);
539 }
540
541 return pedigrees->LookupValue(pedigreeId);
542}
543
544//------------------------------------------------------------------------------
545bool vtkGraph::CheckedShallowCopy(vtkGraph* g)

Callers 4

AddVertexInternalMethod · 0.95
UpdateHoverHighlightMethod · 0.45
GetIdAtPosMethod · 0.45
GetTreeMapIdAtPosMethod · 0.45

Calls 7

GetPedigreeIdsMethod · 0.80
GetVertexDataMethod · 0.80
MakeDistributedIdMethod · 0.80
GetMethod · 0.45
LookupValueMethod · 0.45

Tested by

no test coverage detected