Panda3D
Public Member Functions | Static Public Member Functions | List of all members
CullBinManager Class Reference

This is a global object that maintains the collection of named CullBins in the world. More...

Inheritance diagram for CullBinManager:
CullBinEnums

Public Member Functions

int addBin (str name, CullBinManager::BinType type, int sort)
 Defines a new bin with the indicated name, and returns the new bin_index. More...
 
int findBin (str name)
 Returns the bin_index associated with the bin of the given name, or -1 if no bin has that name. More...
 
int getBin (int n)
 Returns the bin_index of the nth bin in the set, where n is a number between 0 and get_num_bins(). More...
 
bool getBinActive (int bin_index)
 Returns the active flag of the bin with the indicated bin_index (where bin_index was retrieved by get_bin() or find_bin()). More...
 
bool getBinActive (str name)
 Returns the active flag of the bin with the indicated name. More...
 
bool getBinFlashActive (int bin_index)
 Returns true if the bin with the given bin_index is configured to flash at a predetermined color (where bin_index was retrieved by get_bin() or find_bin()). More...
 
const LColor getBinFlashColor (int bin_index)
 Returns the color that this bin has been configured to flash to, if configured. More...
 
str getBinName (int bin_index)
 Returns the name of the bin with the indicated bin_index (where bin_index was retrieved by get_bin() or find_bin()). More...
 
list getBins ()
 
int getBinSort (int bin_index)
 Returns the sort order of the bin with the indicated bin_index (where bin_index was retrieved by get_bin() or find_bin()). More...
 
int getBinSort (str name)
 Returns the sort order of the bin with the indicated name. More...
 
CullBinManager::BinType getBinType (int bin_index)
 Returns the type of the bin with the indicated bin_index (where bin_index was retrieved by get_bin() or find_bin()). More...
 
CullBinManager::BinType getBinType (str name)
 Returns the type of the bin with the indicated name. More...
 
int getNumBins ()
 Returns the number of bins in the world. More...
 
 removeBin (int bin_index)
 Permanently removes the indicated bin. More...
 
 setBinActive (int bin_index, bool active)
 Changes the active flag of the bin with the indicated bin_index (where bin_index was retrieved by get_bin() or find_bin()). More...
 
 setBinActive (str name, bool active)
 Changes the active flag of the bin with the indicated name. More...
 
 setBinFlashActive (int bin_index, bool active)
 When set to true, the given bin_index is configured to flash at a predetermined color (where bin_index was retrieved by get_bin() or find_bin()). More...
 
 setBinFlashColor (int bin_index, const LColor color)
 Changes the flash color for the given bin index. More...
 
 setBinSort (int bin_index, int sort)
 Changes the sort order of the bin with the indicated bin_index (where bin_index was retrieved by get_bin() or find_bin()). More...
 
 setBinSort (str name, int sort)
 Changes the sort order of the bin with the indicated name. More...
 
 setBinType (int bin_index, CullBinManager::BinType type)
 Changes the type of the bin with the indicated bin_index (where bin_index was retrieved by get_bin() or find_bin()). More...
 
 setBinType (str name, CullBinManager::BinType type)
 Changes the type of the bin with the indicated name. More...
 
 write (Ostream out)
 
- Public Member Functions inherited from CullBinEnums
 __init__ ()
 
 __init__ (const CullBinEnums)
 

Static Public Member Functions

static CullBinManager getGlobalPtr ()
 Returns the pointer to the global CullBinManager object. More...
 

Additional Inherited Members

- Public Types inherited from CullBinEnums
enum  BinType {
  BT_invalid = 0, BT_unsorted = 1, BT_state_sorted = 2, BT_back_to_front = 3,
  BT_front_to_back = 4, BT_fixed = 5
}
 

Detailed Description

This is a global object that maintains the collection of named CullBins in the world.

Member Function Documentation

◆ addBin()

int addBin ( str  name,
CullBinManager::BinType  type,
int  sort 
)

Defines a new bin with the indicated name, and returns the new bin_index.

If there is already a bin with the same name returns its bin_index if it had the same properties; otherwise, reports an error and returns -1.

◆ findBin()

int findBin ( str  name)

Returns the bin_index associated with the bin of the given name, or -1 if no bin has that name.

◆ getBin()

int getBin ( int  n)

Returns the bin_index of the nth bin in the set, where n is a number between 0 and get_num_bins().

This returns the list of bin_index numbers, in sorted order (that is, in the order in which the bins should be rendered).

◆ getBinActive() [1/2]

bool getBinActive ( int  bin_index)

Returns the active flag of the bin with the indicated bin_index (where bin_index was retrieved by get_bin() or find_bin()).

When a bin is marked inactive, all geometry assigned to it is not rendered.

◆ getBinActive() [2/2]

bool getBinActive ( str  name)

Returns the active flag of the bin with the indicated name.

When a bin is marked inactive, all geometry assigned to it is not rendered.

◆ getBinFlashActive()

bool getBinFlashActive ( int  bin_index)

Returns true if the bin with the given bin_index is configured to flash at a predetermined color (where bin_index was retrieved by get_bin() or find_bin()).

This method is not available in release builds.

◆ getBinFlashColor()

const LColor getBinFlashColor ( int  bin_index)

Returns the color that this bin has been configured to flash to, if configured.

This method is not available in release builds.

◆ getBinName()

str getBinName ( int  bin_index)

Returns the name of the bin with the indicated bin_index (where bin_index was retrieved by get_bin() or find_bin()).

The bin's name may not be changed during the life of the bin.

◆ getBins()

list getBins ( )

◆ getBinSort() [1/2]

int getBinSort ( int  bin_index)

Returns the sort order of the bin with the indicated bin_index (where bin_index was retrieved by get_bin() or find_bin()).

The bins are rendered in increasing order by their sort order; this number may be changed from time to time to reorder the bins.

◆ getBinSort() [2/2]

int getBinSort ( str  name)

Returns the sort order of the bin with the indicated name.

The bins are rendered in increasing order by their sort order; this number may be changed from time to time to reorder the bins.

◆ getBinType() [1/2]

CullBinManager::BinType getBinType ( int  bin_index)

Returns the type of the bin with the indicated bin_index (where bin_index was retrieved by get_bin() or find_bin()).

◆ getBinType() [2/2]

CullBinManager::BinType getBinType ( str  name)

Returns the type of the bin with the indicated name.

◆ getGlobalPtr()

static CullBinManager getGlobalPtr ( )
static

Returns the pointer to the global CullBinManager object.

◆ getNumBins()

int getNumBins ( )

Returns the number of bins in the world.

◆ removeBin()

removeBin ( int  bin_index)

Permanently removes the indicated bin.

This operation is not protected from the pipeline and will disturb whatever is currently rendering in draw. You should not call this during the normal course of rendering a frame; it is intended only as an aid to development, to allow the developer to interactively fiddle with the set of bins.

◆ setBinActive() [1/2]

setBinActive ( int  bin_index,
bool  active 
)

Changes the active flag of the bin with the indicated bin_index (where bin_index was retrieved by get_bin() or find_bin()).

When a bin is marked inactive, all geometry assigned to it is not rendered.

◆ setBinActive() [2/2]

setBinActive ( str  name,
bool  active 
)

Changes the active flag of the bin with the indicated name.

When a bin is marked inactive, all geometry assigned to it is not rendered.

◆ setBinFlashActive()

setBinFlashActive ( int  bin_index,
bool  active 
)

When set to true, the given bin_index is configured to flash at a predetermined color (where bin_index was retrieved by get_bin() or find_bin()).

This method is not available in release builds.

◆ setBinFlashColor()

setBinFlashColor ( int  bin_index,
const LColor  color 
)

Changes the flash color for the given bin index.

This method is not available in release builds.

◆ setBinSort() [1/2]

setBinSort ( int  bin_index,
int  sort 
)

Changes the sort order of the bin with the indicated bin_index (where bin_index was retrieved by get_bin() or find_bin()).

The bins are rendered in increasing order by their sort order; this number may be changed from time to time to reorder the bins.

◆ setBinSort() [2/2]

setBinSort ( str  name,
int  sort 
)

Changes the sort order of the bin with the indicated name.

The bins are rendered in increasing order by their sort order; this number may be changed from time to time to reorder the bins.

◆ setBinType() [1/2]

setBinType ( int  bin_index,
CullBinManager::BinType  type 
)

Changes the type of the bin with the indicated bin_index (where bin_index was retrieved by get_bin() or find_bin()).

The change might be effective immediately, or it might take place next frame, depending on the bin type.

◆ setBinType() [2/2]

setBinType ( str  name,
CullBinManager::BinType  type 
)

Changes the type of the bin with the indicated name.

The change might be effective immediately, or it might take place next frame, depending on the bin type.

◆ write()

write ( Ostream  out)