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#, point id
(p,xy,data)
| 137 | return errors |
| 138 | |
| 139 | def pointPick(p,xy,data): |
| 140 | """ |
| 141 | Pick a prop. camera has been positioned such that a ray pick at |
| 142 | screen-coordinates p hits points with x-y coordinates xy. |
| 143 | data contains: expected pick result, block#, point id |
| 144 | """ |
| 145 | errors = 0 |
| 146 | result=pointPicker.Pick(p[0],p[1],0,r)==1 |
| 147 | if result != data[0]: |
| 148 | print('point pick at {} result: expected {} actual {}' |
| 149 | .format(xy,data[0],result)) |
| 150 | errors+=1 |
| 151 | if pointPicker.GetFlatBlockIndex() != data[1]: |
| 152 | print('point pick at {} flat block index expected {} actual {}' |
| 153 | .format(xy,data[1],pointPicker.GetFlatBlockIndex())) |
| 154 | errors+=1 |
| 155 | if pointPicker.GetPointId() != data[2]: |
| 156 | print('point pick at {} point id expected {} actual {}' |
| 157 | .format(xy,data[2],pointPicker.GetPointId())) |
| 158 | errors+=1 |
| 159 | if debug and errors: |
| 160 | if result>0: |
| 161 | if pointPicker.GetFlatBlockIndex(): |
| 162 | print('point pick at {} picked point {} of block {}' |
| 163 | .format(xy,pointPicker.GetPointId(),pointPicker.GetFlatBlockIndex())) |
| 164 | else: |
| 165 | print('point pick at {} picked point {}' |
| 166 | .format(xy,pointPicker.GetPointId())) |
| 167 | else: |
| 168 | print('point pick at {} result:{}'.format(xy,result)) |
| 169 | return errors |
| 170 | |
| 171 | def cellPick(p,xy,data): |
| 172 | """ |
no test coverage detected