14#ifndef CULLBINMANAGER_H
15#define CULLBINMANAGER_H
40 typedef CullBin::BinType BinType;
42 int add_bin(
const std::string &name, BinType type,
int sort);
46 INLINE
int get_bin(
int n)
const;
48 int find_bin(
const std::string &name)
const;
53 INLINE BinType
get_bin_type(
const std::string &name)
const;
55 INLINE
void set_bin_type(
const std::string &name, BinType type);
60 INLINE
void set_bin_sort(
const std::string &name,
int sort);
74 void write(std::ostream &out)
const;
86 typedef CullBin *BinConstructor(
const std::string &name,
94 void setup_initial_bins();
95 static BinType parse_bin_type(
const std::string &bin_type);
97 class EXPCL_PANDA_PGRAPH BinDefinition {
109 typedef epvector<BinDefinition> BinDefinitions;
110 BinDefinitions _bin_definitions;
115 INLINE
bool operator () (
int a,
int b)
const;
119 typedef pmap<std::string, int> BinsByName;
120 BinsByName _bins_by_name;
122 typedef vector_int SortedBins;
123 SortedBins _sorted_bins;
124 bool _bins_are_sorted;
125 bool _unused_bin_index;
127 typedef pmap<BinType, BinConstructor *> BinConstructors;
128 BinConstructors _bin_constructors;
130 static CullBinManager *_global_ptr;
131 friend class SortBins;
134EXPCL_PANDA_PGRAPH std::ostream &
135operator << (std::ostream &out, CullBinManager::BinType bin_type);
Provides scoping for the enumerated type shared by CullBin and CullBinManager.
This is a global object that maintains the collection of named CullBins in the world.
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() ...
static CullBinManager * get_global_ptr()
Returns the pointer to the global CullBinManager object.
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...
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...
void set_bin_flash_color(int bin_index, const LColor &color)
Changes the flash color for the given bin index.
const LColor & get_bin_flash_color(int bin_index) const
Returns the color that this bin has been configured to flash to, if configured.
void remove_bin(int bin_index)
Permanently removes the indicated 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_...
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...
get_bin
Returns the bin_index of the nth bin in the set, where n is a number between 0 and get_num_bins().
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_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_...
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_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...
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() ...
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.
PointerTo< CullBin > make_new_bin(int bin_index, GraphicsStateGuardianBase *gsg, const PStatCollector &draw_region_pcollector)
Intended to be called by CullResult when a new CullBin pointer corresponding to the indicated bin_ind...
get_num_bins
Returns the number of bins in the world.
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.
A collection of Geoms and their associated state, for a particular scene.
This stores the result of a BinCullHandler traversal: an ordered collection of CullBins,...
This is a base class for the GraphicsStateGuardian class, which is itself a base class for the variou...
A lightweight class that represents a single element that may be timed and/or counted via stats.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.