Commits

German Larrain committed 65e63c6

graphics.adapters: no code changes, just whitespace and comments.

  • Participants
  • Parent commits 7444176

Comments (0)

Files changed (1)

File ars/graphics/adapters.py

 
 	def start_window(self, on_idle_callback=None, on_reset_callback=None,
                      on_key_press_callback=None):
-		# TODO: refactor according to restart_window(), reset() and the desired behavior
+		# TODO: refactor according to restart_window(), reset() and the
+		# desired behavior.
 		self.on_idle_parent_callback = on_idle_callback
 		self.on_reset_parent_callback = on_reset_callback
 		self.on_key_press_parent_callback = on_key_press_callback
 		if self.on_idle_parent_callback is not None:
 			self.on_idle_parent_callback()
 		iren = obj
-		iren.GetRenderWindow().Render()  # same as self.render_window.Render() ?
+		iren.GetRenderWindow().Render()  # same as self.render_window.Render()?
 
 	def _key_press_callback(self, obj, event):
 		"""
 	def __init__(self, pos=(0, 0, 0), rot=None, cylinder_radius=0.05):
 		gp.Axes.__init__(self, pos, rot, cylinder_radius)
 
-		# 2 different methods may be used here
-		# see http://stackoverflow.com/questions/7810632/
+		# 2 different methods may be used here. See
+		# http://stackoverflow.com/questions/7810632/
 
 		axesActor = vtk.vtkAxesActor()
 		axesActor.AxisLabelsOn()
 		cyl = vtk.vtkCylinderSource()
 		cyl.SetHeight(length)
 		cyl.SetRadius(radius)
-		cyl.SetResolution(resolution) # it is the circumferential number of facets
+		cyl.SetResolution(resolution)
 
 		# set it to be aligned along the global Z-axis, ODE-like
 		userTransform = vtk.vtkTransform()
 		userTransform.RotateX(90.0)
-		#TODO: add argument to select the orientation axis, like cylDirection in Mass.setCylinder()
+		# TODO: add argument to select the orientation axis, like
+		# cylDirection in Mass.setCylinder()
 		transFilter = vtk.vtkTransformPolyDataFilter()
 		transFilter.SetInputConnection(cyl.GetOutputPort())
 		transFilter.SetTransform(userTransform)
 
 	def __init__(self, length, radius, center, rot=None, resolution=20):
 		gp.Capsule.__init__(self, length, radius, center, rot, resolution)
-		# simplify this construction using those corresponding to Cylinder and Sphere?
+		# TODO: simplify this construction using those corresponding to
+		# Cylinder and Sphere?
 
 		sphere1 = vtk.vtkSphereSource()
 		sphere1.SetRadius(radius)
 		sphereMapper1.SetInputConnection(sphere1.GetOutputPort())
 		sphereActor1 = vtk.vtkActor()
 		sphereActor1.SetMapper(sphereMapper1)
-		sphereActor1.SetPosition(0, 0, -length/2.0)
+		sphereActor1.SetPosition(0, 0, -length / 2.0)
 
 		sphere2 = vtk.vtkSphereSource()
 		sphere2.SetRadius(radius)
 		sphereMapper2.SetInputConnection(sphere2.GetOutputPort())
 		sphereActor2 = vtk.vtkActor()
 		sphereActor2.SetMapper(sphereMapper2)
-		sphereActor2.SetPosition(0, 0, length/2.0)
+		sphereActor2.SetPosition(0, 0, length / 2.0)
 
 		# set it to be aligned along the global Z-axis, ODE-like
 		cylinder = vtk.vtkCylinderSource()
 
 		userTransform = vtk.vtkTransform()
 		userTransform.RotateX(90.0)
-		#TODO: add argument to select the orientation axis, like cylDirection in Mass.setCylinder()
+		# TODO: add argument to select the orientation axis, like
+		# cylDirection in Mass.setCylinder()
 		transFilter = vtk.vtkTransformPolyDataFilter()
 		transFilter.SetInputConnection(cylinder.GetOutputPort())
 		transFilter.SetTransform(userTransform)
 
 			# the triangle is defined by 3 points
 			triangle = vtk.vtkTriangle()
-			triangle.GetPointIds().SetId(0, p_id)		# point 0
-			triangle.GetPointIds().SetId(1, p_id + 1)	# point 1
-			triangle.GetPointIds().SetId(2, p_id + 2)	# point 2
+			triangle.GetPointIds().SetId(0, p_id)       # point 0
+			triangle.GetPointIds().SetId(1, p_id + 1)   # point 1
+			triangle.GetPointIds().SetId(2, p_id + 2)   # point 2
 			triangle_list.append(triangle)
 
 		# insert each triangle into the Vtk data structure
 		'.png' extension.
 
 		"""
-		# TODO: see if the workaround (get render_window and create image_getter every time)
-		# was needed because we used image_getter.SetInput instead of SetInputConnection
+		# TODO: see if the workaround (get render_window and create
+		# image_getter every time) was needed because we used
+		# image_getter.SetInput instead of SetInputConnection.
 		render_window = self.gAdapter.render_window
 		image_getter = vtk.vtkWindowToImageFilter()
 		image_getter.SetInput(render_window)