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

Method __init__

Web/Python/vtkmodules/web/camera.py:173–216  ·  view source on GitHub ↗
(
        self,
        dataHandler,
        focalPoint,
        position,
        rotationAxis,
        phiAngles,
        translationValues,
    )

Source from the content-addressed store, hash-verified

171
172class 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"]

Callers

nothing calls this directly

Calls 6

registerArgumentMethod · 0.80
updateBasePatternMethod · 0.80
rotateFunction · 0.70
rangeClass · 0.50
appendMethod · 0.45
indexMethod · 0.45

Tested by

no test coverage detected