2
나는 mayavi 애니메이션에서 다른 데이터 세트를 순환하기 위해 키보드 이벤트를 잡는 방법을 찾고 있습니다.어떻게 mayavi 애니메이션에서 키보드 이벤트를 잡을 수 있습니까?
내 기본 루프입니다 :이 페이지를 찾을 수
while 1:
time = TIME() - zero
wx.Yield()
atomsanim[:,:3] = atoms[:,3:]*cos(speed*time) + atoms[:,:3]
f.scene.disable_render = True
atom_index = 0
for t, p in zip(types, plots):
ms = p.mlab_source
start = atom_index
stop = atom_index+t
ms.set(x=atomsanim[start:stop,0],y=atomsanim[start:stop,1],z=atomsanim[start:stop,2])
atom_index += t
f.scene.disable_render = False
mlab.show()
Mayavi 마우스 매우 자연적인 지원을하고있다 키보드 이벤트는 선택하지만 키보드 이벤트는 선택하지 않습니다. 키보드 이벤트가 정말로 필요한 경우에는 'UserInteractorStyle'을 추가해야합니다. 이것의 소스 코드는'tvtk/tvtk_classes.zip/interactor_style_user.py'에 있습니다. – aestrivex