Commits

German Larrain  committed f88d8bd

graphics.vtk_adapter: renamed VtkAdapter to Engine.

  • Participants
  • Parent commits 5b8aaf5

Comments (0)

Files changed (3)

File ars/app/__init__.py

 		# (key -> action) mapping
 		self.set_key_2_action_mapping()
 
-		self.gAdapter = gp.VtkAdapter(
+		self.gAdapter = gp.Engine(
 			self.WINDOW_TITLE,
 			self.WINDOW_POSITION,
 			self.WINDOW_SIZE,

File ars/graphics/vtk_adapter.py

 KEY_PRESS_EVENT = 'KeyPressEvent'
 
 
-class VtkAdapter(base.Engine):
+class Engine(base.Engine):
 
 	"""Graphics adapter to the Visualization Toolkit (VTK) library"""
 
             cam_position=(10, 8, 10), background_color=(0.1, 0.1, 0.4),
             **kwargs):
 
-		super(VtkAdapter, self).__init__()
+		super(Engine, self).__init__()
 		self.renderer = vtk.vtkRenderer()
 		self.render_window = None
 		self.interactor = None
 	@staticmethod
 	def _update_pose(obj, pos, rot):
 		trans = gemut.Transform(pos, rot)
-		vtk_tm = VtkAdapter._create_transform_matrix(trans)
-		VtkAdapter._set_object_transform_matrix(obj, vtk_tm)
+		vtk_tm = Engine._create_transform_matrix(trans)
+		Engine._set_object_transform_matrix(obj, vtk_tm)
 
 	def _timer_callback(self, obj, event):
 		self.timer_count += 1
 
 class VtkBody(object):
 
-	adapter = VtkAdapter
+	adapter = Engine
 
 	def __init__(self):
 		self._actor = None

File tests/graphics_adapters.py

-from ars.graphics.vtk_adapter import vtk, VtkAdapter, Axes, Box, Capsule, Cone, Cylinder, Sphere
+from ars.graphics.vtk_adapter import vtk, Engine, Axes, Box, Capsule, Cone, Cylinder, Sphere
 from ars.graphics.vtk_adapter import ScreenshotRecorder
 
 
 def test_adapter_and_objects():
-	gAdapter = VtkAdapter("test")
+	gAdapter = Engine("test")
 
 	axes1 = Axes()
 	axes2 = Axes(cylinder_radius=0.02)
 def test_screenshot_recorder():
 
 	global i
-	gAdapter = VtkAdapter("test")
+	gAdapter = Engine("test")
 	sphere = Sphere(0.5, center=(-2,-2,-2))
 	gAdapter.add_object(sphere)