milena r1490: Review the mln/geom directory

URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena ChangeLog: 2007-11-16 Matthieu Garrigues <garrigues@lrde.epita.fr> Review the mln/geom directory. * mln/geom/seeds2tiling.hh: Clean dead code, update doc. Fixme for guillaume : Review the documentation. * mln/geom/seeds2tiling_with_chamfer.hh: likewise. Add unit tests. * tests/geom/bbox.cc: New. * tests/geom/max_col.cc: New. * tests/geom/max_ind.cc: New. * tests/geom/max_row.cc: New. * tests/geom/max_sli.cc: New. * tests/geom/min_col.cc: New. * tests/geom/min_ind.cc: New. * tests/geom/min_row.cc: New. * tests/geom/min_sli.cc: New. * tests/geom/ncols.cc: New. * tests/geom/ninds.cc: New. * tests/geom/nrows.cc: New. * tests/geom/nslis.cc: New. * tests/geom/pmin_pmax.cc: New. * tests/geom/shift.cc: New. * tests/geom/sym.cc: New. * tests/geom: New. --- mln/geom/seeds2tiling.hh | 23 +------------- mln/geom/seeds2tiling_with_chamfer.hh | 2 - tests/geom/bbox.cc | 45 ++++++++++++++++++++++++++++ tests/geom/max_col.cc | 39 ++++++++++++++++++++++++ tests/geom/max_ind.cc | 39 ++++++++++++++++++++++++ tests/geom/max_row.cc | 39 ++++++++++++++++++++++++ tests/geom/max_sli.cc | 39 ++++++++++++++++++++++++ tests/geom/min_col.cc | 39 ++++++++++++++++++++++++ tests/geom/min_ind.cc | 39 ++++++++++++++++++++++++ tests/geom/min_row.cc | 39 ++++++++++++++++++++++++ tests/geom/min_sli.cc | 39 ++++++++++++++++++++++++ tests/geom/ncols.cc | 39 ++++++++++++++++++++++++ tests/geom/ninds.cc | 39 ++++++++++++++++++++++++ tests/geom/nrows.cc | 39 ++++++++++++++++++++++++ tests/geom/nslis.cc | 39 ++++++++++++++++++++++++ tests/geom/pmin_pmax.cc | 50 +++++++++++++++++++++++++++++++ tests/geom/shift.cc | 54 ++++++++++++++++++++++++++++++++++ tests/geom/sym.cc | 54 ++++++++++++++++++++++++++++++++++ 18 files changed, 674 insertions(+), 22 deletions(-) Index: trunk/milena/tests/geom/max_sli.cc =================================================================== --- trunk/milena/tests/geom/max_sli.cc (revision 0) +++ trunk/milena/tests/geom/max_sli.cc (revision 1490) @@ -0,0 +1,39 @@ +// Copyright (C) 2007 EPITA Research and Development Laboratory +// +// This file is part of the Olena Library. This library is free +// software; you can redistribute it and/or modify it under the terms +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +#include <mln/core/image3d.hh> + +#include <mln/geom/max_sli.hh> + +int main() +{ + using namespace mln; + + image3d<int> ima(3,4,5); + + mln_assertion(geom::max_sli(ima) == 2); +} Index: trunk/milena/tests/geom/nrows.cc =================================================================== --- trunk/milena/tests/geom/nrows.cc (revision 0) +++ trunk/milena/tests/geom/nrows.cc (revision 1490) @@ -0,0 +1,39 @@ +// Copyright (C) 2007 EPITA Research and Development Laboratory +// +// This file is part of the Olena Library. This library is free +// software; you can redistribute it and/or modify it under the terms +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +#include <mln/core/image2d.hh> + +#include <mln/geom/nrows.hh> + +int main() +{ + using namespace mln; + + image2d<int> ima(make::box2d(-1,-4,2,6)); + + mln_assertion(geom::nrows(ima) == 4); +} Index: trunk/milena/tests/geom/sym.cc =================================================================== --- trunk/milena/tests/geom/sym.cc (revision 0) +++ trunk/milena/tests/geom/sym.cc (revision 1490) @@ -0,0 +1,54 @@ +// Copyright (C) 2007 EPITA Research and Development Laboratory +// +// This file is part of the Olena Library. This library is free +// software; you can redistribute it and/or modify it under the terms +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +#include <mln/core/window2d.hh> +#include <mln/core/dpoint2d.hh> + +#include <mln/geom/sym.hh> + +int main() +{ + using namespace mln; + + dpoint2d dp(2, 2); + + window2d win, win2; + + win.insert(make::dpoint2d(0,0)); + win.insert(make::dpoint2d(1,2)); + win.insert(make::dpoint2d(3,4)); + win.insert(make::dpoint2d(5,6)); + win.insert(make::dpoint2d(7,8)); + + win2.insert(make::dpoint2d(0,0)); + win2.insert(make::dpoint2d(-1,-2)); + win2.insert(make::dpoint2d(-3,-4)); + win2.insert(make::dpoint2d(-5,-6)); + win2.insert(make::dpoint2d(-7,-8)); + + mln_assertion(geom::sym(win) == win2); +} Index: trunk/milena/tests/geom/min_row.cc =================================================================== --- trunk/milena/tests/geom/min_row.cc (revision 0) +++ trunk/milena/tests/geom/min_row.cc (revision 1490) @@ -0,0 +1,39 @@ +// Copyright (C) 2007 EPITA Research and Development Laboratory +// +// This file is part of the Olena Library. This library is free +// software; you can redistribute it and/or modify it under the terms +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +#include <mln/core/image2d.hh> + +#include <mln/geom/min_row.hh> + +int main() +{ + using namespace mln; + + image2d<int> ima(make::box2d(-1,-4,2,6)); + + mln_assertion(geom::min_row(ima) == -1); +} Index: trunk/milena/tests/geom/ninds.cc =================================================================== --- trunk/milena/tests/geom/ninds.cc (revision 0) +++ trunk/milena/tests/geom/ninds.cc (revision 1490) @@ -0,0 +1,39 @@ +// Copyright (C) 2007 EPITA Research and Development Laboratory +// +// This file is part of the Olena Library. This library is free +// software; you can redistribute it and/or modify it under the terms +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +#include <mln/core/image1d.hh> + +#include <mln/geom/ninds.hh> + +int main() +{ + using namespace mln; + + image1d<int> ima(make::box1d(-1,8)); + + mln_assertion(geom::ninds(ima) == 10); +} Index: trunk/milena/tests/geom/max_row.cc =================================================================== --- trunk/milena/tests/geom/max_row.cc (revision 0) +++ trunk/milena/tests/geom/max_row.cc (revision 1490) @@ -0,0 +1,39 @@ +// Copyright (C) 2007 EPITA Research and Development Laboratory +// +// This file is part of the Olena Library. This library is free +// software; you can redistribute it and/or modify it under the terms +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +#include <mln/core/image2d.hh> + +#include <mln/geom/max_row.hh> + +int main() +{ + using namespace mln; + + image2d<int> ima(make::box2d(-1,-4,2,6)); + + mln_assertion(geom::max_row(ima) == 2); +} Index: trunk/milena/tests/geom/shift.cc =================================================================== --- trunk/milena/tests/geom/shift.cc (revision 0) +++ trunk/milena/tests/geom/shift.cc (revision 1490) @@ -0,0 +1,54 @@ +// Copyright (C) 2007 EPITA Research and Development Laboratory +// +// This file is part of the Olena Library. This library is free +// software; you can redistribute it and/or modify it under the terms +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +#include <mln/core/window2d.hh> +#include <mln/core/dpoint2d.hh> + +#include <mln/geom/shift.hh> + +int main() +{ + using namespace mln; + + dpoint2d dp(2, 2); + + window2d win, win2; + + win.insert(make::dpoint2d(0,0)); + win.insert(make::dpoint2d(1,2)); + win.insert(make::dpoint2d(3,4)); + win.insert(make::dpoint2d(5,6)); + win.insert(make::dpoint2d(7,8)); + + win2.insert(make::dpoint2d(2,2)); + win2.insert(make::dpoint2d(3,4)); + win2.insert(make::dpoint2d(5,6)); + win2.insert(make::dpoint2d(7,8)); + win2.insert(make::dpoint2d(9,10)); + + mln_assertion(geom::shift(win, dp) == win2); +} Index: trunk/milena/tests/geom/min_ind.cc =================================================================== --- trunk/milena/tests/geom/min_ind.cc (revision 0) +++ trunk/milena/tests/geom/min_ind.cc (revision 1490) @@ -0,0 +1,39 @@ +// Copyright (C) 2007 EPITA Research and Development Laboratory +// +// This file is part of the Olena Library. This library is free +// software; you can redistribute it and/or modify it under the terms +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +#include <mln/core/image1d.hh> + +#include <mln/geom/min_ind.hh> + +int main() +{ + using namespace mln; + + image1d<int> ima(make::box1d(-1,8)); + + mln_assertion(geom::min_ind(ima) == -1); +} Index: trunk/milena/tests/geom/ncols.cc =================================================================== --- trunk/milena/tests/geom/ncols.cc (revision 0) +++ trunk/milena/tests/geom/ncols.cc (revision 1490) @@ -0,0 +1,39 @@ +// Copyright (C) 2007 EPITA Research and Development Laboratory +// +// This file is part of the Olena Library. This library is free +// software; you can redistribute it and/or modify it under the terms +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +#include <mln/core/image2d.hh> + +#include <mln/geom/ncols.hh> + +int main() +{ + using namespace mln; + + image2d<int> ima(make::box2d(-1,-4,2,6)); + + mln_assertion(geom::ncols(ima) == 11); +} Index: trunk/milena/tests/geom/max_ind.cc =================================================================== --- trunk/milena/tests/geom/max_ind.cc (revision 0) +++ trunk/milena/tests/geom/max_ind.cc (revision 1490) @@ -0,0 +1,39 @@ +// Copyright (C) 2007 EPITA Research and Development Laboratory +// +// This file is part of the Olena Library. This library is free +// software; you can redistribute it and/or modify it under the terms +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +#include <mln/core/image1d.hh> + +#include <mln/geom/max_ind.hh> + +int main() +{ + using namespace mln; + + image1d<int> ima(make::box1d(-1,8)); + + mln_assertion(geom::max_ind(ima) == 8); +} Index: trunk/milena/tests/geom/min_col.cc =================================================================== --- trunk/milena/tests/geom/min_col.cc (revision 0) +++ trunk/milena/tests/geom/min_col.cc (revision 1490) @@ -0,0 +1,39 @@ +// Copyright (C) 2007 EPITA Research and Development Laboratory +// +// This file is part of the Olena Library. This library is free +// software; you can redistribute it and/or modify it under the terms +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +#include <mln/core/image2d.hh> + +#include <mln/geom/min_col.hh> + +int main() +{ + using namespace mln; + + image2d<int> ima(make::box2d(-1,-4,2,6)); + + mln_assertion(geom::min_col(ima) == -4); +} Index: trunk/milena/tests/geom/max_col.cc =================================================================== --- trunk/milena/tests/geom/max_col.cc (revision 0) +++ trunk/milena/tests/geom/max_col.cc (revision 1490) @@ -0,0 +1,39 @@ +// Copyright (C) 2007 EPITA Research and Development Laboratory +// +// This file is part of the Olena Library. This library is free +// software; you can redistribute it and/or modify it under the terms +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +#include <mln/core/image2d.hh> + +#include <mln/geom/max_col.hh> + +int main() +{ + using namespace mln; + + image2d<int> ima(make::box2d(-1,-4,2,6)); + + mln_assertion(geom::max_col(ima) == 6); +} Index: trunk/milena/tests/geom/pmin_pmax.cc =================================================================== --- trunk/milena/tests/geom/pmin_pmax.cc (revision 0) +++ trunk/milena/tests/geom/pmin_pmax.cc (revision 1490) @@ -0,0 +1,50 @@ +// Copyright (C) 2007 EPITA Research and Development Laboratory +// +// This file is part of the Olena Library. This library is free +// software; you can redistribute it and/or modify it under the terms +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +#include <mln/core/point2d.hh> +#include <mln/core/p_set.hh> + +#include <mln/geom/pmin_pmax.hh> + +int main() +{ + using namespace mln; + + p_set<point2d> p; + point2d min, max; + + p.insert(make::point2d(0,0)); + p.insert(make::point2d(-1,2)); + p.insert(make::point2d(-3,4)); + p.insert(make::point2d(7,6)); + p.insert(make::point2d(5,8)); + + geom::pmin_pmax(p, min, max); + + mln_assertion(min == (make::point2d(-3 ,0))); + mln_assertion(max == (make::point2d( 7 ,8))); +} Index: trunk/milena/tests/geom/nslis.cc =================================================================== --- trunk/milena/tests/geom/nslis.cc (revision 0) +++ trunk/milena/tests/geom/nslis.cc (revision 1490) @@ -0,0 +1,39 @@ +// Copyright (C) 2007 EPITA Research and Development Laboratory +// +// This file is part of the Olena Library. This library is free +// software; you can redistribute it and/or modify it under the terms +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +#include <mln/core/image3d.hh> + +#include <mln/geom/nslis.hh> + +int main() +{ + using namespace mln; + + image3d<int> ima(3,4,5); + + mln_assertion(geom::nslis(ima) == 3); +} Index: trunk/milena/tests/geom/bbox.cc =================================================================== --- trunk/milena/tests/geom/bbox.cc (revision 0) +++ trunk/milena/tests/geom/bbox.cc (revision 1490) @@ -0,0 +1,45 @@ +// Copyright (C) 2007 EPITA Research and Development Laboratory +// +// This file is part of the Olena Library. This library is free +// software; you can redistribute it and/or modify it under the terms +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +#include <mln/core/p_set.hh> +#include <mln/core/point2d.hh> +#include <mln/core/box2d.hh> + +#include <mln/geom/bbox.hh> + +int main() +{ + using namespace mln; + p_set<point2d> s; + + s.insert(make::point2d(0,0)); + s.insert(make::point2d(0,5)); + s.insert(make::point2d(5,0)); + s.insert(make::point2d(5,5)); + + mln_assertion(geom::bbox(s) == make::box2d(0,0,5,5)); +} Index: trunk/milena/tests/geom/min_sli.cc =================================================================== --- trunk/milena/tests/geom/min_sli.cc (revision 0) +++ trunk/milena/tests/geom/min_sli.cc (revision 1490) @@ -0,0 +1,39 @@ +// Copyright (C) 2007 EPITA Research and Development Laboratory +// +// This file is part of the Olena Library. This library is free +// software; you can redistribute it and/or modify it under the terms +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +#include <mln/core/image3d.hh> + +#include <mln/geom/min_sli.hh> + +int main() +{ + using namespace mln; + + image3d<int> ima(3,4,5); + + mln_assertion(geom::min_sli(ima) == 0); +} Index: trunk/milena/mln/geom/seeds2tiling.hh =================================================================== --- trunk/milena/mln/geom/seeds2tiling.hh (revision 1489) +++ trunk/milena/mln/geom/seeds2tiling.hh (revision 1490) @@ -30,8 +30,7 @@ /*! \file mln/geom/seeds2tiling.hh * - * \brief Definition of a function which takes a labeled image and - * returns an image which has blew up its labeled values. + * \brief Convert a binary image with seeds into a labeled image. */ # include <map> @@ -76,25 +75,7 @@ } } -// // Body. -// { -// while (! q.is_empty()) -// { -// mln_psite(I) p = q.front(); -// q.pop(); -// mln_invariant(ima(p) == 0); - -// mln_niter(N) n(nbh, p); -// for_all(n) if (ima.has(n)) -// if (out(n) != 0) -// out(p) = out(n); -// else -// if (! q.has(n)) -// q.push(n); -// } -// } - - // Body: alternative version. + // Body. { while (! q.is_empty()) { Index: trunk/milena/mln/geom/seeds2tiling_with_chamfer.hh =================================================================== --- trunk/milena/mln/geom/seeds2tiling_with_chamfer.hh (revision 1489) +++ trunk/milena/mln/geom/seeds2tiling_with_chamfer.hh (revision 1490) @@ -30,7 +30,7 @@ /*! \file mln/geom/seeds2tiling_with_chamfer.hh * - * \brief FIXME. + * \brief seeds2tiling with chamfer method. */ # include <map>
participants (1)
-
Matthieu Garrigues