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

Method GetEdgeId

Common/DataModel/vtkGraph.cxx:1810–1839  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1808
1809//------------------------------------------------------------------------------
1810vtkIdType vtkGraph::GetEdgeId(vtkIdType a, vtkIdType b)
1811{
1812 // Check if there is an edge from b to a
1813 vtkSmartPointer<vtkInEdgeIterator> inEdgeIterator = vtkSmartPointer<vtkInEdgeIterator>::New();
1814 this->GetInEdges(a, inEdgeIterator);
1815
1816 while (inEdgeIterator->HasNext())
1817 {
1818 vtkInEdgeType edge = inEdgeIterator->Next();
1819 if (edge.Source == b)
1820 {
1821 return edge.Id;
1822 }
1823 }
1824
1825 // Check if there is an edge from a to b
1826 vtkSmartPointer<vtkOutEdgeIterator> outEdgeIterator = vtkSmartPointer<vtkOutEdgeIterator>::New();
1827 this->GetOutEdges(a, outEdgeIterator);
1828
1829 while (outEdgeIterator->HasNext())
1830 {
1831 vtkOutEdgeType edge = outEdgeIterator->Next();
1832 if (edge.Target == b)
1833 {
1834 return edge.Id;
1835 }
1836 }
1837
1838 return -1;
1839}
1840
1841//------------------------------------------------------------------------------
1842bool vtkGraph::ToDirectedGraph(vtkDirectedGraph* g)

Callers 15

ReadNewickTreeMethod · 0.80
BuildTreeMethod · 0.80
ReadXMLDataMethod · 0.80
ReadCladeElementMethod · 0.80
WriteVertexMethod · 0.80
TestColumnTreeFunction · 0.80
TestDendrogramItemFunction · 0.80
TestTanglegramItemFunction · 0.80
TestTreeHeatmapItemFunction · 0.80
GetBondIdFunction · 0.80

Calls 5

GetInEdgesMethod · 0.95
GetOutEdgesMethod · 0.95
NewFunction · 0.50
HasNextMethod · 0.45
NextMethod · 0.45

Tested by 7

TestColumnTreeFunction · 0.64
TestDendrogramItemFunction · 0.64
TestTanglegramItemFunction · 0.64
TestTreeHeatmapItemFunction · 0.64
TestGetEdgeIdFunction · 0.64
TestTreeDifferenceFilterFunction · 0.64