- Timestamp:
- 05/11/11 15:07:33 (13 months ago)
- Location:
- trunk/avango-utils
- Files:
-
- 4 edited
-
include/avango/utils/MultiValueField.h (modified) (13 diffs)
-
include/avango/utils/register_multivaluefield.h (modified) (2 diffs)
-
python/SConscript (modified) (1 diff)
-
src/MultiValueField.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/avango-utils/include/avango/utils/MultiValueField.h
r508 r565 96 96 * of the field container using this field. 97 97 */ 98 virtual bool valueHasChanged(u int i) const98 virtual bool valueHasChanged(unsigned int i) const 99 99 { 100 100 return mChangedValues.at(i); … … 105 105 * Call it in fieldHasChanged() of the field container using this field. 106 106 */ 107 virtual std::vector<u int> changedValueInds() const108 { 109 std::vector<u int> inds;110 111 for (u int i = 0; i < mChangedValues.size(); i++)107 virtual std::vector<unsigned int> changedValueInds() const 108 { 109 std::vector<unsigned int> inds; 110 111 for (unsigned int i = 0; i < mChangedValues.size(); i++) 112 112 if (mChangedValues[i]) 113 113 inds.push_back(i); … … 130 130 * passed in v_inds. The new values should be passed in v. 131 131 */ 132 virtual void setSomeValues(const ContainerType& v, const std::vector<u int>& v_inds)133 { 134 for (u int u = 0; u < v_inds.size(); u++)132 virtual void setSomeValues(const ContainerType& v, const std::vector<unsigned int>& v_inds) 133 { 134 for (unsigned int u = 0; u < v_inds.size(); u++) 135 135 set1Value(v.at(u), v_inds[u], false); 136 136 … … 184 184 * Or use the method triggerFieldChange(). 185 185 */ 186 virtual void set1Value(const Value& v, u int i, bool trigger_field_change = true)186 virtual void set1Value(const Value& v, unsigned int i, bool trigger_field_change = true) 187 187 { 188 188 set1Value(v, i, 0, trigger_field_change); … … 192 192 * Returns value at position i. 193 193 */ 194 virtual const Value get1Value(u int i) const194 virtual const Value get1Value(unsigned int i) const 195 195 { 196 196 return mValue.at(i); … … 200 200 * Inserts one value before given position. Caller can decide if this should trigger a fieldChanged(). 201 201 */ 202 virtual void insert1Value(const Value& v, u int before, bool trigger_field_change = true)202 virtual void insert1Value(const Value& v, unsigned int before, bool trigger_field_change = true) 203 203 { 204 204 if (before > mValue.size()) … … 208 208 mChangedValues.insert(mChangedValues.begin() + before, true); 209 209 210 for (u int p = before + 1; p < mChangedValues.size(); p++)210 for (unsigned int p = before + 1; p < mChangedValues.size(); p++) 211 211 mChangedValues[p] = true; 212 212 … … 215 215 } 216 216 217 virtual void erase1Value(u int pos, bool trigger_field_change = true)217 virtual void erase1Value(unsigned int pos, bool trigger_field_change = true) 218 218 { 219 219 if (pos >= mValue.size()) … … 223 223 mChangedValues.erase(mChangedValues.begin() + pos); 224 224 225 for (u int p = pos; p < mChangedValues.size(); p++)225 for (unsigned int p = pos; p < mChangedValues.size(); p++) 226 226 mChangedValues[p] = true; 227 227 … … 243 243 if (f != mValue.end()) 244 244 { 245 u int pos = f - mValue.begin();245 unsigned int pos = f - mValue.begin(); 246 246 mValue.erase(f); 247 247 mChangedValues.erase(mChangedValues.begin() + pos); 248 248 249 for (u int p = pos; p < mChangedValues.size(); p++)249 for (unsigned int p = pos; p < mChangedValues.size(); p++) 250 250 mChangedValues[p] = true; 251 251 … … 265 265 266 266 /** 267 * Help function for set1Value(const Value&, u int, bool). Needed in the public part since the267 * Help function for set1Value(const Value&, unsigned int, bool). Needed in the public part since the 268 268 * template specializations of pullValueImpl() use a non-member help function that needs to call it. 269 269 * Should appear in the protected part. 270 270 */ 271 virtual void set1Value(const Value& v, u int i, Field* triggered_from, bool trigger_field_change = true)271 virtual void set1Value(const Value& v, unsigned int i, Field* triggered_from, bool trigger_field_change = true) 272 272 { 273 273 mValue.at(i) = v; … … 290 290 * Would prefer to have this in the protected part. Needed by non-member help functions. 291 291 */ 292 virtual void resize(u int sz)292 virtual void resize(unsigned int sz) 293 293 { 294 294 mValue.resize(sz); … … 442 442 MultiValueField<Value> *fromMVField = dynamic_cast<MultiValueField<Value>*>(fromField); 443 443 444 u int sz = fromMVField->getSize();444 unsigned int sz = fromMVField->getSize(); 445 445 resize(sz); 446 u int last_changed_ind = sz;447 448 for (u int i = 0; i < sz; i++)446 unsigned int last_changed_ind = sz; 447 448 for (unsigned int i = 0; i < sz; i++) 449 449 { 450 450 if (fromMVField->valueHasChanged(i)) -
trunk/avango-utils/include/avango/utils/register_multivaluefield.h
r503 r565 120 120 121 121 len = boost::python::extract<int>(inds.attr("__len__")()); 122 std::vector<u int> inds_list(len);122 std::vector<unsigned int> inds_list(len); 123 123 for(int i = 0; i != len; ++i) 124 124 { 125 125 boost::python::object indx = inds.attr("__getitem__")(i); 126 inds_list[i] = boost::python::extract<u int>(indx);126 inds_list[i] = boost::python::extract<unsigned int>(indx); 127 127 } 128 128 … … 137 137 138 138 // this declaration is necessary to avoid ambiguities because of function overloading 139 void (Type::*set_1value_fptr)(const typename Type::ValueType&, u int, bool) = &Type::set1Value;139 void (Type::*set_1value_fptr)(const typename Type::ValueType&, unsigned int, bool) = &Type::set1Value; 140 140 141 141 boost::python::class_<Type, boost::python::bases<av::Field> >(name.c_str()) -
trunk/avango-utils/python/SConscript
r522 r565 31 31 avango.build.add_library(env, 'avango-core') 32 32 avango.build.add_library(env, 'avango-osg') 33 avango.build.add_library(env, 'avango-core') 34 for lib in ['osg', 'osgDB', 'osgGA', 'osgViewer', 'osgParticle', 'osgText', 'osgUtil', 'GL', 'GLU']: 35 avango.build.add_library(env, lib) 33 36 34 37 lib = env.SharedLibrary("_utils.cpp") -
trunk/avango-utils/src/MultiValueField.cpp
r503 r565 103 103 av::utils::MultiValueField<FromType> *fromMVField = dynamic_cast<av::utils::MultiValueField<FromType>*>(fromField); 104 104 AV_ASSERT(fromMVField); 105 u int sz(fromMVField->getSize());105 unsigned int sz(fromMVField->getSize()); 106 106 toMVField->resize(sz); 107 u int last_changed_ind = sz;108 109 for (u int i = 0; i < sz; i++)107 unsigned int last_changed_ind = sz; 108 109 for (unsigned int i = 0; i < sz; i++) 110 110 { 111 111 if (fromMVField->valueHasChanged(i))
Note: See TracChangeset
for help on using the changeset viewer.
