(self, data, mask=None)
Update data on all sliced buffers.
Update data on all sliced buffers.
Update data on all sliced buffers .
def update(self, data, mask=None):
        """Update data on all sliced buffers."""
        # NOTE: the slicer needs to be updated if the size of the data changes
        # default mask
        if mask is None:
            mask = np.ones(self.slicer.size, dtype=np.bool)
        # is the current subVBO within the given [onset, offset]?
        within = False
        # update VBOs
        for buffer, (pos, size) in zip(self.buffers, self.slicer.slices):
            subdata = data[pos:pos + size,...]
            submask = mask[pos:pos + size]
            # if there is at least one True in the slice mask (submask)
            if submask.any():
                # this sub-buffer contains updated indices
                subonset = submask.argmax()
                suboffset = len(submask) - 1 - submask[::-1].argmax()
                Attribute.bind(buffer, self.location)
                Attribute.update(subdata[subonset:suboffset + 1,...], subonset)
def update ( self , data , mask = None ) : # NOTE: the slicer needs to be updated if the size of the data changes # default mask if mask is None : mask = np . ones ( self . slicer . size , dtype = np . bool ) # is the current subVBO within the given [onset, offset]? within = False # update VBOs for buffer , ( pos , size ) in zip ( self . buffers , self . slicer . slices ) : subdata = data [ pos : pos + size , ... ] submask = mask [ pos : pos + size ] # if there is at least one True in the slice mask (submask) if submask . any ( ) : # this sub-buffer contains updated indices subonset = submask . argmax ( ) suboffset = len ( submask ) - 1 - submask [ : : - 1 ] . argmax ( ) Attribute . bind ( buffer , self . location ) Attribute . update ( subdata [ subonset : suboffset + 1 , ... ] , subonset )