modifié : include/ArrayTree/ArrayTreeBuilder.hpp

modifié :         include/ArrayTree/ArrayTreeBuilder.tpp
	modifié :         include/ArrayTree/Border.hpp
	modifié :         include/ArrayTree/Border.tpp
	modifié :         include/ArrayTree/GraphWalker.tpp
	modifié :         include/ArrayTree/Leader.hpp
	modifié :         include/ArrayTree/Leader.tpp
	modifié :         include/Attribute.hpp
	modifié :         include/AttributeProfiles.hpp
	modifié :         include/AttributeProfiles.tpp
	modifié :         include/CompAttribute.hpp
	modifié :         include/CompAttribute.tpp
	modifié :         include/IImage.hpp
	modifié :         include/IImage.tpp
	modifié :         include/Tree.hpp
	modifié :         include/Tree.tpp
	modifié :         include/TreeBuilder.hpp
	modifié :         include/TreeBuilder.tpp
	supprimé :        src/Attribute.cpp
	modifié :         src/CMakeLists.txt
	modifié :         src/QuadTree/QuadTreeBuilder.cpp
	modifié :         src/TestArrayTreeBuilder.cpp
	modifié :         src/Tree.cpp
	modifié :         src/XMLTree/XMLTreeBuilder.cpp
	modifié :         src/apGenerator.cpp
This commit is contained in:
Git Merciol 2018-03-06 21:57:15 +01:00
parent 5d83342f5f
commit 8ca10923c4
25 changed files with 152 additions and 240 deletions

View File

