#ifndef _OTB_TRISKELE_WEIGHT_ATTRIBUTES_TPP #define _OTB_TRISKELE_WEIGHT_ATTRIBUTES_TPP template inline WeightAttributes::WeightAttributes (const Tree &tree) : CompAttribute (tree) { } template inline WeightAttributes::~WeightAttributes () { } template inline void WeightAttributes::setWeightBounds (Tree &tree) { vector &weightBounds (tree.getWeightBounds ()); DimImg rootId = tree.getCompRoot (); DimImg stepsCard = 0; WeightT curLevel = CompAttribute::values [0]; for (DimImg compId = 1; compId <= rootId; ++compId) { if (CompAttribute::values [compId] == curLevel) continue; ++stepsCard; curLevel = CompAttribute::values [compId]; } weightBounds.clear (); weightBounds.reserve (stepsCard+1); weightBounds.push_back (0); curLevel = CompAttribute::values [0]; for (DimImg compId = 1; compId <= rootId; ++compId) { if (CompAttribute::values [compId] == curLevel) continue; weightBounds.push_back (compId); curLevel = CompAttribute::values [compId]; } weightBounds.push_back (rootId+1); } #endif // _OTB_TRISKELE_WEIGHT_ATTRIBUTES_TPP