1. German Larrain
  2. ars

Commits

German Larrain  committed 8009098

graphics.adapters: comments cleanup, classdocs update, VtkAdapter.restart_window now raises an exception if called

  • Participants
  • Parent commits 6d37ec1
  • Branches dev

Comments (0)

Files changed (1)

File ars/graphics/adapters.py

View file
  • Ignore whitespace
 
 class VtkAdapter(gp.Adapter):
 	
-	'''coupled to VTK'''
+	''' Graphics adapter to the Visualization Toolkit (VTK) library '''
 	
 	def __init__(self):
 		super(VtkAdapter, self).__init__()
 		self.renWin.SetSize(*self._size)
 		self.renWin.SetWindowName(self._title)
 		
-		'''
-		self.ren.ResetCamera()
-		self.ren.GetActiveCamera().SetPosition(self._cam_position)
-		self.ren.GetActiveCamera().Zoom(self._zoom)
-		'''
+		#=======================================================================
+		# self.ren.ResetCamera()
+		# self.ren.GetActiveCamera().SetPosition(self._cam_position)
+		# self.ren.GetActiveCamera().Zoom(self._zoom)
+		#=======================================================================
 		
 		camera = vtk.vtkCamera()
 		camera.SetPosition(self._cam_position)
 		self.ren.SetActiveCamera(camera)
 		#self.ren.ResetCameraClippingRange()
 		
-		'''
-		if self._windowStarted == True:
-			#self.iren.ReInitialize()
-			pass
-		else:
-			self.iren.Initialize()
-		'''
-		'''
-		if self.iren.GetInitialized():
-			self.renWin.Finalize()
-			
-		if not self._windowStarted:
-			self.iren.Initialize()
-		'''
+		#=======================================================================
+		# if self._windowStarted == True:
+		#	#self.iren.ReInitialize()
+		#	pass
+		# else:
+		#	self.iren.Initialize()
+		#=======================================================================
+
+		#=======================================================================
+		# if self.iren.GetInitialized():
+		#	self.renWin.Finalize()
+		#	
+		# if not self._windowStarted:
+		#	self.iren.Initialize()
+		#=======================================================================
 		
 		# self.iren.Initialize() seems to be not necessary
 		
 		print(self.ren.GetActiveCamera().GetPosition())
 		print(self.ren.GetActiveCamera().GetFocalPoint())
 		
-		'''
-		if not self._windowStarted:
-			# events
-			self.iren.AddObserver(gp.TIMER_EVENT, self._timer_callback)
-			timerId = self.iren.CreateRepeatingTimer(gp.TIMER_PERIOD)
-			self.iren.AddObserver(gp.KEY_PRESS_EVENT, self._key_press_callback)
-			
-			self._windowStarted = True
-			self.iren.Start()
-		'''
+		#=======================================================================
+		# if not self._windowStarted:
+		#	# events
+		#	self.iren.AddObserver(gp.TIMER_EVENT, self._timer_callback)
+		#	timerId = self.iren.CreateRepeatingTimer(gp.TIMER_PERIOD)
+		#	self.iren.AddObserver(gp.KEY_PRESS_EVENT, self._key_press_callback)
+		#	
+		#	self._windowStarted = True
+		#	self.iren.Start()
+		#=======================================================================
+		
 		self.iren.AddObserver(gp.TIMER_EVENT, self._timer_callback)
 		timerId = self.iren.CreateRepeatingTimer(gp.TIMER_PERIOD)  #@UnusedVariable
 		self.iren.AddObserver(gp.KEY_PRESS_EVENT, self._key_press_callback)
 		#	self.renWin.Render()
 		#	self.iren.Start() 
 		#=======================================================================
-		pass
+		raise Exception()
 
 	@staticmethod
 	def _update_body(body, position, rotation): #orientation):
 			pass
 		#self.restartWindow()
 	
-	'''
-	Functions and methods not overriding base class functions and methods
-	'''
+	#===========================================================================
+	# Functions and methods not overriding base class functions and methods
+	#===========================================================================
 	
 	@staticmethod
 	def _set_object_transform_matrix(obj, transMat):