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

Function vtkTableToGraphFindVertices

Infovis/Core/vtkTableToGraph.cxx:298–324  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

296
297//------------------------------------------------------------------------------
298void vtkTableToGraphFindVertices(vtkAbstractArray* arr, // The raw edge table column
299 vtkIdType size, // The size of the edge table column
300 std::map<std::pair<vtkStdString, vtkVariant>, vtkIdType, vtkTableToGraphCompare>& vertexMap,
301 // A map of domain-value pairs to graph id
302 vtkStringArray* domainArr, // The domain of each vertex
303 vtkStringArray* labelArr, // The label of each vertex
304 vtkVariantArray* idArr, // The pedigree id of each vertex
305 vtkIdType& curVertex, // The current vertex id
306 vtkTable* vertexTable, // An array that holds the actual value of each vertex
307 vtkStdString domain) // The domain of the array
308{
309 for (vtkIdType i = 0; i < size; i++)
310 {
311 vtkVariant val = arr->GetVariantValue(i);
312 std::pair<vtkStdString, vtkVariant> value(domain, val);
313 if (vertexMap.count(value) == 0)
314 {
315 vtkIdType row = vertexTable->InsertNextBlankRow();
316 vertexTable->SetValueByName(row, domain.c_str(), val);
317 vertexMap[value] = row;
318 domainArr->InsertNextValue(domain);
319 labelArr->InsertNextValue(val.ToString());
320 idArr->InsertNextValue(val);
321 curVertex = row;
322 }
323 }
324}
325
326//------------------------------------------------------------------------------
327void vtkTableToGraphFindHiddenVertices(vtkAbstractArray* arr, // The raw edge table column

Callers 1

RequestDataMethod · 0.85

Calls 7

InsertNextBlankRowMethod · 0.80
SetValueByNameMethod · 0.80
GetVariantValueMethod · 0.45
countMethod · 0.45
c_strMethod · 0.45
InsertNextValueMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected