Panda3D
|
This is a global object that maintains the collection of named CullBins in the world. More...
#include "cullBinManager.h"
Public Types | |
typedef CullBin * | BinConstructor(const std::string &name, GraphicsStateGuardianBase *gsg, const PStatCollector &draw_region_pcollector) |
typedef CullBin::BinType | BinType |
![]() | |
enum | BinType { BT_invalid , BT_unsorted , BT_state_sorted , BT_back_to_front , BT_front_to_back , BT_fixed } |
Public Member Functions | |
int | add_bin (const std::string &name, BinType type, int sort) |
Defines a new bin with the indicated name, and returns the new bin_index. | |
int | find_bin (const std::string &name) const |
Returns the bin_index associated with the bin of the given name, or -1 if no bin has that name. | |
int | get_bin (int n) const |
bool | get_bin_active (const std::string &name) const |
Returns the active flag of the bin with the indicated name. | |
bool | get_bin_active (int bin_index) const |
Returns the active flag of the bin with the indicated bin_index (where bin_index was retrieved by get_bin() or find_bin()). | |
bool | get_bin_flash_active (int bin_index) const |
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()). | |
const LColor & | get_bin_flash_color (int bin_index) const |
Returns the color that this bin has been configured to flash to, if configured. | |
std::string | get_bin_name (int bin_index) const |
Returns the name of the bin with the indicated bin_index (where bin_index was retrieved by get_bin() or find_bin()). | |
int | get_bin_sort (const std::string &name) const |
Returns the sort order of the bin with the indicated name. | |
int | get_bin_sort (int bin_index) const |
Returns the sort order of the bin with the indicated bin_index (where bin_index was retrieved by get_bin() or find_bin()). | |
BinType | get_bin_type (const std::string &name) const |
Returns the type of the bin with the indicated name. | |
BinType | get_bin_type (int bin_index) const |
Returns the type of the bin with the indicated bin_index (where bin_index was retrieved by get_bin() or find_bin()). | |
int | get_num_bins () const |
PT (CullBin) make_new_bin(int bin_index | |
void | register_bin_type (BinType type, BinConstructor *constructor) |
Intended to be called at startup type by each CullBin type, to register the constructor for each type. | |
void | remove_bin (int bin_index) |
Permanently removes the indicated bin. | |
void | set_bin_active (const std::string &name, bool active) |
Changes the active flag of the bin with the indicated name. | |
void | set_bin_active (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()). | |
void | set_bin_flash_active (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()). | |
void | set_bin_flash_color (int bin_index, const LColor &color) |
Changes the flash color for the given bin index. | |
void | set_bin_sort (const std::string &name, int sort) |
Changes the sort order of the bin with the indicated name. | |
void | set_bin_sort (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()). | |
void | set_bin_type (const std::string &name, BinType type) |
Changes the type of the bin with the indicated name. | |
void | set_bin_type (int bin_index, BinType type) |
Changes the type of the bin with the indicated bin_index (where bin_index was retrieved by get_bin() or find_bin()). | |
void | write (std::ostream &out) const |
Static Public Member Functions | |
static CullBinManager * | get_global_ptr () |
Returns the pointer to the global CullBinManager object. | |
Public Attributes | |
GraphicsStateGuardianBase const PStatCollector & | draw_region_pcollector |
get_bin | |
Returns the bin_index of the nth bin in the set, where n is a number between 0 and get_num_bins(). | |
get_num_bins | |
Returns the number of bins in the world. | |
GraphicsStateGuardianBase * | gsg |
Friends | |
class | SortBins |
This is a global object that maintains the collection of named CullBins in the world.
Definition at line 34 of file cullBinManager.h.
typedef CullBin * CullBinManager::BinConstructor(const std::string &name, GraphicsStateGuardianBase *gsg, const PStatCollector &draw_region_pcollector) |
Definition at line 86 of file cullBinManager.h.
typedef CullBin::BinType CullBinManager::BinType |
Definition at line 40 of file cullBinManager.h.
int CullBinManager::add_bin | ( | const std::string & | name, |
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.
Definition at line 51 of file cullBinManager.cxx.
References ConfigVariable::get_num_words(), and ConfigVariableColor::get_value().
int CullBinManager::find_bin | ( | const std::string & | name | ) | const |
Returns the bin_index associated with the bin of the given name, or -1 if no bin has that name.
Definition at line 156 of file cullBinManager.cxx.
Referenced by get_bin_active(), get_bin_sort(), get_bin_type(), set_bin_active(), set_bin_sort(), and set_bin_type().
|
inline |
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.
Definition at line 194 of file cullBinManager.I.
References find_bin(), and get_bin_active().
|
inline |
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.
Definition at line 182 of file cullBinManager.I.
Referenced by CullResult::finish_cull(), and get_bin_active().
|
inline |
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.
Definition at line 234 of file cullBinManager.I.
|
inline |
Returns the color that this bin has been configured to flash to, if configured.
This method is not available in release builds.
Definition at line 246 of file cullBinManager.I.
|
inline |
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.
Definition at line 66 of file cullBinManager.I.
Referenced by PT().
|
inline |
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.
Definition at line 141 of file cullBinManager.I.
References find_bin(), and get_bin_sort().
|
inline |
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.
Definition at line 128 of file cullBinManager.I.
Referenced by get_bin_sort().
|
inline |
Returns the type of the bin with the indicated name.
Definition at line 87 of file cullBinManager.I.
References find_bin(), and get_bin_type().
|
inline |
Returns the type of the bin with the indicated bin_index (where bin_index was retrieved by get_bin() or find_bin()).
Definition at line 77 of file cullBinManager.I.
Referenced by get_bin_type(), and PT().
|
inlinestatic |
Returns the pointer to the global CullBinManager object.
Definition at line 280 of file cullBinManager.I.
Referenced by CullResult::draw(), CullResult::finish_cull(), init_libcull(), PT(), and PT().
void CullBinManager::register_bin_type | ( | BinType | type, |
CullBinManager::BinConstructor * | constructor ) |
Intended to be called at startup type by each CullBin type, to register the constructor for each type.
Definition at line 210 of file cullBinManager.cxx.
Referenced by init_libcull().
void CullBinManager::remove_bin | ( | 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.
Definition at line 129 of file cullBinManager.cxx.
References CullResult::bin_removed(), and RenderState::bin_removed().
|
inline |
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.
Definition at line 219 of file cullBinManager.I.
References find_bin(), and set_bin_active().
|
inline |
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.
Definition at line 207 of file cullBinManager.I.
Referenced by set_bin_active().
|
inline |
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.
Definition at line 259 of file cullBinManager.I.
|
inline |
Changes the flash color for the given bin index.
This method is not available in release builds.
Definition at line 270 of file cullBinManager.I.
|
inline |
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.
Definition at line 169 of file cullBinManager.I.
References find_bin(), and set_bin_sort().
|
inline |
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.
Definition at line 155 of file cullBinManager.I.
Referenced by set_bin_sort().
|
inline |
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.
Definition at line 114 of file cullBinManager.I.
References find_bin(), and set_bin_type().
|
inline |
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.
Definition at line 101 of file cullBinManager.I.
Referenced by set_bin_type().
void CullBinManager::write | ( | std::ostream & | out | ) | const |
Definition at line 169 of file cullBinManager.cxx.
|
friend |
Definition at line 131 of file cullBinManager.h.
GraphicsStateGuardianBase const PStatCollector& CullBinManager::draw_region_pcollector |
Definition at line 81 of file cullBinManager.h.
|
inline |
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).
Definition at line 47 of file cullBinManager.h.
Referenced by CullResult::draw(), and PT().
|
inline |
Returns the number of bins in the world.
Definition at line 47 of file cullBinManager.h.
Referenced by CullResult::draw(), and PT().
GraphicsStateGuardianBase* CullBinManager::gsg |
Definition at line 80 of file cullBinManager.h.