Panda3D
Loading...
Searching...
No Matches
BufferViewer Class Reference
Inheritance diagram for BufferViewer:
DirectObject

Public Member Functions

 __init__ (self, win, parent)
 
 advanceCard (self)
 
 analyzeTextureSet (self, x, set)
 
 enable (self, x)
 
 isEnabled (self)
 
 isValidTextureSet (self, x)
 
 maintainReadout (self, task)
 
 makeFrame (self, sizex, sizey)
 
 refreshReadout (self)
 
 selectCard (self, i)
 
 setCardSize (self, x, y)
 
 setExclude (self, x)
 
 setInclude (self, x)
 
 setLayout (self, lay)
 
 setPosition (self, pos)
 
 setRenderParent (self, renderParent)
 
 setSort (self, bin, sort)
 
 toggleEnable (self)
 
- Public Member Functions inherited from DirectObject
 __init__ (self)
 
 accept (self, event, method, extraArgs=[])
 
 acceptOnce (self, event, method, extraArgs=[])
 
 addTask (self, *args, **kwargs)
 
 detectLeaks (self)
 
 doMethodLater (self, *args, **kwargs)
 
 getAllAccepting (self)
 
 ignore (self, event)
 
 ignoreAll (self)
 
 isAccepting (self, event)
 
 isIgnoring (self, event)
 
 removeAllTasks (self)
 
 removeTask (self, taskOrName)
 

Public Attributes

int cardindex = 0
 
 cardmaker = CardMaker("cubemaker")
 
list cards = []
 
str cullbin = "fixed"
 
int cullsort = 10000
 
int dirty = 1
 
int enabled = 0
 
 engine = GraphicsEngine.getGlobalPtr()
 
str exclude = "none"
 
str include = "all"
 
str layout = ConfigVariableString('buffer-viewer-layout', "hline").getValue()
 
str position = ConfigVariableString('buffer-viewer-position', "lrcorner").getValue()
 
 refreshReadout
 
 renderParent = parent
 
 sizex = size[0]
 
 sizey = size[1]
 
int task = 0
 
 win = win
 

Static Public Attributes

 notify = directNotify.newCategory('BufferViewer')
 
- Static Public Attributes inherited from DirectObject
 accept_once = acceptOnce
 
 add_task = addTask
 
 detect_leaks = detectLeaks
 
 do_method_later = doMethodLater
 
 get_all_accepting = getAllAccepting
 
 ignore_all = ignoreAll
 
 is_accepting = isAccepting
 
 is_ignoring = isIgnoring
 
 remove_all_tasks = removeAllTasks
 
 remove_task = removeTask
 

Additional Inherited Members

- Protected Member Functions inherited from DirectObject
 _addTask (self, task)
 
 _clearTask (self, task)
 
- Protected Attributes inherited from DirectObject
dict _taskList = {}
 

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
win,
parent )
Access: private.  Constructor.

Member Function Documentation

◆ advanceCard()

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.

◆ analyzeTextureSet()

analyzeTextureSet ( self,
x,
set )
Access: private.  Converts a list of GraphicsObject,
GraphicsEngine, and Texture into a table of Textures.

◆ enable()

enable ( self,
x )
Turn the buffer viewer on or off.  The initial state of the
buffer viewer depends on the Config variable 'show-buffers'.

◆ isEnabled()

isEnabled ( self)
Returns true if the buffer viewer is currently enabled.

◆ isValidTextureSet()

isValidTextureSet ( self,
x )
Access: private. Returns true if the parameter is a
list of GraphicsOutput and Texture, or the keyword 'all'.

◆ maintainReadout()

maintainReadout ( self,
task )
Access: private.  Whenever necessary, rebuilds the entire
display from scratch.  This is only done when the configuration
parameters have changed.

◆ makeFrame()

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.

◆ refreshReadout()

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).

◆ selectCard()

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.

◆ setCardSize()

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).

◆ setExclude()

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.

◆ setInclude()

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'.

◆ setLayout()

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'.

◆ setPosition()

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'.

◆ setRenderParent()

setRenderParent ( self,
renderParent )
Set the scene graph root to which the output cards should
be parented.  The default is render2d. 

◆ setSort()

setSort ( self,
bin,
sort )
Set the cull-bin and sort-order for the output cards.  The
default value is 'fixed', 10000.

◆ toggleEnable()

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

◆ cardindex

int cardindex = 0

◆ cardmaker

cardmaker = CardMaker("cubemaker")

◆ cards

list cards = []

◆ cullbin

cullbin = "fixed"

◆ cullsort

cullsort = 10000

◆ dirty

int dirty = 1

◆ enabled

enabled = 0

◆ engine

engine = GraphicsEngine.getGlobalPtr()

◆ exclude

exclude = "none"

◆ include

include = "all"

◆ layout

str layout = ConfigVariableString('buffer-viewer-layout', "hline").getValue()

◆ notify

notify = directNotify.newCategory('BufferViewer')
static

◆ position

str position = ConfigVariableString('buffer-viewer-position', "lrcorner").getValue()

◆ refreshReadout

refreshReadout

◆ renderParent

renderParent = parent

◆ sizex

sizex = size[0]

◆ sizey

sizey = size[1]

◆ task

int task = 0

◆ win

win = win