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

Function RenderGraph

Infovis/BoostGraphAlgorithms/Testing/Cxx/TestBoostAlgorithms.cxx:31–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29
30template <typename Algorithm>
31void RenderGraph(vtkRenderer* ren, Algorithm* alg, double xoffset, double yoffset,
32 const char* vertColorArray, double vertMin, double vertMax, const char* edgeColorArray,
33 double edgeMin, double edgeMax)
34{
35 VTK_CREATE(vtkGraphToPolyData, graphToPoly);
36 graphToPoly->SetInputConnection(alg->GetOutputPort());
37
38 VTK_CREATE(vtkGlyphSource2D, glyph);
39 glyph->SetGlyphTypeToVertex();
40 VTK_CREATE(vtkGlyph3D, vertexGlyph);
41 vertexGlyph->SetInputConnection(0, graphToPoly->GetOutputPort());
42 vertexGlyph->SetInputConnection(1, glyph->GetOutputPort());
43 VTK_CREATE(vtkPolyDataMapper, vertexMapper);
44 vertexMapper->SetInputConnection(vertexGlyph->GetOutputPort());
45 vertexMapper->SetScalarModeToUsePointFieldData();
46 if (vertColorArray)
47 {
48 vertexMapper->SelectColorArray(vertColorArray);
49 vertexMapper->SetScalarRange(vertMin, vertMax);
50 }
51 VTK_CREATE(vtkActor, vertexActor);
52 vertexActor->SetMapper(vertexMapper);
53 vertexActor->GetProperty()->SetPointSize(10.0);
54 vertexActor->SetPosition(xoffset, yoffset, 0.001);
55
56 VTK_CREATE(vtkPolyDataMapper, edgeMapper);
57 edgeMapper->SetInputConnection(graphToPoly->GetOutputPort());
58 edgeMapper->SetScalarModeToUseCellFieldData();
59 if (edgeColorArray)
60 {
61 edgeMapper->SelectColorArray(edgeColorArray);
62 edgeMapper->SetScalarRange(edgeMin, edgeMax);
63 }
64 VTK_CREATE(vtkActor, edgeActor);
65 edgeActor->SetMapper(edgeMapper);
66 edgeActor->SetPosition(xoffset, yoffset, 0);
67
68 ren->AddActor(vertexActor);
69 ren->AddActor(edgeActor);
70}
71
72int TestBoostAlgorithms(int argc, char* argv[])
73{

Callers 1

TestBoostAlgorithmsFunction · 0.70

Calls 9

SetInputConnectionMethod · 0.45
GetOutputPortMethod · 0.45
SelectColorArrayMethod · 0.45
SetScalarRangeMethod · 0.45
SetMapperMethod · 0.45
SetPointSizeMethod · 0.45
GetPropertyMethod · 0.45
SetPositionMethod · 0.45
AddActorMethod · 0.45

Tested by

no test coverage detected