@ -34,7 +34,7 @@ namespace otb {
Leader leaders; Leader leaders;
// transcient // transcient
DimNodeId *childCountRec; DimNodeId *childCount;
DimImg *newCompId; DimImg *newCompId;
WeightT *compWeights; WeightT *compWeights;
public: public:

View File

@ -14,7 +14,7 @@ ArrayTreeBuilder<WeightT, PixelT>::ArrayTreeBuilder (Raster<PixelT> &raster, con
treeType (treeType), treeType (treeType),
countingFlag (countingSort), countingFlag (countingSort),
compWeights (nullptr), compWeights (nullptr),
childCountRec (nullptr), childCount (nullptr),
newCompId (nullptr) newCompId (nullptr)
{ {
DEF_LOG ("ArrayTreeBuilder::ArrayTreeBuilder", ""); DEF_LOG ("ArrayTreeBuilder::ArrayTreeBuilder", "");
@ -35,7 +35,7 @@ ArrayTreeBuilder<WeightT, PixelT>::buildTree (Tree &tree, WeightAttributes<Weigh
if (!leafCount) if (!leafCount)
return; return;
leaders.book (leafCount); leaders.book (leafCount);
childCountRec = childCount+2; childCount = childSum+2;
newCompId = leaders.getLeaders (); newCompId = leaders.getLeaders ();
compWeights = weightAttributes.getValues (); compWeights = weightAttributes.getValues ();
SMART_LOG_EXPR (dealThreadFill_n (leafCount-1, coreCount, compWeights, 0)); SMART_LOG_EXPR (dealThreadFill_n (leafCount-1, coreCount, compWeights, 0));
@ -64,7 +64,7 @@ ArrayTreeBuilder<WeightT, PixelT>::buildTree (Tree &tree, WeightAttributes<Weigh
leaders.free (); leaders.free ();
newCompId = nullptr; newCompId = nullptr;
buildChildren (); buildChildren ();
childCountRec = nullptr; childCount = nullptr;
SMART_LOG (tree.printTree ()); SMART_LOG (tree.printTree ());
} }
@ -279,7 +279,7 @@ ArrayTreeBuilder<WeightT, PixelT>::buildParents (Edge<WeightT> *edges, const Wei
continue; continue;
} else if (compWeights[ra] == compWeights [rb]) { } else if (compWeights[ra] == compWeights [rb]) {
// ra.weight = rb.weight // XXX ?= curEdge.weight // ra.weight = rb.weight // XXX ?= curEdge.weight
if (childCountRec [ra] < childCountRec [rb]) { if (childCount [ra] < childCount [rb]) {
swap (la, lb); swap (la, lb);
swap (ra, rb); swap (ra, rb);
} }
@ -302,7 +302,7 @@ ArrayTreeBuilder<WeightT, PixelT>::buildParents (Edge<WeightT> *edges, const Wei
leaders.link (pa, leader); leaders.link (pa, leader);
leaders.link (pb, leader); leaders.link (pb, leader);
SMART_LOG (" leader:" << leader << " w:" << compWeights [leader] << " c:" << childCountRec [leader]); SMART_LOG (" leader:" << leader << " w:" << compWeights [leader] << " c:" << childCount [leader]);
} }
SMART_LOG ("topParent:" << topParent); SMART_LOG ("topParent:" << topParent);
@ -315,8 +315,8 @@ ArrayTreeBuilder<WeightT, PixelT>::unlinkParent (const DimImg &par) {
SMART_DEF_LOG ("ArrayTreeBuilder::unlinkParent", "par: " << logComp (par)); SMART_DEF_LOG ("ArrayTreeBuilder::unlinkParent", "par: " << logComp (par));
if (par == DimImg_MAX) if (par == DimImg_MAX)
return; return;
BOOST_ASSERT (childCountRec [par]); BOOST_ASSERT (childCount [par]);
--childCountRec [par]; --childCount [par];
} }
// ---------------------------------------- // ----------------------------------------
@ -404,7 +404,7 @@ ArrayTreeBuilder<WeightT, PixelT>::connectLeaf (DimImg a, DimImg b, const Weight
// eqW1 | eqW2 // eqW1 | eqW2
SMART_LOG ("eqW1 | eqW2: incr leaf"); SMART_LOG ("eqW1 | eqW2: incr leaf");
unlinkParent (parA); unlinkParent (parA);
++childCountRec[parB]; ++childCount[parB];
leafParents[a] = parB; leafParents[a] = parB;
SMART_LOG ("parA: " << logComp (parA) << " parB: " << logComp (parB)); SMART_LOG ("parA: " << logComp (parA) << " parB: " << logComp (parB));
} }
@ -431,7 +431,7 @@ ArrayTreeBuilder<WeightT, PixelT>::connect3Comp (DimImg newComp, DimImg topA, Di
BOOST_ASSERT (findTopComp (topB, weightFunct) == topB); BOOST_ASSERT (findTopComp (topB, weightFunct) == topB);
BOOST_ASSERT (weightFunct.isWeightInf (compWeights[newComp], compWeights[topB])); BOOST_ASSERT (weightFunct.isWeightInf (compWeights[newComp], compWeights[topB]));
compParents[newComp] = topB; compParents[newComp] = topB;
++childCountRec[topB]; ++childCount[topB];
SMART_LOG ("topB: " << logComp (topB)); SMART_LOG ("topB: " << logComp (topB));
connectComp (topA, topB, weightFunct); connectComp (topA, topB, weightFunct);
} }
@ -454,20 +454,20 @@ ArrayTreeBuilder<WeightT, PixelT>::connectComp (DimImg topA, DimImg topB, const
if (topA == topB) if (topA == topB)
return; return;
if (compWeights[topA] == compWeights[topB] && if (compWeights[topA] == compWeights[topB] &&
childCountRec[topA] < childCountRec[topB]) childCount[topA] < childCount[topB])
swap (topA, topB); swap (topA, topB);
DimImg grandParB = findTopComp (compParents[topB], weightFunct); DimImg grandParB = findTopComp (compParents[topB], weightFunct);
if (compWeights[topA] == compWeights[topB]) { if (compWeights[topA] == compWeights[topB]) {
childCountRec[topA] += childCountRec[topB]; childCount[topA] += childCount[topB];
childCountRec[topB] = 0; childCount[topB] = 0;
} else } else
++childCountRec[topA]; ++childCount[topA];
compParents[topB] = topA; compParents[topB] = topA;
SMART_LOG ("topA: " << logComp (topA) << " topB: " << logComp (topB)); SMART_LOG ("topA: " << logComp (topA) << " topB: " << logComp (topB));
if (grandParB == DimImg_MAX) if (grandParB == DimImg_MAX)
return; return;
BOOST_ASSERT (childCountRec [grandParB]); BOOST_ASSERT (childCount [grandParB]);
--childCountRec[grandParB]; --childCount[grandParB];
SMART_LOG ("grandParB: " << logComp (grandParB)); SMART_LOG ("grandParB: " << logComp (grandParB));
topB = topA; topB = topA;
topA = findTopComp (grandParB, compWeights[topA], weightFunct); topA = findTopComp (grandParB, compWeights[topA], weightFunct);
@ -504,7 +504,7 @@ ArrayTreeBuilder<WeightT, PixelT>::updateNewId (const DimImg curComp, DimImg &co
return; return;
const DimImg &top = findCompMultiChild (curComp); const DimImg &top = findCompMultiChild (curComp);
BOOST_ASSERT (top != DimImg_MAX); BOOST_ASSERT (top != DimImg_MAX);
BOOST_ASSERT (childCountRec[top]); BOOST_ASSERT (childCount[top]);
if (curComp != top) { if (curComp != top) {
// 0 => merge || no more child // 0 => merge || no more child
@ -523,13 +523,13 @@ ArrayTreeBuilder<WeightT, PixelT>::updateNewId (const DimImg curComp, DimImg &co
// // XXX arbres non-connexe ? // // XXX arbres non-connexe ?
// cerr << "coucou ptop-max: " << curComp << endl; // cerr << "coucou ptop-max: " << curComp << endl;
} }
const DimNodeId &newTopChildCountRec = childCountRec[top]; const DimNodeId &newTopChildCountRec = childCount[top];
const DimImg &newTopCompParent = compParents[top]; const DimImg &newTopCompParent = compParents[top];
const WeightT &newTopWeight = compWeights[top]; // only in case of unnecessary comp const WeightT &newTopWeight = compWeights[top]; // only in case of unnecessary comp
for (DimImg sibling = curComp; sibling != top; ) { for (DimImg sibling = curComp; sibling != top; ) {
DimImg nextSibling = compParents[sibling]; DimImg nextSibling = compParents[sibling];
newCompId[sibling] = newTopIdx; newCompId[sibling] = newTopIdx;
childCountRec[sibling] = newTopChildCountRec; childCount[sibling] = newTopChildCountRec;
compParents[sibling] = newTopCompParent; compParents[sibling] = newTopCompParent;
// only in case of unnecessary comp // only in case of unnecessary comp
compWeights[sibling] = newTopWeight; compWeights[sibling] = newTopWeight;
@ -571,7 +571,7 @@ ArrayTreeBuilder<WeightT, PixelT>::compress (const DimImg &compTop) {
swap (compParents[curComp], compParents[newIdxComp]); swap (compParents[curComp], compParents[newIdxComp]);
swap (compWeights[curComp], compWeights[newIdxComp]); swap (compWeights[curComp], compWeights[newIdxComp]);
swap (childCountRec[curComp], childCountRec[newIdxComp]); swap (childCount[curComp], childCount[newIdxComp]);
swap (newCompId[curComp], newCompId[newIdxComp]); swap (newCompId[curComp], newCompId[newIdxComp]);
} }
// XXX YYY curComp ? compTop ? // XXX YYY curComp ? compTop ?
@ -581,7 +581,7 @@ ArrayTreeBuilder<WeightT, PixelT>::compress (const DimImg &compTop) {
template<typename WeightT, typename PixelT> template<typename WeightT, typename PixelT>
inline DimImg inline DimImg
ArrayTreeBuilder<WeightT, PixelT>::createParent (DimImg &topParent, const WeightT &weight, DimImg &parentChildA, DimImg &parentChildB) { ArrayTreeBuilder<WeightT, PixelT>::createParent (DimImg &topParent, const WeightT &weight, DimImg &parentChildA, DimImg &parentChildB) {
childCountRec [topParent] = 2; childCount [topParent] = 2;
compWeights [topParent] = weight; compWeights [topParent] = weight;
return parentChildA = parentChildB = topParent++; return parentChildA = parentChildB = topParent++;
} }
@ -590,7 +590,7 @@ ArrayTreeBuilder<WeightT, PixelT>::createParent (DimImg &topParent, const Weight
template<typename WeightT, typename PixelT> template<typename WeightT, typename PixelT>
inline void inline void
ArrayTreeBuilder<WeightT, PixelT>::addChild (const DimImg &parent, DimImg &child) { ArrayTreeBuilder<WeightT, PixelT>::addChild (const DimImg &parent, DimImg &child) {
++childCountRec [parent]; ++childCount [parent];
child = parent; child = parent;
} }
@ -598,8 +598,8 @@ ArrayTreeBuilder<WeightT, PixelT>::addChild (const DimImg &parent, DimImg &child
template<typename WeightT, typename PixelT> template<typename WeightT, typename PixelT>
inline void inline void
ArrayTreeBuilder<WeightT, PixelT>::addChildren (const DimImg &parent, const DimImg &sibling) { ArrayTreeBuilder<WeightT, PixelT>::addChildren (const DimImg &parent, const DimImg &sibling) {
childCountRec [parent] += childCountRec [sibling]; childCount [parent] += childCount [sibling];
childCountRec [sibling] = 0; childCount [sibling] = 0;
compParents [sibling] = parent; compParents [sibling] = parent;
} }
@ -661,7 +661,7 @@ ArrayTreeBuilder<WeightT, PixelT>::findCompMultiChild (DimImg comp) {
const DimImg &parent = compParents[comp]; const DimImg &parent = compParents[comp];
if (parent == DimImg_MAX) if (parent == DimImg_MAX)
return comp; return comp;
if (childCountRec[comp] > 1 && compWeights[comp] != compWeights[parent]) if (childCount[comp] > 1 && compWeights[comp] != compWeights[parent])
return comp; return comp;
comp = parent; comp = parent;
} }
@ -674,21 +674,21 @@ ArrayTreeBuilder<WeightT, PixelT>::buildChildren () {
SMART_DEF_LOG ("ArrayTreeBuilder::buildChildren", ""); SMART_DEF_LOG ("ArrayTreeBuilder::buildChildren", "");
BOOST_ASSERT (childCount[0] == 0); BOOST_ASSERT (childSum[0] == 0);
BOOST_ASSERT (childCount[1] == 0); BOOST_ASSERT (childSum[1] == 0);
DimImg compCount = getCompCount (); DimImg compCount = getCompCount ();
partial_sum (childCountRec, childCountRec+compCount, childCountRec); partial_sum (childCount, childCount+compCount, childCount);
// set // set
DimNodeId *childGetOrder = childCount+1; DimNodeId *childGetOrder = childSum+1;
for (DimNodeId i = 0; i < nodeCount-1; ++i) { for (DimNodeId i = 0; i < nodeCount-1; ++i) {
if (leafParents[i] == DimImg_MAX) if (leafParents[i] == DimImg_MAX)
continue; continue;
BOOST_ASSERT (leafParents[i] < compCount); BOOST_ASSERT (leafParents[i] < compCount);
children[childGetOrder[leafParents[i]]++] = i; children[childGetOrder[leafParents[i]]++] = i;
} }
BOOST_ASSERT (childCount[0] == 0); BOOST_ASSERT (childSum[0] == 0);
} }
// ======================================== // ========================================
@ -701,7 +701,7 @@ inline ostream &
ArrayTreeBuilder<WeightT, PixelT>::CLogComp::print (ostream &out) const { ArrayTreeBuilder<WeightT, PixelT>::CLogComp::print (ostream &out) const {
if (compId == DimImg_MAX) if (compId == DimImg_MAX)
return out << "M(-/-)"; return out << "M(-/-)";
return out << compId << "(" << atb.childCountRec[compId] << "/" << atb.compWeights [compId] << ")"; return out << compId << "(" << atb.childCount[compId] << "/" << atb.compWeights [compId] << ")";
} }
// template<typename WeightT, typename PixelT> // template<typename WeightT, typename PixelT>

View File

@ -60,7 +60,7 @@ namespace otb {
Size size; Size size;
/*! Tableau "simplifié" des pixels */ /*! Tableau "simplifié" des pixels */
uint8_t *map; vector<uint8_t> map;
friend inline ostream &operator << (ostream &out, const Border &border); friend inline ostream &operator << (ostream &out, const Border &border);
}; };

View File

@ -12,12 +12,12 @@ Border::getMapLength (DimImg pixelsCount) {
inline bool inline bool
Border::isBorder (DimImg idx) const { Border::isBorder (DimImg idx) const {
return map ? map[idx/8] & (1 << (idx%8)) : false; return map.size () ? map[idx/8] & (1 << (idx%8)) : false;
} }
inline bool inline bool
Border::isBorder (const Point &p) const { Border::isBorder (const Point &p) const {
return map ? isBorder (pointToId (size, p)) : false; return map.size () ? isBorder (pointToId (size, p)) : false;
} }
inline void inline void
@ -45,7 +45,7 @@ Border::Border ()
: pixelsCount (0), : pixelsCount (0),
mapLength (0), mapLength (0),
size (), size (),
map (NULL) { map () {
} }
inline inline
@ -53,19 +53,16 @@ Border::Border (const Size &size, bool defaultVal)
: pixelsCount (getPixelsCount (size)), : pixelsCount (getPixelsCount (size)),
mapLength (getMapLength (pixelsCount)), mapLength (getMapLength (pixelsCount)),
size (size) { size (size) {
map = new uint8_t [mapLength];
reset (defaultVal); reset (defaultVal);
} }
inline inline
Border::~Border () { Border::~Border () {
if (map)
delete [] map;
} }
inline void inline void
Border::reset (bool defaultVal) { Border::reset (bool defaultVal) {
std::fill_n (map, mapLength, defaultVal ? 0xFF : 0); map.assign (mapLength, defaultVal ? 0xFF : 0);
if (!(mapLength && defaultVal)) if (!(mapLength && defaultVal))
return; return;
map[mapLength-1] &= 0xFF >> (8-(pixelsCount%8))%8; map[mapLength-1] &= 0xFF >> (8-(pixelsCount%8))%8;

View File

@ -289,10 +289,10 @@ GraphWalker::getCountingSortedEdges (const Rect &rect, TileItem tileItem, Edge<W
int bits = 8*sizeof (WeightT); int bits = 8*sizeof (WeightT);
BOOST_ASSERT (bits < 17); BOOST_ASSERT (bits < 17);
DimEdge dim = 1UL << bits; DimEdge dim = 1UL << bits;
DimImg *indices = new DimImg [dim+1]; vector<DimImg> counters (dim+1, 0);
DimImg *histogram = indices+1; DimImg *indices = &counters [0];
DimImg *histogram = &indices [1];
DimImg sum = 0; DimImg sum = 0;
fill_n (histogram, dim, 0);
forEachEdgePt (rect, tileItem, forEachEdgePt (rect, tileItem,
[&histogram, &ef] (Point const &a, Point const &b) { [&histogram, &ef] (Point const &a, Point const &b) {
++histogram[(size_t) ef.getWeight (a, b)]; ++histogram[(size_t) ef.getWeight (a, b)];
@ -322,7 +322,6 @@ GraphWalker::getCountingSortedEdges (const Rect &rect, TileItem tileItem, Edge<W
SMART_LOG_EXPR (cerr << printEdge (edge, size) << endl); SMART_LOG_EXPR (cerr << printEdge (edge, size) << endl);
}); });
SMART_LOG (endl << printEdges (edges, size, sum)); SMART_LOG (endl << printEdges (edges, size, sum));
delete [] (histogram-1);
return sum; return sum;
} }

View File

@ -1,10 +1,11 @@
#ifndef _OTB_TRISKELE_ARRAY_TREE_LEADER_HPP #ifndef _OTB_TRISKELE_ARRAY_TREE_LEADER_HPP
#define _OTB_TRISKELE_ARRAY_TREE_LEADER_HPP #define _OTB_TRISKELE_ARRAY_TREE_LEADER_HPP
#include <boost/assert.hpp>
#include <memory> #include <memory>
#include <vector>
#include <boost/assert.hpp>
//#include "triskeleDebug.hpp" #include "triskeleDebug.hpp"
#include "triskeleBase.hpp" #include "triskeleBase.hpp"
#include "triskeleArrayTreeBase.hpp" #include "triskeleArrayTreeBase.hpp"
@ -18,7 +19,7 @@ namespace otb {
DimImg size; DimImg size;
/*! Tableau des leaders, chaque case contient une référence vers principal leader connu */ /*! Tableau des leaders, chaque case contient une référence vers principal leader connu */
DimImg *leaders; vector<DimImg> leaders;
public: public:
inline Leader (); inline Leader ();
@ -30,9 +31,6 @@ namespace otb {
/*! Libère la mémoire allouée par les tableaux et met size à 0 */ /*! Libère la mémoire allouée par les tableaux et met size à 0 */
inline void free (); inline void free ();
/*! Remplit leaders de DimImg_MAX */
inline void reset ();
/*! Cherche le leaders du pixel a, Si a n'en a pas, cela retourne a */ /*! Cherche le leaders du pixel a, Si a n'en a pas, cela retourne a */
inline DimImg find (DimImg a) const; inline DimImg find (DimImg a) const;

View File

@ -5,7 +5,7 @@
inline inline
Leader::Leader () Leader::Leader ()
: size (0), : size (0),
leaders (NULL) { leaders () {
} }
inline inline
@ -17,37 +17,18 @@ Leader::~Leader () {
inline void inline void
Leader::book (DimImg vertexCount) { Leader::book (DimImg vertexCount) {
SMART_DEF_LOG ("Leader::book", "vertexCount:" << vertexCount); SMART_DEF_LOG ("Leader::book", "vertexCount:" << vertexCount);
if (vertexCount == size) {
reset ();
return;
}
free ();
if (!vertexCount)
return;
size = vertexCount; size = vertexCount;
leaders = new DimImg [vertexCount]; leaders.assign (size, DimImg_MAX);
reset ();
} }
// --------------------------------------- // ---------------------------------------
inline void inline void
Leader::free () { Leader::free () {
SMART_DEF_LOG ("Leader::free", ""); SMART_DEF_LOG ("Leader::free", "");
if (leaders) leaders = vector<DimImg> ();
delete [] leaders;
leaders = NULL;
size = 0; size = 0;
} }
// ---------------------------------------
inline void
Leader::reset () {
if (!size)
return;
// XXX dealThreadFill_n avec coreCount
std::fill_n (leaders, size, DimImg_MAX);
}
// ======================================== // ========================================
inline DimImg inline DimImg
Leader::find (DimImg a) const { Leader::find (DimImg a) const {
@ -83,7 +64,7 @@ Leader::link (DimImg a, const DimImg &r) {
// ======================================== // ========================================
inline DimImg * inline DimImg *
Leader::getLeaders () { Leader::getLeaders () {
return leaders; return &leaders[0];
} }
// ======================================== // ========================================

View File

@ -6,35 +6,35 @@
namespace otb { namespace otb {
namespace triskele { namespace triskele {
/** Attribute */ // /** Attribute */
class Attribute { // class Attribute {
public: // public:
Attribute (); // Attribute ();
Attribute (const Attribute &o) = delete; // Attribute (const Attribute &o) = delete;
void // void
setTree (Tree &treeC); // setTree (Tree &treeC);
template<typename T> // template<typename T>
void // void
free (); // free ();
template<typename T> // template<typename T>
T // T
getAttribute (const DimNodeId &nodeId); // getAttribute (const DimNodeId &nodeId);
template<typename T> // template<typename T>
void // void
generate (); // generate ();
protected: // protected:
virtual void // virtual void
generate () = 0; // generate () = 0;
protected: // protected:
Tree *tree; // Tree *tree;
void *attributes; // void *attributes;
}; // };
} // triskele } // triskele
} // otb } // otb

View File

@ -19,7 +19,7 @@ namespace otb {
protected: protected:
const Tree &tree; const Tree &tree;
DimNodeId leafCount; DimNodeId leafCount;
PixelT *values; vector<PixelT> values;
inline void free (); inline void free ();
inline void book (const DimImg &leafCount); inline void book (const DimImg &leafCount);

View File

@ -6,7 +6,7 @@ inline
AttributeProfiles<PixelT>::AttributeProfiles (const Tree &tree) AttributeProfiles<PixelT>::AttributeProfiles (const Tree &tree)
: tree (tree), : tree (tree),
leafCount (0), leafCount (0),
values (nullptr) { values () {
updateTranscient (); updateTranscient ();
} }
@ -25,33 +25,27 @@ AttributeProfiles<PixelT>::updateTranscient () {
template<typename PixelT> template<typename PixelT>
inline PixelT * inline PixelT *
AttributeProfiles<PixelT>::getValues () { AttributeProfiles<PixelT>::getValues () {
return values; return &values[0];
} }
template<typename PixelT> template<typename PixelT>
inline const PixelT * inline const PixelT *
AttributeProfiles<PixelT>::getValues () const { AttributeProfiles<PixelT>::getValues () const {
return values; return &values[0];
} }
template<typename PixelT> template<typename PixelT>
inline void inline void
AttributeProfiles<PixelT>::free () { AttributeProfiles<PixelT>::free () {
if (values) values = vector<PixelT> ();
delete[] values;
values = nullptr;
} }
template<typename PixelT> template<typename PixelT>
inline void inline void
AttributeProfiles<PixelT>::book (const DimImg &leafCount) { AttributeProfiles<PixelT>::book (const DimImg &leafCount) {
if (this->leafCount == leafCount)
return;
free ();
if (!leafCount)
return;
this->leafCount = leafCount; this->leafCount = leafCount;
values = new PixelT[leafCount*2]; // XXX max : leafCount*2-1
values.resize (leafCount*2);
} }
// ======================================== // ========================================
@ -60,7 +54,7 @@ ostream &
AttributeProfiles<PixelT>::print (ostream &out) const { AttributeProfiles<PixelT>::print (ostream &out) const {
const Size doubleSize (tree.getSize().width, 2*tree.getSize ().height); const Size doubleSize (tree.getSize().width, 2*tree.getSize ().height);
out << "AP" << endl out << "AP" << endl
<< printMap (values, doubleSize, tree.getNodeCount ()) << endl << endl; << printMap (&values[0], doubleSize, tree.getNodeCount ()) << endl << endl;
} }
#endif // _OTB_TRISKELE_ATTRIBUTE_PROFILES_TPP #endif // _OTB_TRISKELE_ATTRIBUTE_PROFILES_TPP

View File

@ -27,7 +27,7 @@ namespace otb {
protected: protected:
const Tree &tree; const Tree &tree;
DimNodeId leafCount; DimNodeId leafCount;
AttrT *values; vector<AttrT> values;
inline void free (); inline void free ();
inline void book (const DimImg &leafCount); inline void book (const DimImg &leafCount);

View File

@ -6,14 +6,13 @@ inline
CompAttribute<AttrT>::CompAttribute (const Tree &tree) CompAttribute<AttrT>::CompAttribute (const Tree &tree)
: tree (tree), : tree (tree),
leafCount (0), leafCount (0),
values (nullptr) { values () {
updateTranscient (); updateTranscient ();
} }
template<typename AttrT> template<typename AttrT>
inline inline
CompAttribute<AttrT>::~CompAttribute () { CompAttribute<AttrT>::~CompAttribute () {
free ();
} }
template<typename AttrT> template<typename AttrT>
@ -26,13 +25,13 @@ CompAttribute<AttrT>::updateTranscient () {
template<typename AttrT> template<typename AttrT>
inline const AttrT * inline const AttrT *
CompAttribute<AttrT>::getValues () const { CompAttribute<AttrT>::getValues () const {
return values; return &values[0];
} }
template<typename AttrT> template<typename AttrT>
inline AttrT * inline AttrT *
CompAttribute<AttrT>::getValues () { CompAttribute<AttrT>::getValues () {
return values; return &values[0];
} }
template<typename AttrT> template<typename AttrT>
@ -53,27 +52,20 @@ inline ostream &
CompAttribute<AttrT>::print (ostream &out, const string &msg) const { CompAttribute<AttrT>::print (ostream &out, const string &msg) const {
cout << "values: " << msg << endl; cout << "values: " << msg << endl;
const Size doubleSize (tree.getSize().width, 2*tree.getSize ().height); const Size doubleSize (tree.getSize().width, 2*tree.getSize ().height);
cout << printMap (values, doubleSize, tree.getCompCount ()) << endl << endl; cout << printMap (&values[0], doubleSize, tree.getCompCount ()) << endl << endl;
} }
template<typename AttrT> template<typename AttrT>
inline void inline void
CompAttribute<AttrT>::free () { CompAttribute<AttrT>::free () {
if (values) values = vector<AttrT> ();
delete[] values;
values = nullptr;
} }
template<typename AttrT> template<typename AttrT>
inline void inline void
CompAttribute<AttrT>::book (const DimImg &leafCount) { CompAttribute<AttrT>::book (const DimImg &leafCount) {
if (this->leafCount == leafCount)
return;
free ();
if (!leafCount)
return;
this->leafCount = leafCount; this->leafCount = leafCount;
values = new AttrT[leafCount]; values.resize (leafCount);
} }
// ======================================== // ========================================

View File

@ -18,7 +18,7 @@ namespace triskele {
class Raster { class Raster {
private: private:
Size size; Size size;
PixelT *pixels; vector<PixelT> pixels;
public: public:
inline void setSize (const Size &size); inline void setSize (const Size &size);
inline const Size &getSize () const; inline const Size &getSize () const;

View File

@ -8,10 +8,8 @@ Raster<PixelT>::setSize (const Size &size) {
DEF_LOG ("Raster::setSize", "size: " << size); DEF_LOG ("Raster::setSize", "size: " << size);
if (this->size == size) if (this->size == size)
return; return;
if (pixels) pixels.resize (DimImg (size.width)*DimImg (size.height));
delete [] pixels;
this->size = size; this->size = size;
pixels = new PixelT [DimImg (size.width)*DimImg (size.height)];
} }
template<typename PixelT> template<typename PixelT>
@ -23,13 +21,13 @@ Raster<PixelT>::getSize () const {
template<typename PixelT> template<typename PixelT>
inline const PixelT * inline const PixelT *
Raster<PixelT>::getPixels () const { Raster<PixelT>::getPixels () const {
return pixels; return &pixels[0];
} }
template<typename PixelT> template<typename PixelT>
inline PixelT * inline PixelT *
Raster<PixelT>::getPixels () { Raster<PixelT>::getPixels () {
return pixels; return &pixels[0];
} }
template<typename PixelT> template<typename PixelT>
@ -55,16 +53,13 @@ template<typename PixelT>
inline inline
Raster<PixelT>::Raster (const Size &size) Raster<PixelT>::Raster (const Size &size)
: size (NullSize), : size (NullSize),
pixels (nullptr) { pixels () {
setSize (size); setSize (size);
} }
template<typename PixelT> template<typename PixelT>
inline inline
Raster<PixelT>::~Raster () { Raster<PixelT>::~Raster () {
if (pixels)
delete [] pixels;
pixels = nullptr;
} }
// ======================================== // ========================================

View File

@ -24,7 +24,7 @@ namespace otb {
class Tree { class Tree {
friend class TreeBuilder; friend class TreeBuilder;
private: private:
inline DimNodeId *getChildCount (); inline DimNodeId *getChildSum ();
protected: protected:
/*! nb core for build and compute attributes */ /*! nb core for build and compute attributes */
@ -39,11 +39,12 @@ namespace otb {
DimNodeId nodeCount; /* nodeCount = leafCount+compCount */ DimNodeId nodeCount; /* nodeCount = leafCount+compCount */
/*! Pointers on the parents of each leafs / nodes */ /*! Pointers on the parents of each leafs / nodes */
DimImg *leafParents, *compParents; vector<DimImg> leafParents;
DimImg *compParents;
/*! Pointers on the children and count how many children a parents have */ /*! Pointers on the children and count how many children a parents have */
DimImg *childCount; vector<DimImg> childSum;
DimNodeId *children; vector<DimNodeId> children;
/*! Pointers of same weight in parents (+1 : last is root)*/ /*! Pointers of same weight in parents (+1 : last is root)*/
vector<DimImg> weightBounds; vector<DimImg> weightBounds;

View File

@ -8,8 +8,8 @@ Tree::getCoreCount () const {
} }
inline DimNodeId * inline DimNodeId *
Tree::getChildCount () { Tree::getChildSum () {
return childCount; return &childSum[0];
} }
inline void inline void
@ -67,7 +67,7 @@ Tree::getCompParent (const DimImg &compId) const {
inline const DimImg & inline const DimImg &
Tree::getChildrenCount (const DimImg &compId) const { Tree::getChildrenCount (const DimImg &compId) const {
return childCount[compId]; return childSum[compId];
} }
inline const DimNodeId & inline const DimNodeId &
Tree::getChildren (const DimImg &childId) const { Tree::getChildren (const DimImg &childId) const {
@ -75,7 +75,7 @@ Tree::getChildren (const DimImg &childId) const {
} }
inline const DimNodeId * inline const DimNodeId *
Tree::getChildren () const { Tree::getChildren () const {
return children; return &children[0];
} }
inline const vector<DimImg> & inline const vector<DimImg> &
@ -113,14 +113,14 @@ Tree::forEachNode (const FuncToApply &f /* f (NodeDimImg nodeId) */) const {
template<typename FuncToApply> template<typename FuncToApply>
inline void inline void
Tree::forEachChild (const DimNodeId &parentId, const FuncToApply &f /* f (DimNodeId childId) */) const { Tree::forEachChild (const DimNodeId &parentId, const FuncToApply &f /* f (DimNodeId childId) */) const {
DimNodeId minChild = childCount[parentId], maxChild = childCount[parentId+1]; DimNodeId minChild = childSum[parentId], maxChild = childSum[parentId+1];
for (DimNodeId childId = minChild; childId < maxChild; ++childId) for (DimNodeId childId = minChild; childId < maxChild; ++childId)
f (children[childId]); f (children[childId]);
} }
template<typename FuncToApply> template<typename FuncToApply>
inline void inline void
Tree::forEachChildTI (const DimNodeId &parentId, const FuncToApply &f /* f (bool isLeaf, DimImg childId) */) const { Tree::forEachChildTI (const DimNodeId &parentId, const FuncToApply &f /* f (bool isLeaf, DimImg childId) */) const {
DimNodeId minChild = childCount[parentId], maxChild = childCount[parentId+1]; DimNodeId minChild = childSum[parentId], maxChild = childSum[parentId+1];
for (DimNodeId childId = minChild; childId < maxChild; ++childId) { for (DimNodeId childId = minChild; childId < maxChild; ++childId) {
const DimNodeId &child (getChildren (childId)); const DimNodeId &child (getChildren (childId));
const bool isLeaf = child < leafCount; const bool isLeaf = child < leafCount;

View File

@ -27,7 +27,7 @@ namespace otb {
DimNodeId *leafParents, *compParents; DimNodeId *leafParents, *compParents;
/*! Pointers on the children and count how many children a parents have */ /*! Pointers on the children and count how many children a parents have */
DimNodeId *children, *childCount; DimNodeId *children, *childSum;
// XXX compWeights ??? // XXX compWeights ???
}; };

View File

@ -29,10 +29,10 @@ inline void
TreeBuilder::getTranscient (Tree &tree) { TreeBuilder::getTranscient (Tree &tree) {
leafCount = tree.leafCount; leafCount = tree.leafCount;
nodeCount = tree.nodeCount; nodeCount = tree.nodeCount;
leafParents = tree.leafParents; leafParents = &tree.leafParents[0];
compParents = tree.compParents; compParents = tree.compParents;
children = tree.children; children = &tree.children[0];
childCount = tree.childCount; childSum = &tree.childSum[0];
} }
inline DimNodeId inline DimNodeId

View File

@ -1,26 +0,0 @@
#include "Attribute.hpp"
using namespace otb::triskele;
template<typename T>
void
Attribute::free () {
delete[] (T*) attributes;
attributes = nullptr;
}
template<typename T>
T
Attribute::getAttribute (const DimNodeId &nodeId) {
return ((T*)attributes)[nodeId];
}
template<typename T>
void
Attribute::generate () {
attributes = new T[tree->getLeafCount () + tree->getNodeCount ()];
generate ();
}
void
Attribute::setTree (Tree &treeC) { tree = &treeC; }

View File

@ -4,7 +4,6 @@ set(OTBTreeBuilder_SRC
Tree.cpp Tree.cpp
XMLTree/XMLTreeBuilder.cpp XMLTree/XMLTreeBuilder.cpp
QuadTree/QuadTreeBuilder.cpp QuadTree/QuadTreeBuilder.cpp
Attribute.cpp
Attributes/AreaAttribute.cpp Attributes/AreaAttribute.cpp
testMain.cpp testMain.cpp
ArrayTree/triskeleArrayTreeBase.cpp ArrayTree/triskeleArrayTreeBase.cpp

View File

@ -15,15 +15,15 @@ QuadTreeBuilder::buildTree (Tree &tree) {
setParents (parentCount, 0, 0, width, height, width, height); setParents (parentCount, 0, 0, width, height, width, height);
// Building children array // Building children array
std::partial_sum (childCount, childCount+parentUsed+2, childCount); std::partial_sum (childSum, childSum+parentUsed+2, childSum);
for (DimNodeId i = 0; i < tree.getLeafCount (); ++i) { for (DimNodeId i = 0; i < tree.getLeafCount (); ++i) {
DimNodeId idP = leafParents[i]; DimNodeId idP = leafParents[i];
children[childCount[idP+1]++] = i; children[childSum[idP+1]++] = i;
} }
for (DimNodeId i = tree.getLeafCount (); i < tree.getLeafCount ()+parentUsed-1; ++i) { for (DimNodeId i = tree.getLeafCount (); i < tree.getLeafCount ()+parentUsed-1; ++i) {
DimNodeId idP = compParents[i-tree.getLeafCount ()]; DimNodeId idP = compParents[i-tree.getLeafCount ()];
children[childCount[idP+1]++] = i; children[childSum[idP+1]++] = i;
} }
} }
@ -61,7 +61,7 @@ QuadTreeBuilder::setParents (DimImg &parentId,
for (DimSideImg j = y; j < height + y; j++) { for (DimSideImg j = y; j < height + y; j++) {
DimSideImg id = i + j * imgWidth; DimSideImg id = i + j * imgWidth;
leafParents[id] = localId; leafParents[id] = localId;
childCount[localId+2]++; childSum[localId+2]++;
} }
return localId; return localId;
} }
@ -75,7 +75,7 @@ QuadTreeBuilder::setParents (DimImg &parentId,
{x , y + dh1, dw1, dh2}, {x , y + dh1, dw1, dh2},
{x + dw1, y + dh1, dw2, dh2} {x + dw1, y + dh1, dw2, dh2}
}; };
childCount[localId+2] = 4; childSum[localId+2] = 4;
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
compParents[setParents (parentId, coords[i][0], coords[i][1], coords[i][2], coords[i][3], imgWidth, imgHeight, level+1)] = localId; compParents[setParents (parentId, coords[i][0], coords[i][1], coords[i][2], coords[i][3], imgWidth, imgHeight, level+1)] = localId;
return localId; return localId;

View File

@ -9,7 +9,6 @@
#include "TreeStats.hpp" #include "TreeStats.hpp"
#include "TreeBuilder.hpp" #include "TreeBuilder.hpp"
#include "IImage.hpp" #include "IImage.hpp"
#include "Attribute.hpp"
#include "AttributeProfiles.hpp" #include "AttributeProfiles.hpp"
#include "ArrayTree/triskeleArrayTreeBase.hpp" #include "ArrayTree/triskeleArrayTreeBase.hpp"
#include "ArrayTree/triskeleSort.hpp" #include "ArrayTree/triskeleSort.hpp"

View File

@ -17,10 +17,10 @@ Tree::Tree (unsigned int coreCount)
coreCount (coreCount), coreCount (coreCount),
leafCount (0), leafCount (0),
nodeCount (0), nodeCount (0),
leafParents (nullptr), leafParents (),
compParents (nullptr), compParents (nullptr),
children (nullptr), children (),
childCount (nullptr), childSum (),
state (State::Void) state (State::Void)
{ {
clear (); clear ();
@ -33,56 +33,40 @@ Tree::~Tree () {
void void
Tree::clear () { Tree::clear () {
nodeCount = leafCount; nodeCount = leafCount;
leafParents.assign (leafCount*2, DimImg_MAX);
weightBounds.resize (0);
if (!leafCount) if (!leafCount)
return; return;
childCount[0] = childCount[1] = 0;
// XXX dealThreadFill_n avec coreCount
fill_n (leafParents, leafCount*2, DimImg_MAX);
#ifdef USE_SMART_LOG #ifdef USE_SMART_LOG
fill_n (children, (leafCount-1)*2, 0); children.assign ((leafCount-1)*2, 0);
fill_n (childCount, leafCount+1, 0); childSum.assign (leafCount+1, 0);
#endif #endif
weightBounds.resize (0); childSum.resize (leafCount+1);
childSum[0] = childSum[1] = 0;
} }
void void
Tree::resize (const DimSideImg &width, const DimSideImg &height) { Tree::resize (const DimSideImg &width, const DimSideImg &height) {
size = Size (width, height); size = Size (width, height);
book ((DimImg)width * (DimImg)height); book ((DimImg)width * (DimImg)height);
clear ();
} }
void void
Tree::free () { Tree::free () {
if (leafParents) leafParents = vector<DimImg> ();
delete[] leafParents; compParents = nullptr;
leafParents = compParents = nullptr; children = vector<DimNodeId> ();
if (children) childSum = vector<DimImg> ();
delete[] children; weightBounds = vector<DimImg> ();
if (childCount)
delete[] childCount;
children = childCount = nullptr;
weightBounds.resize (0);
} }
void void
Tree::book (const DimImg &leafCount) { Tree::book (const DimImg &leafCount) {
if (this->leafCount == leafCount) {
clear ();
return;
}
free ();
if (!leafCount)
return;
this->leafCount = leafCount; this->leafCount = leafCount;
leafParents = new DimNodeId[leafCount*2];
compParents = leafParents + leafCount;
children = new DimNodeId[(leafCount-1)*2];
childCount = new DimNodeId[leafCount+2];
clear (); clear ();
compParents = &leafParents[leafCount];
children.resize ((leafCount-1)*2);
childSum.resize (leafCount+1);
} }
@ -112,7 +96,7 @@ Tree::checkSpare () const {
maxParent = leafParents[leafId]; maxParent = leafParents[leafId];
}); });
} }
DimImg *childCountRec = childCount+2; DimImg *childCount = (DimImg*)&childSum[2];
for (unsigned int i = 0; i < tileCount; ++i) { for (unsigned int i = 0; i < tileCount; ++i) {
DimImg base = vertexMaxBounds [i], maxParent = maxParents [i]; DimImg base = vertexMaxBounds [i], maxParent = maxParents [i];
for (DimImg compId = base; compId < maxParent; ++compId) { for (DimImg compId = base; compId < maxParent; ++compId) {
@ -120,7 +104,7 @@ Tree::checkSpare () const {
BOOST_ASSERT (compParents[compId] != compId); BOOST_ASSERT (compParents[compId] != compId);
BOOST_ASSERT (compParents[compId] < maxParent); BOOST_ASSERT (compParents[compId] < maxParent);
if (compParents[compId] < compId) if (compParents[compId] < compId)
BOOST_ASSERT (childCountRec[compParents[compId]] > childCountRec[compId]); BOOST_ASSERT (childCount[compParents[compId]] > childCount[compId]);
} }
BOOST_ASSERT (compParents[maxParent] == DimImg_MAX); BOOST_ASSERT (compParents[maxParent] == DimImg_MAX);
} }
@ -140,7 +124,7 @@ Tree::checkSpare () const {
// check weight // check weight
// XXX monotone // XXX monotone
// check childCount // check childSum
} }
@ -176,25 +160,25 @@ Tree::check () const {
// check weightBounds // check weightBounds
// check childCount // check childSum
{ {
vector<DimImg> childCount2 (compCount, 0); vector<DimImg> childSum2 (compCount, 0);
forEachLeaf ([this, &childCount2] (const DimImg &leafId) { forEachLeaf ([this, &childSum2] (const DimImg &leafId) {
if (leafParents[leafId] == DimImg_MAX) if (leafParents[leafId] == DimImg_MAX)
// boder // boder
return; return;
++childCount2 [leafParents [leafId]]; ++childSum2 [leafParents [leafId]];
}); });
forEachComp ([this, &childCount2, &compCount] (const DimImg &compId) { forEachComp ([this, &childSum2, &compCount] (const DimImg &compId) {
if (compId == compCount-1) if (compId == compCount-1)
return; return;
++childCount2 [compParents [compId]]; ++childSum2 [compParents [compId]];
}); });
for (DimImg compId = 0; compId < compCount; ++compId) { for (DimImg compId = 0; compId < compCount; ++compId) {
// check count // check count
BOOST_ASSERT (childCount2 [compId] = childCount [compId+1] - childCount[compId]); BOOST_ASSERT (childSum2 [compId] = childSum [compId+1] - childSum[compId]);
// at least 2 children // at least 2 children
BOOST_ASSERT (childCount2 [compId] > 1); BOOST_ASSERT (childSum2 [compId] > 1);
} }
} }
@ -202,7 +186,7 @@ Tree::check () const {
{ {
vector<DimNodeId> childrenMap (nodeCount, DimImg_MAX); vector<DimNodeId> childrenMap (nodeCount, DimImg_MAX);
forEachComp ([this, &childrenMap] (const DimImg &compId) { forEachComp ([this, &childrenMap] (const DimImg &compId) {
DimNodeId minChild = childCount[compId], maxChild = childCount[compId+1]; DimNodeId minChild = childSum[compId], maxChild = childSum[compId+1];
for (DimNodeId childId = minChild; childId < maxChild; ++childId) { for (DimNodeId childId = minChild; childId < maxChild; ++childId) {
DimNodeId child = children[childId]; DimNodeId child = children[childId];
BOOST_ASSERT (leafParents [child] == compId); BOOST_ASSERT (leafParents [child] == compId);
@ -231,10 +215,10 @@ Tree::CPrintTree::print (ostream &out) const {
out << "Tree::printTree: leafCount:" << tree.leafCount out << "Tree::printTree: leafCount:" << tree.leafCount
<< " nodeCount:" << (onRecord ? "~" : "") << nodeCount << " compCount:" << nodeCount - tree.leafCount << endl << " nodeCount:" << (onRecord ? "~" : "") << nodeCount << " compCount:" << nodeCount - tree.leafCount << endl
<< "parent count" << (onRecord ? "" : " children") << endl << "parent count" << (onRecord ? "" : " children") << endl
<< printMap (tree.leafParents, doubleSize, nodeCount) << endl << endl << printMap (&tree.leafParents[0], doubleSize, nodeCount) << endl << endl
<< printMap (tree.childCount + (onRecord ? 2 : 0), tree.size, nodeCount - tree.leafCount + 1) << endl << endl; << printMap (&tree.childSum[onRecord ? 2 : 0], tree.size, nodeCount - tree.leafCount + 1) << endl << endl;
if (!onRecord) if (!onRecord)
out << printMap (tree.children, doubleSize, nodeCount-1) << endl << endl; out << printMap (&tree.children[0], doubleSize, nodeCount-1) << endl << endl;
if (tree.weightBounds.size ()) { if (tree.weightBounds.size ()) {
out << "weightBounds: " << endl out << "weightBounds: " << endl
<< printMap (&tree.weightBounds[0], tree.size, tree.weightBounds.size ()) << endl << endl; << printMap (&tree.weightBounds[0], tree.size, tree.weightBounds.size ()) << endl << endl;

View File

@ -1,4 +1,4 @@
#include "XMLTree/XMLTreeBuilder.hpp" <#include "XMLTree/XMLTreeBuilder.hpp"
using namespace otb::triskele; using namespace otb::triskele;
@ -26,14 +26,14 @@ XMLTreeBuilder::buildTree (Tree &tree) {
compParents[--rootParent] = nodeCount; compParents[--rootParent] = nodeCount;
readNodeChildren (treeNode->FirstChild ()->ToElement (), rootParent); readNodeChildren (treeNode->FirstChild ()->ToElement (), rootParent);
std::partial_sum (childCount, childCount+nodeCount+2, childCount); std::partial_sum (childSum, childSum+nodeCount+2, childSum);
for (DimNodeId i = 0; i < tree.getLeafCount (); ++i) { for (DimNodeId i = 0; i < tree.getLeafCount (); ++i) {
DimNodeId idP = leafParents[i]; DimNodeId idP = leafParents[i];
children[childCount[idP+1]++] = i; children[childSum[idP+1]++] = i;
} }
for (DimNodeId i = tree.getLeafCount (); i < tree.getLeafCount ()+nodeCount-1; ++i) { for (DimNodeId i = tree.getLeafCount (); i < tree.getLeafCount ()+nodeCount-1; ++i) {
DimNodeId idP = compParents[i-tree.getLeafCount ()]; DimNodeId idP = compParents[i-tree.getLeafCount ()];
children[childCount[idP+1]++] = i; children[childSum[idP+1]++] = i;
} }
} }
@ -55,12 +55,12 @@ XMLTreeBuilder::readNodeChildren (const TiXmlElement *node, DimNodeId &id) {
compParents[--id] = idP; compParents[--id] = idP;
std::cout << id << std::endl; std::cout << id << std::endl;
readNodeChildren (child->ToElement (), id); readNodeChildren (child->ToElement (), id);
childCount[idP+2]++; childSum[idP+2]++;
} else if (child->Value () == std::string ("Leaf")) { } else if (child->Value () == std::string ("Leaf")) {
int leafId; int leafId;
child->ToElement ()->QueryIntAttribute ("id", &leafId); child->ToElement ()->QueryIntAttribute ("id", &leafId);
leafParents[leafId] = idP; leafParents[leafId] = idP;
childCount[idP+2]++; childSum[idP+2]++;
} }
} }
} }

View File

@ -10,7 +10,6 @@
#include "QuadTree/QuadTreeBuilder.hpp" #include "QuadTree/QuadTreeBuilder.hpp"
//#include "XMLTree/XMLTreeBuilder.hpp" //#include "XMLTree/XMLTreeBuilder.hpp"
#include "IImage.hpp" #include "IImage.hpp"
#include "Attribute.hpp"
#include "ArrayTree/triskeleArrayTreeBase.hpp" #include "ArrayTree/triskeleArrayTreeBase.hpp"
#include "ArrayTree/triskeleSort.hpp" #include "ArrayTree/triskeleSort.hpp"