File: test_trj.py

package info (click to toggle)
openstructure 2.11.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 206,256 kB
  • sloc: cpp: 188,571; python: 36,686; ansic: 34,298; fortran: 3,275; sh: 312; xml: 146; makefile: 29
file content (27 lines) | stat: -rw-r--r-- 658 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# trajectory generated by Raimund Dutzler
from PyQt5 import QtCore

class Anim(QtCore.QTimer):
    def __init__(self,cg,go):
        QtCore.QTimer.__init__(self)
        self.cg_=cg
        self.go_=go
        self.frame_=0
        self.timeout.connect(self.OnTimer)
        
    def OnTimer(self):
        self.frame_=(self.frame_+1)%self.cg_.GetFrameCount()
        self.cg_.CopyFrame(self.frame_)
        go.UpdatePositions()


eh = io.LoadCRD("mpor_trj.crd")
cg = io.LoadCHARMMTraj(eh,"mpor_trj_short.trj")
go=gfx.Entity("test",eh.CreateFullView())

scene.Add(go)
scene.SetCenter(go.GetCenter())
scene.AutoAutoslab(True)

anim=Anim(cg,go)
anim.start(10)