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

Function TestPolyData

Filters/General/Testing/Cxx/BoxClipPolyData.cxx:58–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56constexpr int numPolySets = 5;
57
58static void TestPolyData(vtkPolyData* data, int num, vtkRenderWindow* renwin,
59 const double minBoxPoint[3], const double maxBoxPoint[3])
60{
61 // Set up test of normal box.
62 VTK_CREATE(vtkBoxClipDataSet, clipper1);
63 clipper1->SetInputData(data);
64 clipper1->GenerateClippedOutputOff();
65 clipper1->SetBoxClip(
66 minBoxPoint[0], maxBoxPoint[0], minBoxPoint[1], maxBoxPoint[1], minBoxPoint[2], maxBoxPoint[2]);
67
68 VTK_CREATE(vtkDataSetSurfaceFilter, surface1);
69 surface1->SetInputConnection(0, clipper1->GetOutputPort(0));
70
71 VTK_CREATE(vtkPolyDataMapper, mapper1);
72 mapper1->SetInputConnection(0, surface1->GetOutputPort(0));
73
74 VTK_CREATE(vtkActor, actor1);
75 actor1->SetMapper(mapper1);
76 actor1->GetProperty()->SetPointSize(3.0f);
77
78 VTK_CREATE(vtkRenderer, renderer1);
79 renderer1->AddActor(actor1);
80 renderer1->SetBackground(0.0, 0.5, 0.5);
81 renderer1->SetViewport(
82 static_cast<double>(num) / numPolySets, 0.75, static_cast<double>(num + 1) / numPolySets, 1.0);
83 renwin->AddRenderer(renderer1);
84
85 // Set up test of normal box with generation of clipped output.
86 VTK_CREATE(vtkBoxClipDataSet, clipper2);
87 clipper2->SetInputData(data);
88 clipper2->GenerateClippedOutputOn();
89 clipper2->SetBoxClip(
90 minBoxPoint[0], maxBoxPoint[0], minBoxPoint[1], maxBoxPoint[1], minBoxPoint[2], maxBoxPoint[2]);
91
92 VTK_CREATE(vtkDataSetSurfaceFilter, surface2_1);
93 surface2_1->SetInputConnection(0, clipper2->GetOutputPort(0));
94
95 VTK_CREATE(vtkPolyDataMapper, mapper2_1);
96 mapper2_1->SetInputConnection(0, surface2_1->GetOutputPort(0));
97
98 VTK_CREATE(vtkActor, actor2_1);
99 actor2_1->SetMapper(mapper2_1);
100 actor2_1->GetProperty()->SetPointSize(3.0f);
101
102 VTK_CREATE(vtkDataSetSurfaceFilter, surface2_2);
103 surface2_2->SetInputConnection(clipper2->GetOutputPort(1));
104
105 VTK_CREATE(vtkPolyDataMapper, mapper2_2);
106 mapper2_2->SetInputConnection(0, surface2_2->GetOutputPort(0));
107
108 VTK_CREATE(vtkActor, actor2_2);
109 actor2_2->SetMapper(mapper2_2);
110 actor2_2->GetProperty()->SetColor(1.0, 0.5, 0.5);
111 actor2_2->GetProperty()->SetPointSize(3.0f);
112
113 VTK_CREATE(vtkRenderer, renderer2);
114 renderer2->AddActor(actor2_1);
115 renderer2->AddActor(actor2_2);

Callers 1

BoxClipPolyDataFunction · 0.70

Calls 11

SetBoxClipMethod · 0.80
SetInputDataMethod · 0.45
SetInputConnectionMethod · 0.45
GetOutputPortMethod · 0.45
SetMapperMethod · 0.45
SetPointSizeMethod · 0.45
GetPropertyMethod · 0.45
AddActorMethod · 0.45
SetViewportMethod · 0.45
AddRendererMethod · 0.45
SetColorMethod · 0.45

Tested by

no test coverage detected