def set_transformation(self, transformation, init=False): if not transformation.__class__ == self.Transformation: # create an object of the proper type and take only the attributes # of interest. if isinstance(transformation, Translation): t = transformation.t else: t = None if isinstance(transformation, Rotation): r = transformation.r else: r = None if self.Transformation == Translation: if t is None: transformation = Translation.identity() else: transformation = Translation(t) elif self.Transformation == Rotation: if r is None: transformation = Rotation.identity() else: transformation = Rotation(r) else: # self.Transformation == Complete: if r is None: r = numpy.identity(3, float) if t is None: t = numpy.zeros(3, float) transformation = Complete(r, t) self.transformation = transformation if not init: self.invalidate_transformation_list()
def reset(self): config = context.application.configuration self.rotation_center = Translation.identity() self.rotation = Rotation.identity() self.eye = Translation([0,0,config.viewer_distance]) self.opening_angle = config.opening_angle self.window_size = config.window_size self.window_depth = config.window_depth
def reset(self): config = context.application.configuration self.rotation_center = Translation.identity() self.rotation = Rotation.identity() self.eye = Translation([0, 0, config.viewer_distance]) self.opening_angle = config.opening_angle self.window_size = config.window_size self.window_depth = config.window_depth
def initnonstate(self): GLPeriodicContainer.initnonstate(self) self.model_center = Translation.identity()
def default_parameters(cls): result = Parameters() result.translation = Translation.identity() return result
def default_parameters(cls): result = Parameters() result.center = Translation.identity() result.rotation = Rotation.identity() return result
def get_model_center(self): universe = context.application.model.universe if universe is None: return Translation.identity() else: return universe.model_center