#include <cullBinManager.h>
Public Types | |
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 string &name, BinType type, int sort) |
Defines a new bin with the indicated name, and returns the new bin_index. | |
void | remove_bin (int bin_index) |
Permanently removes the indicated bin. | |
int | get_num_bins () const |
Returns the number of bins in the world. | |
int | get_bin (int n) const |
Returns the bin_index of the nth bin in the set, where n is a number between 0 and get_num_bins(). | |
int | find_bin (const string &name) const |
Returns the bin_index associated with the bin of the given name, or -1 if no bin has that name. | |
string | get_bin_name (int bin_index) const |
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_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()). | |
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()). | |
PointerTo< CullBin > | make_new_bin (int bin_index, GraphicsStateGuardianBase *gsg) |
Intended to be called by CullResult when a new CullBin pointer corresponding to the indicated bin_index is required. | |
Static Public Member Functions | |
CullBinManager * | get_global_ptr () |
Returns the pointer to the global CullBinManager object. | |
Protected Member Functions | |
CullBinManager () | |
The constructor is not intended to be called directly; there is only one CullBinManager and it constructs itself. | |
~CullBinManager () | |
Don't call the destructor. | |
Private Types | |
typedef pvector< BinDefinition > | BinDefinitions |
typedef pmap< string, int > | BinsByName |
typedef vector_int | SortedBins |
Private Member Functions | |
void | do_sort_bins () |
Puts the _sorted_bins vector in proper rendering order. | |
void | setup_initial_bins () |
Called only at construction time to create the default bins and the bins specified in the Configrc file. | |
Static Private Member Functions | |
BinType | parse_bin_type (const string &bin_type) |
Given the name of a bin type, returns the corresponding BinType value, or BT_invalid if it is an unknown type. | |
Private Attributes | |
BinDefinitions | _bin_definitions |
BinsByName | _bins_by_name |
SortedBins | _sorted_bins |
bool | _bins_are_sorted |
bool | _unused_bin_index |
Static Private Attributes | |
CullBinManager * | _global_ptr = (CullBinManager *)NULL |
Friends | |
class | SortBins |
Definition at line 44 of file cullBinManager.h.
|
Definition at line 90 of file cullBinManager.h. |
|
Definition at line 100 of file cullBinManager.h. |
|
Definition at line 103 of file cullBinManager.h. |
|
Definition at line 50 of file cullBinManager.h. Referenced by get_bin(), and PGItem::has_cull_callback(). |
|
The constructor is not intended to be called directly; there is only one CullBinManager and it constructs itself. This could have been a private constructor, but gcc issues a spurious warning if the constructor is private and the class has no friends. Definition at line 52 of file cullBinManager.cxx. |
|
Don't call the destructor.
Definition at line 68 of file cullBinManager.cxx. References _bin_definitions, _bins_by_name, CullBinManager::BinDefinition::_in_use, CullBinManager::BinDefinition::_sort, CullBinManager::BinDefinition::_type, and nassertr. |
|
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 88 of file cullBinManager.cxx. References _bin_definitions, and _unused_bin_index. |
|
Puts the _sorted_bins vector in proper rendering order.
Definition at line 273 of file cullBinManager.cxx. |
|
Returns the bin_index associated with the bin of the given name, or -1 if no bin has that name.
Definition at line 201 of file cullBinManager.cxx. References BT_back_to_front, BT_fixed, BT_front_to_back, and NULL. |
|
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 96 of file cullBinManager.I. References _bin_definitions, BinType, BT_invalid, INLINE, and nassertr. |
|
|
|
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 165 of file cullBinManager.I. Referenced by PGItem::has_cull_callback(). |
|
Returns the type of the bin with the indicated bin_index (where bin_index was retrieved by get_bin() or find_bin()). The bin's type may not be changed during the life of the bin. Definition at line 138 of file cullBinManager.I. References _bin_definitions, _bins_are_sorted, INLINE, and nassertv. Referenced by PGItem::has_cull_callback(). |
|
Returns the pointer to the global CullBinManager object.
Definition at line 221 of file cullBinManager.cxx. References _bins_are_sorted, _sorted_bins, and SortBins. Referenced by PGItem::has_cull_callback(). |
|
Returns the number of bins in the world.
Definition at line 69 of file cullBinManager.I. References _sorted_bins, INLINE, and nassertr. |
|
Intended to be called by CullResult when a new CullBin pointer corresponding to the indicated bin_index is required. It allocates and returns a brand new CullBin object of the appropriate type. Definition at line 243 of file cullBinManager.cxx. References ConfigString. |
|
Given the name of a bin type, returns the corresponding BinType value, or BT_invalid if it is an unknown type.
Definition at line 362 of file cullBinManager.cxx. |
|
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 167 of file cullBinManager.cxx. References _bins_by_name. |
|
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 192 of file cullBinManager.I. |
|
Called only at construction time to create the default bins and the bins specified in the Configrc file.
Definition at line 291 of file cullBinManager.cxx. |
|
Definition at line 109 of file cullBinManager.h. Referenced by get_global_ptr(). |
|
Definition at line 91 of file cullBinManager.h. Referenced by add_bin(), get_bin(), get_bin_type(), CullBinManager::SortBins::SortBins(), and ~CullBinManager(). |
|
Definition at line 105 of file cullBinManager.h. Referenced by get_bin_type(), and get_global_ptr(). |
|
Definition at line 101 of file cullBinManager.h. Referenced by remove_bin(), and ~CullBinManager(). |
|
Definition at line 33 of file cullBinManager.cxx. |
|
Definition at line 104 of file cullBinManager.h. Referenced by get_global_ptr(), and get_num_bins(). |
|
Definition at line 106 of file cullBinManager.h. Referenced by add_bin(). |