(
self,
dataHandler,
focalPoint,
position,
rotationAxis,
phiAngles,
translationValues,
)
| 171 | |
| 172 | class CylindricalCamera(object): |
| 173 | def __init__( |
| 174 | self, |
| 175 | dataHandler, |
| 176 | focalPoint, |
| 177 | position, |
| 178 | rotationAxis, |
| 179 | phiAngles, |
| 180 | translationValues, |
| 181 | ): |
| 182 | self.dataHandler = dataHandler |
| 183 | self.cameraSettings = [] |
| 184 | |
| 185 | # Register arguments to the data handler |
| 186 | self.dataHandler.registerArgument( |
| 187 | priority=0, name="phi", values=phiAngles, ui="slider", loop="modulo" |
| 188 | ) |
| 189 | self.dataHandler.registerArgument( |
| 190 | priority=0, name="n_pos", values=translationValues, ui="slider" |
| 191 | ) |
| 192 | |
| 193 | # Compute all camera settings |
| 194 | for translation in translationValues: |
| 195 | for phi in phiAngles: |
| 196 | phiPos = rotate(rotationAxis, phi, focalPoint, position) |
| 197 | newfocalPoint = tuple( |
| 198 | focalPoint[i] + (translation * rotationAxis[i]) for i in range(3) |
| 199 | ) |
| 200 | transPhiPoint = tuple( |
| 201 | phiPos[i] + (translation * rotationAxis[i]) for i in range(3) |
| 202 | ) |
| 203 | |
| 204 | self.cameraSettings.append( |
| 205 | { |
| 206 | "n_pos": translation, |
| 207 | "n_posIdx": translationValues.index(translation), |
| 208 | "phi": phi, |
| 209 | "phiIdx": phiAngles.index(phi), |
| 210 | "focalPoint": newfocalPoint, |
| 211 | "position": transPhiPoint, |
| 212 | "viewUp": rotationAxis, |
| 213 | } |
| 214 | ) |
| 215 | |
| 216 | self.dataHandler.updateBasePattern() |
| 217 | |
| 218 | def updatePriority(self, priorityList): |
| 219 | keyList = ["n_pos", "phi"] |
nothing calls this directly
no test coverage detected