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

Function buildPolyData

Rendering/PythonContext2D/Testing/Python/testPythonItem.py:92–114  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

90
91
92def buildPolyData():
93 pd = vtkPolyData()
94
95 pts = vtkPoints()
96 pts.InsertNextPoint([0.1, 0.1, 0.0])
97 pts.InsertNextPoint([0.9, 0.9, 0.0])
98
99 pd.SetPoints(pts)
100
101 lines = vtkCellArray()
102 lines.InsertNextCell(2)
103 lines.InsertCellPoint(0)
104 lines.InsertCellPoint(1)
105
106 pd.SetLines(lines)
107
108 colors = vtkUnsignedCharArray()
109 colors.SetNumberOfComponents(4)
110 colors.InsertNextTypedTuple([27, 128, 89, 255])
111
112 pd.GetCellData().SetScalars(colors)
113
114 return pd
115
116
117class TestPythonItem(Testing.vtkTest):

Callers 1

testPythonItemMethod · 0.85

Calls 12

InsertCellPointMethod · 0.80
SetLinesMethod · 0.80
SetScalarsMethod · 0.80
vtkPolyDataClass · 0.50
vtkPointsClass · 0.50
vtkCellArrayClass · 0.50
InsertNextPointMethod · 0.45
SetPointsMethod · 0.45
InsertNextCellMethod · 0.45
SetNumberOfComponentsMethod · 0.45
GetCellDataMethod · 0.45

Tested by

no test coverage detected