triskele/include/Attributes/AreaAttributes.tpp
Git Merciol 869eda6449 modifié : include/ArrayTree/ArrayTreeBuilder.tpp
modifié :         include/AttributeProfiles.hpp
	modifié :         include/AttributeProfiles.tpp
	modifié :         include/Attributes/AreaAttributes.hpp
	modifié :         include/Attributes/AreaAttributes.tpp
	modifié :         include/Attributes/WeightAttributes.hpp
	modifié :         include/Attributes/WeightAttributes.tpp
	modifié :         include/Tree.hpp
	modifié :         include/Tree.tpp
	modifié :         include/triskeleBase.tpp
	modifié :         src/Tree.cpp
	modifié :         src/XMLTree/XMLTreeBuilder.cpp
	modifié :         src/testMain.cpp
2018-02-19 16:56:30 +01:00

26 lines
691 B
C++

#ifndef _OTB_TRISKELE_AREA_ATTRIBUTES_TPP
#define _OTB_TRISKELE_AREA_ATTRIBUTES_TPP
inline
AreaAttributes::AreaAttributes (const Tree &tree, const unsigned int &treeCoreCount)
: CompAttributeC<DimImg> (tree, treeCoreCount) {
compute ();
}
inline
AreaAttributes::~AreaAttributes () {
}
inline void
AreaAttributes::compute () {
computeSameCompLevel ([this] (const DimImg &parentId) {
DimImg area = 0;
tree.forEachChildTI (parentId, [this, &area] (const bool &isLeaf, const DimImg &childId) {
area += isLeaf ? 1 : CompAttribute<DimImg>::values [childId];
});
CompAttribute<DimImg>::values [parentId] = area;
});
}
#endif // _OTB_TRISKELE_AREA_ATTRIBUTES_TPP