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

Function cellPick

Rendering/Core/Testing/Python/pickCompositeData2.py:172–198  ·  view source on GitHub ↗

Pick a prop. camera has been positioned such that a ray pick at screen-coordinates p hits points with x-y coordinates xy. data tuple contents: (expected_result,block#,cell#,point#)

(p,xy,data)

Source from the content-addressed store, hash-verified

170 print(text)
171
172def cellPick(p,xy,data):
173 """
174 Pick a prop. camera has been positioned such that a ray pick at
175 screen-coordinates p hits points with x-y coordinates xy.
176 data tuple contents: (expected_result,block#,cell#,point#)
177 """
178 errors=0
179 what='cell pick at {0}'.format(xy)
180 result=cellPicker.Pick(p[0],p[1],0,r)==1
181 errors += compareExpectedAndActual( '{0} result'.format(what),
182 expectedResult(data),
183 result )
184
185 errors += compareExpectedAndActual( '{0} flat block index'.format(what),
186 expectedBlockId(data),
187 cellPicker.GetFlatBlockIndex())
188
189 errors += compareExpectedAndActual( '{0} cell id'.format(what),
190 expectedCellId(data),
191 cellPicker.GetCellId())
192
193 if errors and debug:
194 reportPickResult(what,result>0,
195 block=cellPicker.GetFlatBlockIndex(),
196 cell=cellPicker.GetCellId(),
197 point=cellPicker.GetPointId())
198 return errors
199
200
201def pick(xy,cellPickData):

Callers 1

pickFunction · 0.70

Calls 9

compareExpectedAndActualFunction · 0.85
expectedResultFunction · 0.85
expectedBlockIdFunction · 0.85
expectedCellIdFunction · 0.85
reportPickResultFunction · 0.85
formatMethod · 0.45
PickMethod · 0.45
GetCellIdMethod · 0.45
GetPointIdMethod · 0.45

Tested by

no test coverage detected