Commits

German Larrain committed 99ae877

graphics: changed everything that broke due to 0e81a2238d14.

Comments (0)

Files changed (3)

ars/graphics/adapters.py

 import vtk
 
 from .. import exceptions as exc
-from .. import graphics as gp
 from ..utils import geometry as gemut
+from . import base
 
 
 TIMER_PERIOD = 50  # milliseconds
 KEY_PRESS_EVENT = 'KeyPressEvent'
 
 
-class VtkAdapter(gp.Adapter):
+class VtkAdapter(base.Adapter):
 
 	"""Graphics adapter to the Visualization Toolkit (VTK) library"""
 
 		self._color = color
 
 
-class Axes(VtkBody, gp.Axes):
+class Axes(VtkBody, base.Axes):
 
 	def __init__(self, pos=(0, 0, 0), rot=None, cylinder_radius=0.05):
-		gp.Axes.__init__(self, pos, rot, cylinder_radius)
+		base.Axes.__init__(self, pos, rot, cylinder_radius)
 
 		# 2 different methods may be used here. See
 		# http://stackoverflow.com/questions/7810632/
 		self._actor = axesActor
 
 
-class Box(VtkBody, gp.Box):
+class Box(VtkBody, base.Box):
 
 	def __init__(self, size, pos, rot=None):
-		gp.Box.__init__(self, size, pos, rot)
+		base.Box.__init__(self, size, pos, rot)
 
 		box = vtk.vtkCubeSource()
 		box.SetXLength(size[0])
 		self._actor = boxActor
 
 
-class Cone(VtkBody, gp.Cone):
+class Cone(VtkBody, base.Cone):
 
 	def __init__(self, height, radius, center, rot=None, resolution=20):
-		gp.Cone.__init__(self, height, radius, center, rot, resolution)
+		base.Cone.__init__(self, height, radius, center, rot, resolution)
 
 		cone = vtk.vtkConeSource()
 		cone.SetHeight(height)
 		self._actor = coneActor
 
 
-class Sphere(VtkBody, gp.Sphere):
+class Sphere(VtkBody, base.Sphere):
 
 	"""
 	VTK: sphere (represented by polygons) of specified radius centered at the
 	def __init__(
             self, radius, center, rot=None, phi_resolution=20,
             theta_resolution=20):
-		gp.Sphere.__init__(
+		base.Sphere.__init__(
             self, radius, center, rot, phi_resolution, theta_resolution)
 
 		sphere = vtk.vtkSphereSource()
 		self._actor = sphereActor
 
 
-class Cylinder(VtkBody, gp.Cylinder):
+class Cylinder(VtkBody, base.Cylinder):
 
 	def __init__(self, length, radius, center, rot=None, resolution=20):
-		gp.Cylinder.__init__(self, length, radius, center, rot, resolution)
+		base.Cylinder.__init__(self, length, radius, center, rot, resolution)
 
 		# VTK: The axis of the cylinder is aligned along the global y-axis.
 		cyl = vtk.vtkCylinderSource()
 		self._actor = cylActor
 
 
-class Capsule(VtkBody, gp.Capsule):
+class Capsule(VtkBody, base.Capsule):
 
 	def __init__(self, length, radius, center, rot=None, resolution=20):
-		gp.Capsule.__init__(self, length, radius, center, rot, resolution)
+		base.Capsule.__init__(self, length, radius, center, rot, resolution)
 		# TODO: simplify this construction using those corresponding to
 		# Cylinder and Sphere?
 
 		self._actor = assembly
 
 
-class Trimesh(VtkBody, gp.Trimesh):
+class Trimesh(VtkBody, base.Trimesh):
 
 	def __init__(self, vertices, faces, pos, rot=None):
-		gp.Trimesh.__init__(self, vertices, faces, pos, rot)
+		base.Trimesh.__init__(self, vertices, faces, pos, rot)
 
 		# create points
 		points = vtk.vtkPoints()
 		self._actor = triangles_actor
 
 
-class ScreenshotRecorder(gp.ScreenshotRecorder):
+class ScreenshotRecorder(base.ScreenshotRecorder):
 
 	"""
 	Based on an official example script, very simple:

docs/sphinx/source/apidoc/ars.graphics.rst

 graphics Package
 ================
 
-:mod:`graphics` Package
------------------------
-
-.. automodule:: ars.graphics
-    :members:
-    :undoc-members:
-    :show-inheritance:
-
 :mod:`adapters` Module
 ----------------------
 
     :undoc-members:
     :show-inheritance:
 
+:mod:`base` Module
+------------------
+
+.. automodule:: ars.graphics.base
+    :members:
+    :undoc-members:
+    :show-inheritance:
+

tests/graphics/test_base.py

 
 import mock
 
-from ars import graphics
+from ars.graphics import base
 
 
 class ScreenshotRecorderTest(TestCase):
 			'%s19323452435.%s' % (base_filename, extension))
 
 
-class _ScreenshotRecorderAux(graphics.ScreenshotRecorder):
+class _ScreenshotRecorderAux(base.ScreenshotRecorder):
 
 	def write(self, index, time):
 		pass