MCPcopy Create free account
hub / github.com/Kitware/ParaView / CheckSelection

Function CheckSelection

Remoting/Application/Testing/Python/PythonSelection.py:31–50  ·  view source on GitHub ↗
(numPoints=None, numCells=None)

Source from the content-addressed store, hash-verified

29
30
31def CheckSelection(numPoints=None, numCells=None):
32 global counter
33 # need to save the active source so we can restore it later
34 source = GetActiveSource()
35 Render()
36 SaveScreenshot("tmp%d.png" % counter)
37 print("Saving %s" % ("tmp%d.png" % counter))
38 counter = counter + 1
39 es = ExtractSelection()
40 es.UpdatePipeline()
41 info = es.GetDataInformation()
42 print("Points and cells:", info.GetNumberOfPoints(), info.GetNumberOfCells())
43 if numPoints is not None:
44 assert numPoints == info.GetNumberOfPoints()
45 if numCells is not None:
46 assert numCells == info.GetNumberOfCells()
47 # del es is not enough, need to also Delete()
48 Delete(es)
49 del es
50 SetActiveSource(source)
51
52
53SetActiveSource(s)

Callers 1

PythonSelection.pyFile · 0.85

Calls 9

GetActiveSourceFunction · 0.85
RenderFunction · 0.85
SaveScreenshotFunction · 0.85
SetActiveSourceFunction · 0.85
DeleteClass · 0.50
UpdatePipelineMethod · 0.45
GetDataInformationMethod · 0.45
GetNumberOfPointsMethod · 0.45
GetNumberOfCellsMethod · 0.45

Tested by

no test coverage detected