00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 INLINE CullBinManager::SortBins::
00024 SortBins(CullBinManager *manager) :
00025 _manager(manager)
00026 {
00027 }
00028
00029
00030
00031
00032
00033
00034
00035
00036 INLINE bool CullBinManager::SortBins::
00037 operator () (int a, int b) const {
00038 return _manager->_bin_definitions[a]._sort < _manager->_bin_definitions[b]._sort;
00039 }
00040
00041
00042
00043
00044
00045
00046
00047
00048 INLINE int CullBinManager::
00049 get_num_bins() const {
00050
00051
00052
00053 if (!_bins_are_sorted) {
00054 ((CullBinManager *)this)->do_sort_bins();
00055 }
00056 return _sorted_bins.size();
00057 }
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068 INLINE int CullBinManager::
00069 get_bin(int n) const {
00070 nassertr(n >= 0 && n < (int)_sorted_bins.size(), -1);
00071 return _sorted_bins[n];
00072 }
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082 INLINE string CullBinManager::
00083 get_bin_name(int bin_index) const {
00084 nassertr(bin_index >= 0 && bin_index < (int)_bin_definitions.size(), string());
00085 nassertr(_bin_definitions[bin_index]._in_use, string());
00086 return _bin_definitions[bin_index]._name;
00087 }
00088
00089
00090
00091
00092
00093
00094
00095
00096 INLINE CullBinManager::BinType CullBinManager::
00097 get_bin_type(int bin_index) const {
00098 nassertr(bin_index >= 0 && bin_index < (int)_bin_definitions.size(), BT_invalid);
00099 nassertr(_bin_definitions[bin_index]._in_use, BT_invalid);
00100 return _bin_definitions[bin_index]._type;
00101 }
00102
00103
00104
00105
00106
00107
00108
00109 INLINE CullBinManager::BinType CullBinManager::
00110 get_bin_type(const string &name) const {
00111 int bin_index = find_bin(name);
00112 nassertr(bin_index != -1, BT_invalid);
00113 return get_bin_type(bin_index);
00114 }
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127 INLINE void CullBinManager::
00128 set_bin_type(int bin_index, CullBinManager::BinType type) {
00129 nassertv(bin_index >= 0 && bin_index < (int)_bin_definitions.size());
00130 nassertv(_bin_definitions[bin_index]._in_use);
00131 _bin_definitions[bin_index]._type = type;
00132 }
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144 INLINE void CullBinManager::
00145 set_bin_type(const string &name, CullBinManager::BinType type) {
00146 int bin_index = find_bin(name);
00147 nassertv(bin_index != -1);
00148 set_bin_type(bin_index, type);
00149 }
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162 INLINE int CullBinManager::
00163 get_bin_sort(int bin_index) const {
00164 nassertr(bin_index >= 0 && bin_index < (int)_bin_definitions.size(), 0);
00165 nassertr(_bin_definitions[bin_index]._in_use, 0);
00166 return _bin_definitions[bin_index]._sort;
00167 }
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179 INLINE int CullBinManager::
00180 get_bin_sort(const string &name) const {
00181 int bin_index = find_bin(name);
00182 nassertr(bin_index != -1, 0);
00183 return get_bin_sort(bin_index);
00184 }
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197 INLINE void CullBinManager::
00198 set_bin_sort(int bin_index, int sort) {
00199 nassertv(bin_index >= 0 && bin_index < (int)_bin_definitions.size());
00200 nassertv(_bin_definitions[bin_index]._in_use);
00201 _bin_definitions[bin_index]._sort = sort;
00202 _bins_are_sorted = false;
00203 }
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215 INLINE void CullBinManager::
00216 set_bin_sort(const string &name, int sort) {
00217 int bin_index = find_bin(name);
00218 nassertv(bin_index != -1);
00219 set_bin_sort(bin_index, sort);
00220 }
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232 INLINE bool CullBinManager::
00233 get_bin_active(int bin_index) const {
00234 nassertr(bin_index >= 0 && bin_index < (int)_bin_definitions.size(), false);
00235 nassertr(_bin_definitions[bin_index]._in_use, false);
00236 return _bin_definitions[bin_index]._active;
00237 }
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248 INLINE bool CullBinManager::
00249 get_bin_active(const string &name) const {
00250 int bin_index = find_bin(name);
00251 nassertr(bin_index != -1, false);
00252 return get_bin_active(bin_index);
00253 }
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265 INLINE void CullBinManager::
00266 set_bin_active(int bin_index, bool active) {
00267 nassertv(bin_index >= 0 && bin_index < (int)_bin_definitions.size());
00268 nassertv(_bin_definitions[bin_index]._in_use);
00269 _bin_definitions[bin_index]._active = active;
00270 }
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281 INLINE void CullBinManager::
00282 set_bin_active(const string &name, bool active) {
00283 int bin_index = find_bin(name);
00284 nassertv(bin_index != -1);
00285 set_bin_active(bin_index, active);
00286 }