1. German Larrain
  2. ars

Commits

German Larrain  committed a382796

graphics: moved constants related to module 'adapters' to it.

  • Participants
  • Parent commits becd457
  • Branches dev

Comments (0)

Files changed (3)

File ars/TODO.txt

View file
  • Ignore whitespace
 -Add to README.txt a "Contributors" section and/or a "Thanks also to" section to list the names of people who’ve helped.
 
 "Correctness"
--move TIMER_EVENT and KEY_PRESS_EVENT from graphics.__init__ to graphics.adapters
+-
 
 Code structure (modules and packages)
 -convert sensors module into a package

File ars/graphics/__init__.py

View file
  • Ignore whitespace
 from abc import ABCMeta, abstractmethod
 
-TIMER_PERIOD = 50  # milliseconds
-TIMER_EVENT = 'TimerEvent'
-KEY_PRESS_EVENT = 'KeyPressEvent'
-
 
 class Axes(object):
 

File ars/graphics/adapters.py

View file
  • Ignore whitespace
 from ..utils import geometry as gemut
 
 
+TIMER_PERIOD = 50  # milliseconds
+TIMER_EVENT = 'TimerEvent'
+KEY_PRESS_EVENT = 'KeyPressEvent'
+
+
 class VtkAdapter(gp.Adapter):
 
 	"""Graphics adapter to the Visualization Toolkit (VTK) library"""
 		self.render_window.Render()
 
 		# add observers to the RenderWindowInteractor
-		self.interactor.AddObserver(gp.TIMER_EVENT, self._timer_callback)
+		self.interactor.AddObserver(TIMER_EVENT, self._timer_callback)
 		#noinspection PyUnusedLocal
-		timerId = self.interactor.CreateRepeatingTimer(gp.TIMER_PERIOD)
+		timerId = self.interactor.CreateRepeatingTimer(TIMER_PERIOD)
 		self.interactor.AddObserver(
-			gp.KEY_PRESS_EVENT, self._key_press_callback)
+			KEY_PRESS_EVENT, self._key_press_callback)
 		self.interactor.Start()
 
 	def restart_window(self):