18 INLINE CullBinManager::SortBins::
28 INLINE
bool CullBinManager::SortBins::
29 operator () (
int a,
int b)
const {
30 return _manager->_bin_definitions[a]._sort < _manager->_bin_definitions[b]._sort;
38 INLINE
int CullBinManager::
39 get_num_bins()
const {
43 if (!_bins_are_sorted) {
46 return _sorted_bins.size();
57 nassertr(n >= 0 && n < (
int)_sorted_bins.size(), -1);
58 return _sorted_bins[n];
68 nassertr(bin_index >= 0 && bin_index < (
int)_bin_definitions.size(), std::string());
69 nassertr(_bin_definitions[bin_index]._in_use, std::string());
70 return _bin_definitions[bin_index]._name;
79 nassertr(bin_index >= 0 && bin_index < (
int)_bin_definitions.size(), BT_invalid);
80 nassertr(_bin_definitions[bin_index]._in_use, BT_invalid);
81 return _bin_definitions[bin_index]._type;
90 nassertr(bin_index != -1, BT_invalid);
103 nassertv(bin_index >= 0 && bin_index < (
int)_bin_definitions.size());
104 nassertv(_bin_definitions[bin_index]._in_use);
105 _bin_definitions[bin_index]._type = type;
117 nassertv(bin_index != -1);
130 nassertr(bin_index >= 0 && bin_index < (
int)_bin_definitions.size(), 0);
131 nassertr(_bin_definitions[bin_index]._in_use, 0);
132 return _bin_definitions[bin_index]._sort;
144 nassertr(bin_index != -1, 0);
157 nassertv(bin_index >= 0 && bin_index < (
int)_bin_definitions.size());
158 nassertv(_bin_definitions[bin_index]._in_use);
159 _bin_definitions[bin_index]._sort = sort;
160 _bins_are_sorted =
false;
172 nassertv(bin_index != -1);
184 nassertr(bin_index >= 0 && bin_index < (
int)_bin_definitions.size(),
false);
185 nassertr(_bin_definitions[bin_index]._in_use,
false);
186 return _bin_definitions[bin_index]._active;
197 nassertr(bin_index != -1,
false);
209 nassertv(bin_index >= 0 && bin_index < (
int)_bin_definitions.size());
210 nassertv(_bin_definitions[bin_index]._in_use);
211 _bin_definitions[bin_index]._active = active;
222 nassertv(bin_index != -1);
236 nassertr(bin_index >= 0 && bin_index < (
int)_bin_definitions.size(),
false);
237 return _bin_definitions[bin_index]._flash_active;
248 nassertr(bin_index >= 0 && bin_index < (
int)_bin_definitions.size(), LColor::zero());
249 return _bin_definitions[bin_index]._flash_color;
261 nassertv(bin_index >= 0 && bin_index < (
int)_bin_definitions.size());
262 _bin_definitions[bin_index]._flash_active = active;
272 nassertv(bin_index >= 0 && bin_index < (
int)_bin_definitions.size());
273 _bin_definitions[bin_index]._flash_color = color;
282 if (_global_ptr ==
nullptr) {
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_inde...
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() ...
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...
const LColor & get_bin_flash_color(int bin_index) const
Returns the color that this bin has been configured to flash to, if configured.
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_...
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 (whe...
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() ...
static CullBinManager * get_global_ptr()
Returns the pointer to the global CullBinManager object.
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.
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...
get_bin
Returns the bin_index of the nth bin in the set, where n is a number between 0 and get_num_bins().
This is a global object that maintains the collection of named CullBins in the world.
void set_bin_flash_color(int bin_index, const LColor &color)
Changes the flash color for the given bin index.
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_...
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() ...