URL:
https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2007-11-05 Matthieu Garrigues <garrigues(a)lrde.epita.fr>
Remove dead code, Update the tests to use fllt2.hh.
* mln/util/branch_iter.hh: Remove dead code.
* sandbox/garrigues/test_fllt.cc,
* sandbox/garrigues/test_fllt2.cc,
* sandbox/garrigues/test_fllt3.cc,
* sandbox/garrigues/test_fllt_tiny.cc: likewise, Update include to
test fllt2.hh.
---
mln/util/branch_iter.hh | 25 ++++++---------------
sandbox/garrigues/test_fllt.cc | 42 ++++++++++++------------------------
sandbox/garrigues/test_fllt2.cc | 2 -
sandbox/garrigues/test_fllt3.cc | 2 -
sandbox/garrigues/test_fllt_tiny.cc | 7 ------
5 files changed, 24 insertions(+), 54 deletions(-)
Index: trunk/milena/mln/util/branch_iter.hh
===================================================================
--- trunk/milena/mln/util/branch_iter.hh (revision 1430)
+++ trunk/milena/mln/util/branch_iter.hh (revision 1431)
@@ -42,6 +42,12 @@
namespace util
{
+
+ /*! \brief Basic 2D image class.
+ *
+ * The parameter \c T is the type of node's data. branch_iter is used to
pre-order walk a branch.
+
+ */
template <typename T>
class branch_iter
{
@@ -67,6 +73,7 @@
/// Give how deep is the iterator in the branch.
unsigned deepness() const;
private:
+ /// The branch to iter.
util::branch<T> branch_;
typedef typename std::vector< util::node<T>* >::iterator child_iter;
@@ -75,8 +82,6 @@
std::stack< iter_pair > s_;
util::node<T>* n_;
- unsigned deepness_;
- unsigned futur_deepness_;
};
@@ -110,8 +115,6 @@
branch_iter<T>::deepness() const
{
mln_assertion(is_valid());
- //return s_.size();
-
unsigned i = 0;
node<T>* p = n_;
while (p)
@@ -120,7 +123,6 @@
i++;
}
return i;
- // return deepness_;
}
template <typename T>
@@ -142,13 +144,9 @@
void
branch_iter<T>::start()
{
- deepness_ = 0;
s_.push(iter_pair(branch_.apex().children().begin(),
branch_.apex().children().end()));
n_ = &branch_.apex();
-
- //n_ = *(s_.top().first);
- //s_.top().first++;
}
template <typename T>
@@ -160,26 +158,18 @@
else
{
if (s_.top().first == s_.top().second)
- //if (*(s_.top().first) == 0)
{
- deepness_ = futur_deepness_;
- //deepness_--;
- futur_deepness_ = deepness_;
-// std::cout << "dec :" << deepness_ << std::endl;
s_.pop();
next();
return;
}
else
{
- deepness_ = futur_deepness_;
-// std::cout << "st :" << deepness_ << std::endl;
n_ = *(s_.top().first);
s_.top().first++;
if (!n_)
{
-// std::cout << "browsing warning : nul pointer" <<
std::endl;
next();
return;
}
@@ -187,7 +177,6 @@
mln_assertion(n_);
if (n_->children().size() > 0)
{
- futur_deepness_ = deepness_ + 1;
s_.push(iter_pair(n_->children().begin(),
n_->children().end()));
}
Index: trunk/milena/sandbox/garrigues/test_fllt.cc
===================================================================
--- trunk/milena/sandbox/garrigues/test_fllt.cc (revision 1430)
+++ trunk/milena/sandbox/garrigues/test_fllt.cc (revision 1431)
@@ -1,4 +1,4 @@
-# include "fllt.hh"
+# include "fllt2.hh"
# include <mln/core/image2d.hh>
# include <mln/core/clone.hh>
# include <mln/value/int_u8.hh>
@@ -17,32 +17,18 @@
using namespace mln;
-// int ws[81] = {3,2,3,3,5,5,5,5,5,
-// 2,1,3,4,4,4,4,5,5,
-// 2,3,4,2,3,3,2,4,4,
-// 1,4,2,1,1,2,1,2,2,
-// 1,2,4,2,1,2,1,1,1,
-// 1,3,3,3,4,3,2,5,1,
-// 1,3,4,3,4,3,2,5,1,
-// 1,3,3,3,4,3,2,5,1,
-// 1,3,3,4,2,3,2,1,1};
-
-// w_window2d_int w_win = make::w_window2d(ws);
-// image2d<int> ima = convert::to_image(w_win);
-// fllt::fllt(ima);
-
-
- for (int i = 0; i < 16; ++i)
- for (int j = 0; j < 16; ++j)
- {
- std::stringstream path;
- path << "/lrde/tegucigalpa/theo/pub/mln_docs/lena_tiles/lena_" <<
i << "_" << j << ".pgm";
- std::cout << path.str () << std::endl;
- image2d<value::int_u8> ima = io::pgm::load(path.str());
- image2d<int> ima_int(ima.domain());
- level::fill(ima_int, ima);
- debug::println(ima_int);
- fllt::fllt(ima_int);
- }
+ int ws[81] = {3,2,3,3,5,5,5,5,5,
+ 2,1,3,4,4,4,4,5,5,
+ 2,3,4,2,3,3,2,4,4,
+ 1,4,2,1,1,2,1,2,2,
+ 1,2,4,2,1,2,1,1,1,
+ 1,3,3,3,4,3,2,5,1,
+ 1,3,4,3,4,3,2,5,1,
+ 1,3,3,3,4,3,2,5,1,
+ 1,3,3,4,2,3,2,1,1};
+
+ w_window2d_int w_win = make::w_window2d(ws);
+ image2d<int> ima = convert::to_image(w_win);
+ fllt::fllt(ima);
}
Index: trunk/milena/sandbox/garrigues/test_fllt_tiny.cc
===================================================================
--- trunk/milena/sandbox/garrigues/test_fllt_tiny.cc (revision 1430)
+++ trunk/milena/sandbox/garrigues/test_fllt_tiny.cc (revision 1431)
@@ -1,14 +1,9 @@
-# include "fllt.hh"
+# include "fllt2.hh"
# include <mln/core/image2d.hh>
# include <mln/core/clone.hh>
# include <mln/value/int_u8.hh>
-# include <mln/debug/println.hh>
-# include <mln/convert/to_w_window.hh>
-# include <mln/core/w_window2d_int.hh>
-# include <mln/convert/to_image.hh>
# include <mln/level/fill.hh>
# include <mln/io/pgm/load.hh>
-# include <mln/io/pbm/load.hh>
int main()
{
Index: trunk/milena/sandbox/garrigues/test_fllt2.cc
===================================================================
--- trunk/milena/sandbox/garrigues/test_fllt2.cc (revision 1430)
+++ trunk/milena/sandbox/garrigues/test_fllt2.cc (revision 1431)
@@ -1,4 +1,4 @@
-# include "fllt.hh"
+# include "fllt2.hh"
# include <mln/core/image2d.hh>
# include <mln/core/clone.hh>
# include <mln/value/int_u8.hh>
Index: trunk/milena/sandbox/garrigues/test_fllt3.cc
===================================================================
--- trunk/milena/sandbox/garrigues/test_fllt3.cc (revision 1430)
+++ trunk/milena/sandbox/garrigues/test_fllt3.cc (revision 1431)
@@ -1,4 +1,4 @@
-# include "fllt.hh"
+# include "fllt2.hh"
# include <mln/core/image2d.hh>
# include <mln/core/clone.hh>
# include <mln/value/int_u8.hh>