Commits

German Larrain  committed 205592b

VtkAdapter: modified interface of '_set_object_transform_matrix' and '_create_transform_matrix'.

  • Participants
  • Parent commits e69a563

Comments (0)

Files changed (1)

File ars/graphics/adapters.py

 
 	@staticmethod
 	def _update_pose(obj, pos, rot):
-		t = VtkAdapter._create_transform_matrix(pos, rot)
-		VtkAdapter._set_object_transform_matrix(obj, t)
+		trans = gemut.Transform(pos, rot)
+		vtk_tm = VtkAdapter._create_transform_matrix(trans)
+		VtkAdapter._set_object_transform_matrix(obj, vtk_tm)
 
 	def _timer_callback(self, obj, event):
 		self.timer_count += 1
 	#===========================================================================
 
 	@staticmethod
-	def _set_object_transform_matrix(obj, transMat):
-		"""Set ``obj``'s pose according to the transform ``transMat``.
+	def _set_object_transform_matrix(obj, vtk_tm):
+		"""Set ``obj``'s pose according to the transform ``vtk_tm``.
 
 		:param obj: object to be modified
 		:type obj: :class:`vtk.vtkProp3D`
-		:param transMat: homogeneous transform
-		:type transMat: :class:`vtk.vtkMatrix4x4`
+		:param vtk_tm: homogeneous transform
+		:type vtk_tm: :class:`vtk.vtkMatrix4x4`
 
 		"""
-		obj.PokeMatrix(transMat)
+		obj.PokeMatrix(vtk_tm)
 
 	@staticmethod
-	def _create_transform_matrix(pos, rot):
+	def _create_transform_matrix(trans):
 		"""Create a homogeneous transform matrix valid for VTK.
 
-		:param pos: a size 3 vector, or 3x1 or 1x3 matrix
-		:type pos: tuple, :class:`numpy.ndarray` or None
-		:param rot: 3x3 or 9x1 rotation matrix
-		:type rot: tuple, :class:`numpy.ndarray` or None
-
+		:param trans: homogeneous transform
+		:type trans: :class:`ars.utils.geometry.Transform`
 		:return: a VTK-valid transform matrix
 		:rtype: :class:`vtk.vtkMatrix4x4`
 
 		"""
-		t = gemut.Transform(pos, rot)
 		vtk_matrix = vtk.vtkMatrix4x4()
-		vtk_matrix.DeepCopy(t.get_long_tuple())
+		vtk_matrix.DeepCopy(trans.get_long_tuple())
 
 		return vtk_matrix