Package pyraf :: Module gki :: Class GkiBuffer
[hide private]
[frames] | no frames]

Class GkiBuffer

source code

implement a buffer for gki which allocates memory in blocks so that a new memory allocation is not needed everytime metacode is appended

Instance Methods [hide private]
 
__init__(self, metacode=None) source code
 
init(self, metacode=None)
Initialize to empty buffer or to metacode
source code
 
prepareToRedraw(self)
Reset pointers in preparation for redraw
source code
 
reset(self, last=0)
Discard everything up to end pointer
source code
 
split(self)
Split this buffer at nextTranslate and return a new buffer object with the rest of the metacode.
source code
 
append(self, metacode, isUndoable=0)
Append metacode to buffer
source code
 
isUndoable(self)
Returns true if there is anything to undo on this plot
source code
 
undoN(self, nUndo=1)
Undo last nUndo edits and replot.
source code
 
isRedoable(self)
Returns true if there is anything to redo on this plot
source code
 
redoN(self, nRedo=1)
Redo last nRedo edits and replot.
source code
 
get(self)
Return buffer contents (as numpy array, even if empty)
source code
 
delget(self, last=0)
Return buffer up to end pointer, deleting those elements
source code
 
getNextCode(self)
Read next opcode and argument from buffer, returning a tuple with (opcode, arg).
source code
 
__len__(self) source code
 
__getitem__(self, i) source code
 
__getslice__(self, i, j) source code
Class Variables [hide private]
  INCREMENT = 50000
Method Details [hide private]

reset(self, last=0)

source code 

Discard everything up to end pointer

End is lastTranslate if last is true, else nextTranslate

split(self)

source code 

Split this buffer at nextTranslate and return a new buffer object with the rest of the metacode. lastOpcode may be removed if it triggered the buffer split (so we can append more metacode later if desired.)

undoN(self, nUndo=1)

source code 

Undo last nUndo edits and replot. Returns true if plot changed.

redoN(self, nRedo=1)

source code 

Redo last nRedo edits and replot. Returns true if plot changed.

delget(self, last=0)

source code 

Return buffer up to end pointer, deleting those elements

End is lastTranslate if last is true, else nextTranslate

getNextCode(self)

source code 

Read next opcode and argument from buffer, returning a tuple with (opcode, arg). Skips no-op codes and illegal codes. Returns (None,None) on end of buffer or when opcode is truncated.