triskele/include/ArrayTree/ArrayTreeBuilder.hpp
Git Merciol ed9141d5c5 modifié : include/ArrayTree/ArrayTreeBuilder.hpp
modifié :         include/ArrayTree/ArrayTreeBuilder.tpp
	modifié :         include/ArrayTree/Border.hpp
	modifié :         include/ArrayTree/GraphWalker.tpp
	modifié :         include/ArrayTree/Leader.hpp
	modifié :         include/ArrayTree/Leader.tpp
	modifié :         include/ArrayTree/Weight.hpp
	modifié :         include/ArrayTree/Weight.tpp
	modifié :         include/ArrayTree/triskeleArrayTreeBase.hpp
	modifié :         include/ArrayTree/triskeleArrayTreeBase.tpp
	modifié :         include/IImage.hpp
	modifié :         include/IImage.tpp
	modifié :         include/Tree.hpp
	modifié :         include/Tree.tpp
	modifié :         include/TreeBuilder.hpp
	modifié :         include/XMLTree/XMLTreeBuilder.hpp
	modifié :         include/triskeleBase.hpp
	modifié :         include/triskeleDealThreads.hpp
	modifié :         include/triskeleDealThreads.tpp
	modifié :         include/triskeleDebug.hpp
	modifié :         include/triskeleGdalGetType.hpp
	nouveau fichier : src/IImage.cpp
	modifié :         src/QuadTree/QuadTreeBuilder.cpp
	modifié :         src/Tree.cpp
	modifié :         src/testMain.cpp
	modifié :         src/triskeleDebug.cpp
2018-02-18 08:24:25 +01:00

122 lines
3.2 KiB
C++

#ifndef _OTB_TRISKELE_ARRAY_TREE_BUILDER_HPP
#define _OTB_TRISKELE_ARRAY_TREE_BUILDER_HPP
#ifdef ENABLE_LOG
#include <iostream>
#endif // ENABLE_LOG
#include "triskeleSort.hpp"
#include "triskeleDealThreads.hpp"
#include "TreeBuilder.hpp"
#include "IImage.hpp"
#include "GraphWalker.hpp"
#include "Weight.hpp"
#include "Leader.hpp"
namespace otb {
namespace triskele {
namespace arrayTree {
template <typename WeightT, typename PixelT>
class ArrayTreeBuilder : public TreeBuilder {
const unsigned int coreCount;
const Raster<PixelT> &raster;
const GraphWalker &graphWalker;
TreeType type;
bool countingFlag;
Leader leaders;
DimNodeId *childCountRec;
WeightT *compWeights; // [leafCount]
public:
ArrayTreeBuilder (const unsigned int &coreCount,
Raster<PixelT> &raster, const GraphWalker &graphWalker,
const TreeType &treeType, const bool &countingSort = true);
~ArrayTreeBuilder () {}
inline void
buildTree (Tree &tree);
private:
template<typename WeightFunct>
inline void
buildTree (Tree &tree, const WeightFunct &weightFunct);
// template<typename WeightFunct>
// inline void
// fillAPTree (PixelT *leafAPTree, const WeightFunct &weightFunct);
template<typename WeightFunct>
inline void
buildParents (Edge<WeightT> *edges, const WeightFunct &weightFunct, const Rect &tile, DimImg &topParent);
template<typename WeightFunct>
inline void
connectLeaf (DimImg a, DimImg b, const WeightT &weight, DimImg &parCount, const WeightFunct &weightFunct);
template<typename WeightFunct>
inline void
connectComp (DimImg newComp, DimImg topA, DimImg topB, const WeightFunct &weightFunct);
template<typename WeightFunct>
inline void
connectComp (DimImg topA, DimImg topB, const WeightFunct &weightFunct);
template<typename WeightFunct>
inline DimImg
updateNewId (DimImg newCompId[], const vector<DimImg> &compBases, const vector<DimImg> &compTops, const WeightFunct &weightFunct);
inline void
updateNewId (DimImg newCompId[], const DimImg curComp, DimImg &compCount);
inline void
compress (DimImg newCompId[], const DimImg &compTop);
inline void
createParent (DimImg &topParent, const WeightT &weight, DimImg &childA, DimImg &childB);
inline void
addChild (const DimImg &parent, DimImg &child);
inline void
addChildren (const DimImg &parent, const DimImg &sibling);
inline DimImg
findRoot (DimImg comp);
template<typename WeightFunct>
inline DimImg
findTopComp (const DimImg &comp, const WeightFunct &weightFunct);
template<typename WeightFunct>
inline DimImg
findTopComp (DimImg comp, const WeightT &weight, const WeightFunct &weightFunct);
inline DimImg
findCompMultiChild (const DimImg newCompId[], DimImg comp);
inline void
buildChildren ();
template<typename WeightFunct>
inline void
initWeights (const GraphWalker &graphWalker, const WeightFunct &weightFunct);
// #ifdef ENABLE_LOG
// inline void
// printTree (const Size &size, const bool &rec);
// inline void
// printLeaders (const Size &size);
// inline void
// printNewCompIdx (const Size &size);
// #endif
};
#include "ArrayTreeBuilder.tpp"
} // arrayTree
} // triskele
} // otb
#endif // _OTB_TRISKELE_ARRAY_TREE_BUILDER_HPP