+ {
+ min_index = min(min_index, *i);
+ max_index = max(max_index, *i);
+ }
+
+ if((data_type==UNSIGNED_BYTE || data_type==UNSIGNED_SHORT) && max_index>0xFFFE)
+ set_data_type(UNSIGNED_INT);
+ else if(data_type==UNSIGNED_BYTE && max_index>0xFE)
+ set_data_type(UNSIGNED_SHORT);
+
+ unsigned base = data.size();
+ data.resize(data.size()+ind.size()*get_index_size());
+ if(data_type==UNSIGNED_SHORT)
+ {
+ unsigned short *ptr = reinterpret_cast<unsigned short *>(&data[base]);
+ for(unsigned i=0; i<ind.size(); ++i)
+ ptr[i] = ind[i];
+ }
+ else if(data_type==UNSIGNED_INT)
+ {
+ unsigned *ptr = reinterpret_cast<unsigned *>(&data[base]);
+ for(unsigned i=0; i<ind.size(); ++i)
+ ptr[i] = ind[i];
+ }
+ else
+ {
+ for(unsigned i=0; i<ind.size(); ++i)
+ data[base+i] = ind[i];
+ }