Commits

German Larrain  committed 64a7fb2

-new abstract methods in graphics.Body: get_color & set_color
-new methods in graphics.adapters.VtkBody: get_color & set_color

  • Participants
  • Parent commits fc9c19d
  • Branches default

Comments (0)

Files changed (2)

File ars/graphics/__init__.py

 
 # Created on 2011.08.09
-# Last modified on 2011.11.14
+# Last modified on 2011.12.04
 #
 # @author: german
 #
 	
 	def get_actor(self):
 		return self._actor
+	
+	@abstractmethod
+	def get_color(self):
+		return self._color
+	
+	@abstractmethod
+	def set_color(self, color):
+		self._color = color
 
 class Box(Body):
 	__metaclass__ = ABCMeta

File ars/graphics/adapters.py

 
 # Created on 2011.11.01
-# Last modified on 2011.11.14
+# Last modified on 2011.12.04
 #
 # @author: german
 
 
 class VtkBody:
 	adapter = VtkAdapter
+	
+	def get_color(self):
+		self._color = self._actor.GetProperty().GetColor() 
+		return self._color
+	
+	def set_color(self, color):
+		self._actor.GetProperty().SetColor(color)
+		self._color = color
 
 class Axes(VtkBody, gp.Axes):
 	def __init__(self, position=(0,0,0), cylinder_radius=0.05):