(self, **kwargs)
Load data for the specified visual. Uploading does not happen here
        but in `update_all_variables` instead, since this needs to happen
        after shader program binding in the paint method.
        
        Arguments:
          * **kwargs: the data to update as name:value pairs. name can be
            any field of the visual, plus one of the following keywords:
              * visible: whether this visual should be visible,
              * size: the size of the visual,
              * primitive_type: the GL primitive type,
              * constrain_ratio: whether to constrain the ratio of the visual,
              * constrain_navigation: whether to constrain the navigation,
Load data for the specified visual. Uploading does not happen here
        but in `update_all_variables` instead, since this needs to happen
        after shader program binding in the paint method.
        
        Arguments:
          * **kwargs: the data to update as name:value pairs. name can be
            any field of the visual, plus one of the following keywords:
              * visible: whether this visual should be visible,
              * size: the size of the visual,
              * primitive_type: the GL primitive type,
              * constrain_ratio: whether to constrain the ratio of the visual,
              * constrain_navigation: whether to constrain the navigation,
Load data for the specified visual . Uploading does not happen here but in update_all_variables instead since this needs to happen after shader program binding in the paint method . Arguments : * ** kwargs : the data to update as name : value pairs . name can be any field of the visual plus one of the following keywords : * visible : whether this visual should be visible * size : the size of the visual * primitive_type : the GL primitive type * constrain_ratio : whether to constrain the ratio of the visual * constrain_navigation : whether to constrain the navigation
def set_data(self, **kwargs):
        """Load data for the specified visual. Uploading does not happen here
        but in `update_all_variables` instead, since this needs to happen
        after shader program binding in the paint method.
        
        Arguments:
          * **kwargs: the data to update as name:value pairs. name can be
            any field of the visual, plus one of the following keywords:
              * visible: whether this visual should be visible,
              * size: the size of the visual,
              * primitive_type: the GL primitive type,
              * constrain_ratio: whether to constrain the ratio of the visual,
              * constrain_navigation: whether to constrain the navigation,
        
        """
        
        # handle compound variables
        kwargs2 = kwargs.copy()
        for name, data in kwargs2.iteritems():
            variable = self.get_variable(name)
            if variable is None:
                # log_info("variable '%s' unknown" % name)
                continue
            if variable is not None and variable['shader_type'] == 'compound':
                fun = variable['fun']
                kwargs.pop(name)
                # HACK: if the target variable in the compound is a special
                # keyword, we update it in kwargs, otherwise we update the
                # data in self.data_updating
                # print name, fun(data)
                # if name in self.special_keywords:
                    # kwargs.update(**fun(data))
                # else:
                    # self.data_updating.update(**fun(data))
                kwargs.update(**fun(data))
            # remove non-visible variables
            if not variable.get('visible', True):
                kwargs.pop(name)
        
        # handle visual visibility
        visible = kwargs.pop('visible', None)
        if visible is not None:
            self.visual['visible'] = visible
        
        # handle size keyword
        size = kwargs.pop('size', None)
        # print size
        if size is not None:
            self.slicer.set_size(size)
        
        # handle bounds keyword
        bounds = kwargs.pop('bounds', None)
        if bounds is not None:
            self.slicer.set_bounds(bounds)
            
        # handle primitive type special keyword
        primitive_type = kwargs.pop('primitive_type', None)
        if primitive_type is not None:
            self.visual['primitive_type'] = primitive_type
            self.set_primitive_type(primitive_type)
        
        # handle constrain_ratio keyword
        constrain_ratio = kwargs.pop('constrain_ratio', None)
        if constrain_ratio is not None:
            self.visual['constrain_ratio'] = constrain_ratio
        
        # handle constrain_navigation keyword
        constrain_navigation = kwargs.pop('constrain_navigation', None)
        if constrain_navigation is not None:
            self.visual['constrain_navigation'] = constrain_navigation
        
        # flag the other variables as to be updated
        self.data_updating.update(**kwargs)
def set_data ( self , * * kwargs ) : # handle compound variables kwargs2 = kwargs . copy ( ) for name , data in kwargs2 . iteritems ( ) : variable = self . get_variable ( name ) if variable is None : # log_info("variable '%s' unknown" % name) continue if variable is not None and variable [ 'shader_type' ] == 'compound' : fun = variable [ 'fun' ] kwargs . pop ( name ) # HACK: if the target variable in the compound is a special # keyword, we update it in kwargs, otherwise we update the # data in self.data_updating # print name, fun(data) # if name in self.special_keywords: # kwargs.update(**fun(data)) # else: # self.data_updating.update(**fun(data)) kwargs . update ( * * fun ( data ) ) # remove non-visible variables if not variable . get ( 'visible' , True ) : kwargs . pop ( name ) # handle visual visibility visible = kwargs . pop ( 'visible' , None ) if visible is not None : self . visual [ 'visible' ] = visible # handle size keyword size = kwargs . pop ( 'size' , None ) # print size if size is not None : self . slicer . set_size ( size ) # handle bounds keyword bounds = kwargs . pop ( 'bounds' , None ) if bounds is not None : self . slicer . set_bounds ( bounds ) # handle primitive type special keyword primitive_type = kwargs . pop ( 'primitive_type' , None ) if primitive_type is not None : self . visual [ 'primitive_type' ] = primitive_type self . set_primitive_type ( primitive_type ) # handle constrain_ratio keyword constrain_ratio = kwargs . pop ( 'constrain_ratio' , None ) if constrain_ratio is not None : self . visual [ 'constrain_ratio' ] = constrain_ratio # handle constrain_navigation keyword constrain_navigation = kwargs . pop ( 'constrain_navigation' , None ) if constrain_navigation is not None : self . visual [ 'constrain_navigation' ] = constrain_navigation # flag the other variables as to be updated self . data_updating . update ( * * kwargs )