Panda3D
Public Member Functions | Public Attributes | Static Public Attributes

BufferViewer Class Reference

Inherits direct::showbase::DirectObject::DirectObject.

List of all members.

Public Member Functions

def __init__
def advanceCard
def analyzeTextureSet
def enable
def isEnabled
def isValidTextureSet
def maintainReadout
def makeFrame
def refreshReadout
def selectCard
def setCardSize
def setExclude
def setInclude
def setLayout
def setPosition
def setRenderParent
def setSort
def toggleEnable

Public Attributes

 cardindex
 cardmaker
 cards
 cullbin
 cullsort
 dirty
 enabled
 exclude
 include
 layout
 position
 renderParent
 sizex
 sizey
 task
 window

Static Public Attributes

tuple notify = directNotify.newCategory('BufferViewer')

Constructor & Destructor Documentation

def __init__ (   self)
Access: private.  Constructor.

Member Function Documentation

def advanceCard (   self)
Only useful when using setLayout('cycle').  Increments the index
that selects which card to display.  The index is taken modulo
the actual number of cards.
def analyzeTextureSet (   self,
  x,
  set 
)
Access: private.  Converts a list of GraphicsObject,
GraphicsEngine, and Texture into a table of Textures.
def enable (   self,
  x 
)
Turn the buffer viewer on or off.  The initial state of the
buffer viewer depends on the Config variable 'show-buffers'.
def isEnabled (   self)
Returns true if the buffer viewer is currently enabled.
def isValidTextureSet (   self,
  x 
)
Access: private. Returns true if the parameter is a
list of GraphicsOutput and Texture, or the keyword 'all'.
def maintainReadout (   self,
  task 
)
Access: private.  Whenever necessary, rebuilds the entire
display from scratch.  This is only done when the configuration
parameters have changed.
def makeFrame (   self,
  sizex,
  sizey 
)
Access: private.  Each texture card is displayed with
a two-pixel wide frame (a ring of black and a ring of white).
This routine builds the frame geometry.  It is necessary to
be precise so that the frame exactly aligns to pixel
boundaries, and so that it doesn't overlap the card at all.
def refreshReadout (   self)
Force the readout to be refreshed.  This is usually invoked
by GraphicsOutput::add_render_texture (via an event handler).
However, it is also possible to invoke it manually.  Currently,
the only time I know of that this is necessary is after a
window resize (and I ought to fix that).
def selectCard (   self,
  i 
)
Only useful when using setLayout('cycle').  Sets the index
that selects which card to display.  The index is taken modulo
the actual number of cards.
def setCardSize (   self,
  x,
  y 
)
Set the size of each card.  The units are relative to
render2d (ie, 1x1 card is not square).  If one of the
dimensions is zero, then the viewer will choose a value
for that dimension so as to ensure that the aspect ratio
of the card matches the aspect ratio of the source-window.
If both dimensions are zero, the viewer uses a heuristic
to choose a reasonable size for the card.  The initial
value is (0, 0).
def setExclude (   self,
  x 
)
Set the exclude-set for the buffer viewer.  The exclude-set
should be a list of GraphicsOutputs and Textures to ignore.
The exclude-set is subtracted from the include-set (so the excludes
effectively override the includes.)  The initial value is the
empty list.
def setInclude (   self,
  x 
)
Set the include-set for the buffer viewer.  The include-set
specifies which of the render-to-texture targets to display.
Valid inputs are the string 'all' (display every render-to-texture
target), or a list of GraphicsOutputs or Textures.  The initial
value is 'all'.
def setLayout (   self,
  lay 
)
Set the layout of the cards.  The valid values are:
* vline - display them in a vertical line
* hline - display them in a horizontal line
* vgrid - display them in a vertical grid
* hgrid - display them in a horizontal grid
* cycle - display one card at a time, using selectCard/advanceCard
The default value is 'hline'.
def setPosition (   self,
  pos 
)
Set the position of the cards.  The valid values are:
* llcorner - put them in the lower-left  corner of the window
* lrcorner - put them in the lower-right corner of the window
* ulcorner - put them in the upper-left  corner of the window
* urcorner - put them in the upper-right corner of the window
* window   - put them in a separate window
The initial value is 'lrcorner'.
def setRenderParent (   self,
  renderParent 
)
Set the scene graph root to which the output cards should
be parented.  The default is render2d. 
def setSort (   self,
  bin,
  sort 
)
Set the cull-bin and sort-order for the output cards.  The
default value is 'fixed', 10000.
def toggleEnable (   self)
Toggle the buffer viewer on or off.  The initial state of the
enable flag depends on the Config variable 'show-buffers'.

Member Data Documentation

tuple notify = directNotify.newCategory('BufferViewer') [static]
 All Classes Namespaces Functions Variables Properties