Panda3D
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
TexMemWatcher Class Reference
Inheritance diagram for TexMemWatcher:
DirectObject

Public Member Functions

def __init__ (self, gsg=None, limit=None)
 
def cleanup (self)
 
def enterRegion (self, region, buttonName)
 
def findAvailableHoles (self, area, w=None, h=None)
 
def findEmptyRuns (self, bm)
 
def findHole (self, area, w, h)
 
def findHolePieces (self, area)
 
def findLargestHole (self)
 
def findOverflowHole (self, area, w, h)
 
def formatSize (self, size)
 
def graphicsMemoryLimitChanged (self)
 
def isolateTexture (self, tr)
 
def leaveRegion (self, region, buttonName)
 
def makeCanvasBackground (self)
 
def mouseClick (self)
 
def placeTexture (self, tr)
 
def reconfigureWindow (self)
 
def repack (self)
 
def setLimit (self, limit=None)
 
def setRollover (self, tr, pi)
 
def setupCanvas (self)
 
def setupGui (self)
 
def unplaceTexture (self, tr)
 
def updateTextures (self, task)
 
def windowEvent (self, win)
 
- Public Member Functions inherited from DirectObject
def __init__ (self)
 
def accept (self, event, method, extraArgs=[])
 
def acceptOnce (self, event, method, extraArgs=[])
 
def addTask (self, *args, **kwargs)
 
def detectLeaks (self)
 
def doMethodLater (self, *args, **kwargs)
 
def getAllAccepting (self)
 
def ignore (self, event)
 
def ignoreAll (self)
 
def isAccepting (self, event)
 
def isIgnoring (self, event)
 
def removeAllTasks (self)
 
def removeTask (self, taskOrName)
 

Public Attributes

 area
 
 aspect2d
 
 background
 
 bitmasks
 
 canvas
 
 canvasBackground
 
 canvasDR
 
 canvasLens
 
 canvasRoot
 
 checkTex
 
 cleanedUp
 
 dynamicLimit
 
 gsg
 
 h
 
 isolate
 
 isolated
 
 lens
 
 limit
 
 lruLimit
 
 maxHeight
 
 mouse
 
 mw
 
 name
 
 needsRepack
 
 nextTexRecordKey
 
 pipe
 
 placedQSize
 
 placedSize
 
 quantize
 
 render2d
 
 rollover
 
 sizeText
 
 sizeTextNP
 
 status
 
 statusBackground
 
 statusText
 
 statusTextNP
 
 task
 
 texPlacements
 
 texRecordsByKey
 
 texRecordsByTex
 
 top
 
 totalSize
 
 w
 
 win
 
 winSize
 

Static Public Attributes

int NextIndex = 1
 
int StatusHeight = 20
 
- Static Public Attributes inherited from DirectObject
def accept_once = acceptOnce
 
def add_task = addTask
 
def detect_leaks = detectLeaks
 
def do_method_later = doMethodLater
 
def get_all_accepting = getAllAccepting
 
def ignore_all = ignoreAll
 
def is_accepting = isAccepting
 
def is_ignoring = isIgnoring
 
def remove_all_tasks = removeAllTasks
 
def remove_task = removeTask
 

Detailed Description

This class creates a separate graphics window that displays an
approximation of the current texture memory, showing the textures
that are resident and/or active, and an approximation of the
amount of texture memory consumed by each one.  It's intended as a
useful tool to help determine where texture memory is being spent.

Although it represents the textures visually in a 2-d space, it
doesn't actually have any idea how textures are physically laid
out in memory--but it has to lay them out somehow, so it makes
something up.  It occasionally rearranges the texture display when
it feels it needs to, without regard to what the graphics card is
actually doing.  This tool can't be used to research texture
memory fragmentation issues.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  gsg = None,
  limit = None 
)

Member Function Documentation

◆ cleanup()

def cleanup (   self)

◆ enterRegion()

def enterRegion (   self,
  region,
  buttonName 
)
the mouse has rolled over a texture. 

◆ findAvailableHoles()

def findAvailableHoles (   self,
  area,
  w = None,
  h = None 
)
Finds a list of available holes, of at least the indicated
area.  Returns a list of tuples, where each tuple is of the
form (area, tp).

If w and h are non-None, this will short-circuit on the first
hole it finds that fits w x h, and return just that hole in a
singleton list.

◆ findEmptyRuns()

