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

Function propPick

Rendering/Core/Testing/Python/pickCompositeData.py:113–137  ·  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 contains: expected pick result, block#

(p,xy,data)

Source from the content-addressed store, hash-verified

111debug=False
112
113def propPick(p,xy,data):
114 """
115 Pick a prop. camera has been positioned such that a ray pick at
116 screen-coordinates p hits points with x-y coordinates xy.
117 data contains: expected pick result, block#
118 """
119 errors = 0
120 result=propPicker.Pick(p[0],p[1],0,r)==1
121 if result != data[0]:
122 print('prop pick at {} result: expected {} actual {}'
123 .format(xy,data[0],result))
124 errors+=1
125 if propPicker.GetFlatBlockIndex() != data[1]:
126 print('prop pick at {} flat block index expected {} actual {}'
127 .format(xy,data[1],propPicker.GetFlatBlockIndex()))
128 errors+=1
129
130 if debug and errors:
131 if result>0:
132 if propPicker.GetFlatBlockIndex():
133 print('prop pick at {} picked block {}'
134 .format(xy,propPicker.GetFlatBlockIndex()))
135 else:
136 print('prop pick at {} result:{}'.format(xy,result))
137 return errors
138
139def pointPick(p,xy,data):
140 """

Callers 1

pickFunction · 0.85

Calls 3

printFunction · 0.50
PickMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected