def _actor_type_changed(self, value): if value == 'cone': a = actors.cone_actor() self.actor_map = {'cone': a} elif value == 'sphere': a = actors.sphere_actor() self.actor_map = {'sphere': a} elif value == 'plane_widget': w = tvtk.PlaneWidget() self.actor_map = {'plane_widget': w} elif value == 'box_widget': w = tvtk.BoxWidget() self.actor_map = {'box_widget': w}
def _actor_type_changed(self, value): scene = self.scene if self._current_actor is not None: scene.remove_actors(self._current_actor) if value == 'cone': a = actors.cone_actor() scene.add_actors(a) elif value == 'sphere': a = actors.sphere_actor() scene.add_actors(a) elif value == 'plane_widget': a = tvtk.PlaneWidget() scene.add_actors(a) elif value == 'box_widget': a = tvtk.BoxWidget() scene.add_actors(a) self._current_actor = a
def __init__(self): earth = actors.earth_actor() earth.property.color = actors.colors.green sphere = actors.sphere_actor(color=actors.colors.blue, opacity=0.65) self.earth, self.sphere = earth, sphere