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
64 lines
1.8 KiB
C++
64 lines
1.8 KiB
C++
#ifndef _OTB_TRISKELE_ARRAY_TREE_BASE_TPP
|
|
#define _OTB_TRISKELE_ARRAY_TREE_BASE_TPP
|
|
|
|
inline std::ostream &
|
|
operator << (std::ostream &out, const Connectivity &c) {
|
|
BOOST_ASSERT (c >= 0 && c < 4);
|
|
return out << connectivityName[c];
|
|
}
|
|
|
|
inline std::ostream &
|
|
operator << (std::ostream &out, const TileItem &t) {
|
|
BOOST_ASSERT (t >= 0 && t < 3);
|
|
return out << tileItemName[t];
|
|
}
|
|
|
|
template <typename WeightT>
|
|
inline void
|
|
swapEdge (Edge<WeightT> &a, Edge<WeightT> &b) {
|
|
Edge<WeightT> c = a;
|
|
a = b;
|
|
b = c;
|
|
}
|
|
|
|
template <typename WeightT>
|
|
inline std::ostream &
|
|
operator << (std::ostream &out, const Edge<WeightT> &edge) {
|
|
return out << edge.points[0] << ":" << edge.points[1] << ":" << edge.weight;
|
|
}
|
|
|
|
template <typename WeightT>
|
|
inline std::ostream &
|
|
printEdge (std::ostream &out, const Edge<WeightT> &edge, const Size &size) {
|
|
return out << edge.points[0] << ":" << edge.points[1] << ":" << ((uint32_t) edge.weight) << ":"
|
|
<< point2idx (size, edge.points[0]) << ":" << point2idx (size, edge.points[1]);
|
|
}
|
|
|
|
template <typename Edge>
|
|
inline std::ostream &
|
|
printEdges (std::ostream &out, const std::vector<Edge> &edges) {
|
|
for (int i = 0; i < edges.size (); ++i)
|
|
out << " " << edges [i];
|
|
return out;
|
|
}
|
|
|
|
template <typename Edge>
|
|
inline std::ostream &
|
|
printEdges (std::ostream &out, const Edge edges[], const Size &size, const DimEdge edgesCount) {
|
|
for (int i = 0; i < edgesCount; ++i)
|
|
printEdge (out, edges[i], size) << std::endl;
|
|
return out;
|
|
}
|
|
|
|
template <typename Edge>
|
|
inline std::ostream &
|
|
printEdges (std::ostream &out, const std::vector<Edge> &edges, const Size &size) {
|
|
for (int i = 0; i < edges.size (); ++i)
|
|
out << " [" << point2idx (size, edges [i].points[0])
|
|
<< " " << point2idx (size, edges [i].points[1])
|
|
<< " " << edges [i].weight << "]";
|
|
return out;
|
|
}
|
|
|
|
#endif // _OTB_TRISKELE_ARRAY_TREE_BASE_TPP
|