24 def __init__(self, traj=None, render_mode=gfx.SIMPLE, sel='', parent=None):
25 QWidget.__init__(self, parent, Qt.Tool)
33 self._slider.setOrientation(Qt.Horizontal)
35 self._speed_slider.setOrientation(Qt.Horizontal)
36 self.
_play=QToolButton(self)
41 self._repeat.setText(
'Repeat')
42 self._slider.setTracking(
True)
43 self._play.setText(
'Play')
44 self._play.setCheckable(
True)
45 self._frame.setText(
'Frame: ')
46 self._frameNo.setNum(0)
47 self._frameNo.setAlignment(Qt.AlignRight)
48 self._frameEnd.setText(
'/ '+ str(traj.GetFrameCount()-1))
49 self._frameEnd.setAlignment(Qt.AlignLeft)
50 self._speed_slider.setTracking(
True)
51 self._speed_slider.setRange(-1000,-1)
52 self._speed_slider.value=-100
53 hb.addWidget(self.
_play)
65 QObject.connect(self.
_play, SIGNAL(
'toggled(bool)'),
67 QObject.connect(self.
_slider, SIGNAL(
'valueChanged(int)'),
71 def _SpeedSliderValChanged(self,speed_pos):
73 if self._play.isChecked():
79 self._speed_slider.setSliderPosition(-t)
80 if self._play.isChecked():
84 def _SliderValueChanged(self, pos):
87 self.gfx_entity.UpdatePositions()
89 def _GetCurrentFrame(self):
90 return self._slider.sliderPosition()
92 def _SetCurrentFrame(self, pos):
93 if self._slider.maximum()<pos:
94 if self._repeat.isChecked():
97 pos=self._slider.maximum()
98 self._slider.setSliderPosition(pos)
99 self._frameNo.setNum(pos)
101 current_frame=property(_GetCurrentFrame, _SetCurrentFrame)
104 self.gfx_entity.BlurSnapshot()
108 self.gfx_entity.UpdatePositions()
110 def _TogglePlay(self, playing):
116 def _SetTraj(self, traj):
126 self._slider.setMinimum(0)
127 self._slider.setMaximum(self._traj.GetFrameCount()-1)
128 self._slider.setSliderPosition(0)
133 def _SetBlur(self, blur):
134 self.gfx_entity.SetBlur(blur)
137 return self.gfx_entity.GetBlur()
142 blur=property(_GetBlur, _SetBlur)
143 traj=property(_GetTraj, _SetTraj)