def findEmptyRuns (   self,
  bm 
)
Separates a bitmask into a list of (l, r) tuples,
corresponding to the empty regions in the row between 0 and
self.w. 

◆ findHole()

def findHole (   self,
  area,
  w,
  h 
)
Searches for a rectangular hole that is at least area
square units big, regardless of its shape, but attempt to find
one that comes close to the right shape, at least.  If one is
found, returns an appropriate TexPlacement; otherwise, returns
None. 

◆ findHolePieces()

def findHolePieces (   self,
  area 
)
Returns a list of holes whose net area sums to the given
area, or None if there are not enough holes. 

◆ findLargestHole()

def findLargestHole (   self)

◆ findOverflowHole()

def findOverflowHole (   self,
  area,
  w,
  h 
)
Searches for a hole large enough for (w, h), in the
overflow space.  Since the overflow space is infinite, this
will always succeed. 

◆ formatSize()

def formatSize (   self,
  size 
)
Returns a size in MB, KB, GB, whatever. 

◆ graphicsMemoryLimitChanged()

def graphicsMemoryLimitChanged (   self)

◆ isolateTexture()

def isolateTexture (   self,
  tr 
)
Isolates the indicated texture onscreen, or None to
restore normal mode. 

◆ leaveRegion()

def leaveRegion (   self,
  region,
  buttonName 
)
the mouse is no longer over a texture. 

◆ makeCanvasBackground()

def makeCanvasBackground (   self)

◆ mouseClick()

def mouseClick (   self)
Received a mouse-click within the window.  This isolates
the currently-highlighted texture into a full-window
presentation. 

◆ placeTexture()

def placeTexture (   self,
  tr 
)
Places the texture somewhere on the canvas where it will
fit. 

◆ reconfigureWindow()

def reconfigureWindow (   self)
Resets everything for a new window size. 

◆ repack()

def repack (   self)
Repacks all of the current textures. 

◆ setLimit()

def setLimit (   self,
  limit = None 
)
Indicates the texture memory limit.  If limit is None or
unspecified, the limit is taken from the GSG, if any; or there
is no limit. 

◆ setRollover()

def setRollover (   self,
  tr,
  pi 
)
Sets the highlighted texture (due to mouse rollover) to
the indicated texture, or None to clear it. 

◆ setupCanvas()

def setupCanvas (   self)
Creates the "canvas", which is the checkerboard area where
texture memory is laid out.  The canvas has its own
DisplayRegion. 

◆ setupGui()

def setupGui (   self)
Creates the gui elements and supporting structures. 

◆ unplaceTexture()

def unplaceTexture (   self,
  tr 
)
Removes the texture from its place on the canvas. 

◆ updateTextures()

def updateTextures (   self,
  task 
)
Gets the current list of resident textures and adds new
textures or removes old ones from the onscreen display, as
necessary. 

◆ windowEvent()

def windowEvent (   self,
  win 
)

Member Data Documentation

◆ area

area

◆ aspect2d

aspect2d

◆ background

background

◆ bitmasks

bitmasks

◆ canvas

canvas

◆ canvasBackground

canvasBackground

◆ canvasDR

canvasDR

◆ canvasLens

canvasLens

◆ canvasRoot

canvasRoot

◆ checkTex

checkTex

◆ cleanedUp

cleanedUp

◆ dynamicLimit

dynamicLimit

◆ gsg

gsg

◆ h

h

◆ isolate

isolate

◆ isolated

isolated

◆ lens

lens

◆ limit

limit

◆ lruLimit

lruLimit

◆ maxHeight

maxHeight

◆ mouse

mouse

◆ mw

mw

◆ name

name

◆ needsRepack

needsRepack

◆ NextIndex

int NextIndex = 1
static

◆ nextTexRecordKey

nextTexRecordKey

◆ pipe

pipe

◆ placedQSize

placedQSize

◆ placedSize

placedSize

◆ quantize

quantize

◆ render2d

render2d

◆ rollover

rollover

◆ sizeText

sizeText

◆ sizeTextNP

sizeTextNP

◆ status

status

◆ statusBackground

statusBackground

◆ StatusHeight

int StatusHeight = 20
static

◆ statusText

statusText

◆ statusTextNP

statusTextNP

◆ task

task

◆ texPlacements

texPlacements

◆ texRecordsByKey

texRecordsByKey

◆ texRecordsByTex

texRecordsByTex

◆ top

top

◆ totalSize

totalSize

◆ w

w

◆ win

win

◆ winSize

winSize