LRE
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
List overview
Download
Olena-patches
March 2011
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
olena-patches@lrde.epita.fr
7 participants
277 discussions
Start a n
N
ew thread
last-svn-commit-763-g12c45b0 Deactivate erroneous assertion in regional_maxima.hh.
by Thierry Geraud
--- ChangeLog | 6 ++++++ milena/mln/labeling/regional_maxima.hh | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 686b84a..3eb76e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-03-14 Thierry GERAUD <thierry.geraud(a)lrde.epita.fr> + + * milena/mln/labeling/regional_maxima.hh + (do_no_union_): Deactivate assertion since it is + not verified for all cases. + 2011-01-18 Guillaume Lazzara <z(a)lrde.epita.fr> * configure.ac: Make Boost dependency optional. diff --git a/milena/mln/labeling/regional_maxima.hh b/milena/mln/labeling/regional_maxima.hh index a3c12eb..861066f 100644 --- a/milena/mln/labeling/regional_maxima.hh +++ b/milena/mln/labeling/regional_maxima.hh @@ -97,8 +97,8 @@ namespace mln bool labels_(unsigned p) const { return attr.element(p); } bool equiv_(unsigned n, unsigned p) const { return input.element(n) == input.element(p); } - void do_no_union_(unsigned n, unsigned p) { mln_invariant(input.element(n) > - input.element(p)); + void do_no_union_(unsigned n, unsigned p) { // mln_invariant(input.element(n) > + // input.element(p)); attr.element(p) = false; (void) n; } -- 1.5.6.5
13 years, 9 months
1
0
0
0
last-svn-commit-757-gc4bfdc8 Deactivate erroneous assertion in regional_maxima.hh.
by Thierry Geraud
--- ChangeLog | 6 ++++++ milena/mln/labeling/regional_maxima.hh | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 686b84a..3eb76e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-03-14 Thierry GERAUD <thierry.geraud(a)lrde.epita.fr> + + * milena/mln/labeling/regional_maxima.hh + (do_no_union_): Deactivate assertion since it is + not verified for all cases. + 2011-01-18 Guillaume Lazzara <z(a)lrde.epita.fr> * configure.ac: Make Boost dependency optional. diff --git a/milena/mln/labeling/regional_maxima.hh b/milena/mln/labeling/regional_maxima.hh index a3c12eb..861066f 100644 --- a/milena/mln/labeling/regional_maxima.hh +++ b/milena/mln/labeling/regional_maxima.hh @@ -97,8 +97,8 @@ namespace mln bool labels_(unsigned p) const { return attr.element(p); } bool equiv_(unsigned n, unsigned p) const { return input.element(n) == input.element(p); } - void do_no_union_(unsigned n, unsigned p) { mln_invariant(input.element(n) > - input.element(p)); + void do_no_union_(unsigned n, unsigned p) { // mln_invariant(input.element(n) > + // input.element(p)); attr.element(p) = false; (void) n; } -- 1.5.6.5
13 years, 9 months
1
0
0
0
last-svn-commit-802-g742d012 Spread anchor value to more methods in link functors.
by Guillaume Lazzara
* scribo/primitive/link/internal/find_link.hh, * scribo/primitive/link/internal/link_functor_base.hh, * scribo/primitive/link/internal/link_single_dmax_ratio_base.hh: Here. --- scribo/ChangeLog | 8 +++++ scribo/scribo/primitive/link/internal/find_link.hh | 5 ++- .../primitive/link/internal/link_functor_base.hh | 31 +++++++++++++------- .../link/internal/link_single_dmax_ratio_base.hh | 7 +++- 4 files changed, 36 insertions(+), 15 deletions(-) diff --git a/scribo/ChangeLog b/scribo/ChangeLog index 1e9b57e..10a8269 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,5 +1,13 @@ 2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Spread anchor value to more methods in link functors. + + * scribo/primitive/link/internal/find_link.hh, + * scribo/primitive/link/internal/link_functor_base.hh, + * scribo/primitive/link/internal/link_single_dmax_ratio_base.hh: Here. + +2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Introduce a logger class. * scribo/debug/logger.hh: New. diff --git a/scribo/scribo/primitive/link/internal/find_link.hh b/scribo/scribo/primitive/link/internal/find_link.hh index dd0b308..7220b0c 100644 --- a/scribo/scribo/primitive/link/internal/find_link.hh +++ b/scribo/scribo/primitive/link/internal/find_link.hh @@ -87,10 +87,11 @@ namespace scribo while (functor.components().labeled_image().domain().has(p) && ! functor.is_potential_link(current_object, start_point, p) - && functor.verify_link_criterion(current_object, start_point, p)) + && functor.verify_link_criterion(current_object, start_point, + p, anchor)) functor.compute_next_site(p); // <-- compute_next_site - if (functor.valid_link(current_object, start_point, p)) // <-- valid_link + if (functor.valid_link(current_object, start_point, p, anchor)) // <-- valid_link functor.validate_link(current_object, start_point, p, anchor); // <-- validate_link else functor.invalidate_link(current_object, start_point, p, anchor); // <-- invalidate_link diff --git a/scribo/scribo/primitive/link/internal/link_functor_base.hh b/scribo/scribo/primitive/link/internal/link_functor_base.hh index ad3d71b..d214c91 100644 --- a/scribo/scribo/primitive/link/internal/link_functor_base.hh +++ b/scribo/scribo/primitive/link/internal/link_functor_base.hh @@ -88,13 +88,15 @@ namespace scribo bool verify_link_criterion(unsigned current_object, - const P& start_point, const P& p) const; + const P& start_point, const P& p, + anchor::Type anchor) const; bool is_potential_link(unsigned current_object, const P& start_point, const P& p) const; bool valid_link(unsigned current_object, - const P& start_point, const P& p); + const P& start_point, const P& p, + anchor::Type anchor); @@ -147,10 +149,12 @@ namespace scribo const P& start_point, const P& p) const; bool verify_link_criterion_(unsigned current_object, - const P& start_point, const P& p) const; + const P& start_point, const P& p, + anchor::Type anchor) const; bool valid_link_(unsigned current_object, - const P& start_point, const P& p); + const P& start_point, const P& p, + anchor::Type anchor); void validate_link_(unsigned current_object, const P& start_point, const P& p, @@ -263,14 +267,15 @@ namespace scribo bool link_functor_base<L,E>::verify_link_criterion(unsigned current_object, const P& start_point, - const P& p) const + const P& p, + anchor::Type anchor) const { return // Do not link with separators... ! this->components_.separators()(p) // ... and perform custom checks. && exact(this)->verify_link_criterion_(current_object, - start_point, p); + start_point, p, anchor); } template <typename L, typename E> @@ -278,10 +283,11 @@ namespace scribo bool link_functor_base<L,E>::valid_link(unsigned current_object, const P& start_point, - const P& p) + const P& p, + anchor::Type anchor) { return this->labeled_image_.domain().has(p) - && exact(this)->valid_link_(current_object, start_point, p); + && exact(this)->valid_link_(current_object, start_point, p, anchor); } @@ -428,11 +434,13 @@ namespace scribo bool link_functor_base<L,E>::verify_link_criterion_(unsigned current_object, const P& start_point, - const P& p) const + const P& p, + anchor::Type anchor) const { (void) current_object; (void) start_point; (void) p; + (void) anchor; // No-Op return true; } @@ -443,10 +451,11 @@ namespace scribo bool link_functor_base<L,E>::valid_link_(unsigned current_object, const P& start_point, - const P& p) + const P& p, + anchor::Type anchor) { return is_potential_link(current_object, start_point, p) - && verify_link_criterion(current_object, start_point, p); + && verify_link_criterion(current_object, start_point, p, anchor); } diff --git a/scribo/scribo/primitive/link/internal/link_single_dmax_ratio_base.hh b/scribo/scribo/primitive/link/internal/link_single_dmax_ratio_base.hh index d3aba42..3abe663 100644 --- a/scribo/scribo/primitive/link/internal/link_single_dmax_ratio_base.hh +++ b/scribo/scribo/primitive/link/internal/link_single_dmax_ratio_base.hh @@ -86,7 +86,8 @@ namespace scribo bool verify_link_criterion_(unsigned current_object, - const P& start_point, const P& p) const; + const P& start_point, const P& p, + anchor::Type anchor) const; mln_site(L) start_point_(unsigned current_object, anchor::Type anchor); @@ -123,9 +124,11 @@ namespace scribo link_single_dmax_ratio_base<L, F, E>::verify_link_criterion_( unsigned current_object, const P& start_point, - const P& p) const + const P& p, + anchor::Type anchor) const { (void) current_object; + (void) anchor; float dist = math::abs(p[direction_] - start_point[direction_]); return dist <= dmax_; // Not too far -- 1.5.6.5
13 years, 9 months
1
0
0
0
last-svn-commit-801-g1d1a977 Spread anchor value to more methods in link functors.
by Guillaume Lazzara
* scribo/primitive/link/internal/find_link.hh, * scribo/primitive/link/internal/link_functor_base.hh, * scribo/primitive/link/internal/link_single_dmax_ratio_base.hh: Here. --- scribo/ChangeLog | 8 +++++ scribo/scribo/primitive/link/internal/find_link.hh | 5 ++- .../primitive/link/internal/link_functor_base.hh | 31 +++++++++++++------- .../link/internal/link_single_dmax_ratio_base.hh | 7 +++- 4 files changed, 36 insertions(+), 15 deletions(-) diff --git a/scribo/ChangeLog b/scribo/ChangeLog index bd7b036..fc78930 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,5 +1,13 @@ 2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Spread anchor value to more methods in link functors. + + * scribo/primitive/link/internal/find_link.hh, + * scribo/primitive/link/internal/link_functor_base.hh, + * scribo/primitive/link/internal/link_single_dmax_ratio_base.hh: Here. + +2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Introduce a logger class. * scribo/debug/logger.hh: New. diff --git a/scribo/scribo/primitive/link/internal/find_link.hh b/scribo/scribo/primitive/link/internal/find_link.hh index dd0b308..7220b0c 100644 --- a/scribo/scribo/primitive/link/internal/find_link.hh +++ b/scribo/scribo/primitive/link/internal/find_link.hh @@ -87,10 +87,11 @@ namespace scribo while (functor.components().labeled_image().domain().has(p) && ! functor.is_potential_link(current_object, start_point, p) - && functor.verify_link_criterion(current_object, start_point, p)) + && functor.verify_link_criterion(current_object, start_point, + p, anchor)) functor.compute_next_site(p); // <-- compute_next_site - if (functor.valid_link(current_object, start_point, p)) // <-- valid_link + if (functor.valid_link(current_object, start_point, p, anchor)) // <-- valid_link functor.validate_link(current_object, start_point, p, anchor); // <-- validate_link else functor.invalidate_link(current_object, start_point, p, anchor); // <-- invalidate_link diff --git a/scribo/scribo/primitive/link/internal/link_functor_base.hh b/scribo/scribo/primitive/link/internal/link_functor_base.hh index ad3d71b..d214c91 100644 --- a/scribo/scribo/primitive/link/internal/link_functor_base.hh +++ b/scribo/scribo/primitive/link/internal/link_functor_base.hh @@ -88,13 +88,15 @@ namespace scribo bool verify_link_criterion(unsigned current_object, - const P& start_point, const P& p) const; + const P& start_point, const P& p, + anchor::Type anchor) const; bool is_potential_link(unsigned current_object, const P& start_point, const P& p) const; bool valid_link(unsigned current_object, - const P& start_point, const P& p); + const P& start_point, const P& p, + anchor::Type anchor); @@ -147,10 +149,12 @@ namespace scribo const P& start_point, const P& p) const; bool verify_link_criterion_(unsigned current_object, - const P& start_point, const P& p) const; + const P& start_point, const P& p, + anchor::Type anchor) const; bool valid_link_(unsigned current_object, - const P& start_point, const P& p); + const P& start_point, const P& p, + anchor::Type anchor); void validate_link_(unsigned current_object, const P& start_point, const P& p, @@ -263,14 +267,15 @@ namespace scribo bool link_functor_base<L,E>::verify_link_criterion(unsigned current_object, const P& start_point, - const P& p) const + const P& p, + anchor::Type anchor) const { return // Do not link with separators... ! this->components_.separators()(p) // ... and perform custom checks. && exact(this)->verify_link_criterion_(current_object, - start_point, p); + start_point, p, anchor); } template <typename L, typename E> @@ -278,10 +283,11 @@ namespace scribo bool link_functor_base<L,E>::valid_link(unsigned current_object, const P& start_point, - const P& p) + const P& p, + anchor::Type anchor) { return this->labeled_image_.domain().has(p) - && exact(this)->valid_link_(current_object, start_point, p); + && exact(this)->valid_link_(current_object, start_point, p, anchor); } @@ -428,11 +434,13 @@ namespace scribo bool link_functor_base<L,E>::verify_link_criterion_(unsigned current_object, const P& start_point, - const P& p) const + const P& p, + anchor::Type anchor) const { (void) current_object; (void) start_point; (void) p; + (void) anchor; // No-Op return true; } @@ -443,10 +451,11 @@ namespace scribo bool link_functor_base<L,E>::valid_link_(unsigned current_object, const P& start_point, - const P& p) + const P& p, + anchor::Type anchor) { return is_potential_link(current_object, start_point, p) - && verify_link_criterion(current_object, start_point, p); + && verify_link_criterion(current_object, start_point, p, anchor); } diff --git a/scribo/scribo/primitive/link/internal/link_single_dmax_ratio_base.hh b/scribo/scribo/primitive/link/internal/link_single_dmax_ratio_base.hh index d3aba42..3abe663 100644 --- a/scribo/scribo/primitive/link/internal/link_single_dmax_ratio_base.hh +++ b/scribo/scribo/primitive/link/internal/link_single_dmax_ratio_base.hh @@ -86,7 +86,8 @@ namespace scribo bool verify_link_criterion_(unsigned current_object, - const P& start_point, const P& p) const; + const P& start_point, const P& p, + anchor::Type anchor) const; mln_site(L) start_point_(unsigned current_object, anchor::Type anchor); @@ -123,9 +124,11 @@ namespace scribo link_single_dmax_ratio_base<L, F, E>::verify_link_criterion_( unsigned current_object, const P& start_point, - const P& p) const + const P& p, + anchor::Type anchor) const { (void) current_object; + (void) anchor; float dist = math::abs(p[direction_] - start_point[direction_]); return dist <= dmax_; // Not too far -- 1.5.6.5
13 years, 9 months
1
0
0
0
last-svn-commit-801-g1a5cc61 Spread anchor value to more methods in link functors.
by Guillaume Lazzara
* scribo/primitive/link/internal/find_link.hh, * scribo/primitive/link/internal/link_functor_base.hh, * scribo/primitive/link/internal/link_single_dmax_ratio_base.hh: Here. --- scribo/ChangeLog | 8 +++++ scribo/scribo/primitive/link/internal/find_link.hh | 5 ++- .../primitive/link/internal/link_functor_base.hh | 31 +++++++++++++------- .../link/internal/link_single_dmax_ratio_base.hh | 7 +++- 4 files changed, 36 insertions(+), 15 deletions(-) diff --git a/scribo/ChangeLog b/scribo/ChangeLog index bd7b036..fc78930 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,5 +1,13 @@ 2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Spread anchor value to more methods in link functors. + + * scribo/primitive/link/internal/find_link.hh, + * scribo/primitive/link/internal/link_functor_base.hh, + * scribo/primitive/link/internal/link_single_dmax_ratio_base.hh: Here. + +2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Introduce a logger class. * scribo/debug/logger.hh: New. diff --git a/scribo/scribo/primitive/link/internal/find_link.hh b/scribo/scribo/primitive/link/internal/find_link.hh index dd0b308..7220b0c 100644 --- a/scribo/scribo/primitive/link/internal/find_link.hh +++ b/scribo/scribo/primitive/link/internal/find_link.hh @@ -87,10 +87,11 @@ namespace scribo while (functor.components().labeled_image().domain().has(p) && ! functor.is_potential_link(current_object, start_point, p) - && functor.verify_link_criterion(current_object, start_point, p)) + && functor.verify_link_criterion(current_object, start_point, + p, anchor)) functor.compute_next_site(p); // <-- compute_next_site - if (functor.valid_link(current_object, start_point, p)) // <-- valid_link + if (functor.valid_link(current_object, start_point, p, anchor)) // <-- valid_link functor.validate_link(current_object, start_point, p, anchor); // <-- validate_link else functor.invalidate_link(current_object, start_point, p, anchor); // <-- invalidate_link diff --git a/scribo/scribo/primitive/link/internal/link_functor_base.hh b/scribo/scribo/primitive/link/internal/link_functor_base.hh index ad3d71b..d214c91 100644 --- a/scribo/scribo/primitive/link/internal/link_functor_base.hh +++ b/scribo/scribo/primitive/link/internal/link_functor_base.hh @@ -88,13 +88,15 @@ namespace scribo bool verify_link_criterion(unsigned current_object, - const P& start_point, const P& p) const; + const P& start_point, const P& p, + anchor::Type anchor) const; bool is_potential_link(unsigned current_object, const P& start_point, const P& p) const; bool valid_link(unsigned current_object, - const P& start_point, const P& p); + const P& start_point, const P& p, + anchor::Type anchor); @@ -147,10 +149,12 @@ namespace scribo const P& start_point, const P& p) const; bool verify_link_criterion_(unsigned current_object, - const P& start_point, const P& p) const; + const P& start_point, const P& p, + anchor::Type anchor) const; bool valid_link_(unsigned current_object, - const P& start_point, const P& p); + const P& start_point, const P& p, + anchor::Type anchor); void validate_link_(unsigned current_object, const P& start_point, const P& p, @@ -263,14 +267,15 @@ namespace scribo bool link_functor_base<L,E>::verify_link_criterion(unsigned current_object, const P& start_point, - const P& p) const + const P& p, + anchor::Type anchor) const { return // Do not link with separators... ! this->components_.separators()(p) // ... and perform custom checks. && exact(this)->verify_link_criterion_(current_object, - start_point, p); + start_point, p, anchor); } template <typename L, typename E> @@ -278,10 +283,11 @@ namespace scribo bool link_functor_base<L,E>::valid_link(unsigned current_object, const P& start_point, - const P& p) + const P& p, + anchor::Type anchor) { return this->labeled_image_.domain().has(p) - && exact(this)->valid_link_(current_object, start_point, p); + && exact(this)->valid_link_(current_object, start_point, p, anchor); } @@ -428,11 +434,13 @@ namespace scribo bool link_functor_base<L,E>::verify_link_criterion_(unsigned current_object, const P& start_point, - const P& p) const + const P& p, + anchor::Type anchor) const { (void) current_object; (void) start_point; (void) p; + (void) anchor; // No-Op return true; } @@ -443,10 +451,11 @@ namespace scribo bool link_functor_base<L,E>::valid_link_(unsigned current_object, const P& start_point, - const P& p) + const P& p, + anchor::Type anchor) { return is_potential_link(current_object, start_point, p) - && verify_link_criterion(current_object, start_point, p); + && verify_link_criterion(current_object, start_point, p, anchor); } diff --git a/scribo/scribo/primitive/link/internal/link_single_dmax_ratio_base.hh b/scribo/scribo/primitive/link/internal/link_single_dmax_ratio_base.hh index d3aba42..3abe663 100644 --- a/scribo/scribo/primitive/link/internal/link_single_dmax_ratio_base.hh +++ b/scribo/scribo/primitive/link/internal/link_single_dmax_ratio_base.hh @@ -86,7 +86,8 @@ namespace scribo bool verify_link_criterion_(unsigned current_object, - const P& start_point, const P& p) const; + const P& start_point, const P& p, + anchor::Type anchor) const; mln_site(L) start_point_(unsigned current_object, anchor::Type anchor); @@ -123,9 +124,11 @@ namespace scribo link_single_dmax_ratio_base<L, F, E>::verify_link_criterion_( unsigned current_object, const P& start_point, - const P& p) const + const P& p, + anchor::Type anchor) const { (void) current_object; + (void) anchor; float dist = math::abs(p[direction_] - start_point[direction_]); return dist <= dmax_; // Not too far -- 1.5.6.5
13 years, 9 months
1
0
0
0
last-svn-commit-800-g303e38d Introduce a logger class.
by Guillaume Lazzara
* scribo/debug/logger.hh: New. --- scribo/ChangeLog | 6 + scribo/scribo/debug/logger.hh | 293 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 299 insertions(+), 0 deletions(-) create mode 100644 scribo/scribo/debug/logger.hh diff --git a/scribo/ChangeLog b/scribo/ChangeLog index d28a95b..a377ba0 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,5 +1,11 @@ 2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Introduce a logger class. + + * scribo/debug/logger.hh: New. + +2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Introduce new anchors. * scribo/core/tag/anchor.hh: New anchors. diff --git a/scribo/scribo/debug/logger.hh b/scribo/scribo/debug/logger.hh new file mode 100644 index 0000000..d955f08 --- /dev/null +++ b/scribo/scribo/debug/logger.hh @@ -0,0 +1,293 @@ +// Copyright (C) 2011 EPITA Research and Development Laboratory +// (LRDE) +// +// This file is part of Olena. +// +// Olena is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation, version 2 of the License. +// +// Olena 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 Olena. If not, see <
http://www.gnu.org/licenses/
>. +// +// As a special exception, you may use this file as part of a free +// software project 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. + +#ifndef SCRIBO_CORE_LOGGER_HH +# define SCRIBO_CORE_LOGGER_HH + +# include <mln/core/concept/image.hh> +# include <mln/data/wrap.hh> +# include <mln/value/int_u8.hh> +# include <mln/debug/filename.hh> +# include <mln/io/pbm/save.hh> +# include <mln/io/pgm/save.hh> +# include <mln/io/ppm/save.hh> + +namespace scribo +{ + + namespace debug + { + + enum Level + { + None = 0, + Special, // Reserved + Results, + AuxiliaryResults, + All + }; + + + namespace internal + { + using namespace mln; + + class logger_ + { + public: + static logger_& instance(); + + bool is_enabled() const; + bool is_at_level(Level level) const; + + void set_level(Level level); + Level level() const; + + void set_filename_prefix(const char *name); + const char *filename_prefix() const; + + template <typename I> + void log_image(Level dbg_level, + const Image<I>& ima, const char *name); + + private: // Methods + logger_(); + logger_(const logger_&); + + template <unsigned n, typename I> + void log_image_dispatch(const value::int_u<n>&, + const Image<I>& ima, const char *name); + + template <unsigned n, typename I> + void + log_image_dispatch(const value::label<n>&, + const Image<I>& ima, const char *name); + + template <typename I> + void log_image_dispatch(const mln_value(I)&, + const Image<I>& ima, const char *name); + + template <typename I> + void log_image_dispatch(const value::rgb8&, + const Image<I>& ima, const char *name); + + template <typename I> + void log_image_dispatch(const bool&, + const Image<I>& ima, const char *name); + + template <typename I> + void log_image_rgb(const I& ima, const std::string& name); + + template <typename I> + void log_image_bool(const I& ima, const std::string& name); + + template <typename I> + void log_image_grayscale(const I& ima, const std::string& name); + + private: // Attributes + Level level_; + + }; + + } // end of namespace scribo::debug::internal + + + // Return a reference to the logger. + scribo::debug::internal::logger_& logger(); + + +# ifndef MLN_INCLUDE_ONLY + + namespace internal + { + + inline + logger_& + logger_::instance() + { + static logger_ log; + return log; + } + + + inline + logger_::logger_() + : level_(None) + { + // Magick::InitializeMagick(0); + } + + + inline + logger_::logger_(const logger_&) + { + abort(); + } + + + inline + bool + logger_::is_enabled() const + { + return level_ != None; + } + + + inline + bool + logger_::is_at_level(Level level) const + { + return level_ >= level; + } + + + inline + void + logger_::set_filename_prefix(const char *name) + { + mln::debug::internal::filename_prefix = name; + } + + + inline + const char * + logger_::filename_prefix() const + { + return mln::debug::internal::filename_prefix.c_str(); + } + + + inline + void logger_::set_level(Level level) + { + level_ = level; + } + + + inline + Level logger_::level() const + { + return level_; + } + + + template <typename I> + void + logger_::log_image(Level dbg_level, + const Image<I>& ima, const char *name) + { +# ifndef SCRIBO_NDEBUG + if (level_ < dbg_level) + return; + + std::cerr << "Logger - Saving image " << name << std::endl; + mln_assertion(exact(ima).is_valid()); + + typedef mln_value(I) V; + log_image_dispatch(V(), ima, name); +# endif // ! SCRIBO_NDEBUG + } + + + template <unsigned n, typename I> + void + logger_::log_image_dispatch(const value::int_u<n>&, const Image<I>& ima, const char *name) + { + log_image_grayscale(exact(ima), name); + } + + template <unsigned n, typename I> + void + logger_::log_image_dispatch(const value::label<n>&, const Image<I>& ima, const char *name) + { + log_image_grayscale(exact(ima), name); + } + + + template <typename I> + void + logger_::log_image_dispatch(const value::rgb8&, const Image<I>& ima, const char *name) + { + log_image_rgb(exact(ima), name); + } + + template <typename I> + void + logger_::log_image_dispatch(const bool&, const Image<I>& ima, const char *name) + { + log_image_bool(exact(ima), name); + } + + + // template <typename I> + // void + // logger_::log_image_generic(const I& ima, const std::string& name) + // { + // io::magick::save(ima, mln::debug::filename(name + ".png")); + // } + + template <typename I> + void + logger_::log_image_rgb(const I& ima, const std::string& name) + { + io::ppm::save(ima, mln::debug::filename(name + ".ppm")); + } + + + template <typename I> + void + logger_::log_image_bool(const I& ima, const std::string& name) + { + io::pbm::save(ima, mln::debug::filename(name + ".pbm")); + } + + + template <typename I> + void + logger_::log_image_grayscale(const I& ima, const std::string& name) + { + io::pgm::save(data::wrap(value::int_u8(), ima), + mln::debug::filename(name + ".pgm")); + } + + } // end of namespace scribo::debug::internal + + + inline + scribo::debug::internal::logger_& + logger() + { + return scribo::debug::internal::logger_::instance(); + } + + +# endif // ! MLN_INCLUDE_ONLY + + } // end of namespace scribo::debug + +} // end of namespace scribo + +#endif // ! SCRIBO_CORE_LOGGER_HH -- 1.5.6.5
13 years, 9 months
1
0
0
0
last-svn-commit-799-gfe898e7 Introduce a logger class.
by Guillaume Lazzara
* scribo/debug/logger.hh: New. --- scribo/ChangeLog | 6 + scribo/scribo/debug/logger.hh | 293 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 299 insertions(+), 0 deletions(-) create mode 100644 scribo/scribo/debug/logger.hh diff --git a/scribo/ChangeLog b/scribo/ChangeLog index 58685f6..50c49e7 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,5 +1,11 @@ 2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Introduce a logger class. + + * scribo/debug/logger.hh: New. + +2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Introduce new anchors. * scribo/core/tag/anchor.hh: New anchors. diff --git a/scribo/scribo/debug/logger.hh b/scribo/scribo/debug/logger.hh new file mode 100644 index 0000000..d955f08 --- /dev/null +++ b/scribo/scribo/debug/logger.hh @@ -0,0 +1,293 @@ +// Copyright (C) 2011 EPITA Research and Development Laboratory +// (LRDE) +// +// This file is part of Olena. +// +// Olena is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation, version 2 of the License. +// +// Olena 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 Olena. If not, see <
http://www.gnu.org/licenses/
>. +// +// As a special exception, you may use this file as part of a free +// software project 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. + +#ifndef SCRIBO_CORE_LOGGER_HH +# define SCRIBO_CORE_LOGGER_HH + +# include <mln/core/concept/image.hh> +# include <mln/data/wrap.hh> +# include <mln/value/int_u8.hh> +# include <mln/debug/filename.hh> +# include <mln/io/pbm/save.hh> +# include <mln/io/pgm/save.hh> +# include <mln/io/ppm/save.hh> + +namespace scribo +{ + + namespace debug + { + + enum Level + { + None = 0, + Special, // Reserved + Results, + AuxiliaryResults, + All + }; + + + namespace internal + { + using namespace mln; + + class logger_ + { + public: + static logger_& instance(); + + bool is_enabled() const; + bool is_at_level(Level level) const; + + void set_level(Level level); + Level level() const; + + void set_filename_prefix(const char *name); + const char *filename_prefix() const; + + template <typename I> + void log_image(Level dbg_level, + const Image<I>& ima, const char *name); + + private: // Methods + logger_(); + logger_(const logger_&); + + template <unsigned n, typename I> + void log_image_dispatch(const value::int_u<n>&, + const Image<I>& ima, const char *name); + + template <unsigned n, typename I> + void + log_image_dispatch(const value::label<n>&, + const Image<I>& ima, const char *name); + + template <typename I> + void log_image_dispatch(const mln_value(I)&, + const Image<I>& ima, const char *name); + + template <typename I> + void log_image_dispatch(const value::rgb8&, + const Image<I>& ima, const char *name); + + template <typename I> + void log_image_dispatch(const bool&, + const Image<I>& ima, const char *name); + + template <typename I> + void log_image_rgb(const I& ima, const std::string& name); + + template <typename I> + void log_image_bool(const I& ima, const std::string& name); + + template <typename I> + void log_image_grayscale(const I& ima, const std::string& name); + + private: // Attributes + Level level_; + + }; + + } // end of namespace scribo::debug::internal + + + // Return a reference to the logger. + scribo::debug::internal::logger_& logger(); + + +# ifndef MLN_INCLUDE_ONLY + + namespace internal + { + + inline + logger_& + logger_::instance() + { + static logger_ log; + return log; + } + + + inline + logger_::logger_() + : level_(None) + { + // Magick::InitializeMagick(0); + } + + + inline + logger_::logger_(const logger_&) + { + abort(); + } + + + inline + bool + logger_::is_enabled() const + { + return level_ != None; + } + + + inline + bool + logger_::is_at_level(Level level) const + { + return level_ >= level; + } + + + inline + void + logger_::set_filename_prefix(const char *name) + { + mln::debug::internal::filename_prefix = name; + } + + + inline + const char * + logger_::filename_prefix() const + { + return mln::debug::internal::filename_prefix.c_str(); + } + + + inline + void logger_::set_level(Level level) + { + level_ = level; + } + + + inline + Level logger_::level() const + { + return level_; + } + + + template <typename I> + void + logger_::log_image(Level dbg_level, + const Image<I>& ima, const char *name) + { +# ifndef SCRIBO_NDEBUG + if (level_ < dbg_level) + return; + + std::cerr << "Logger - Saving image " << name << std::endl; + mln_assertion(exact(ima).is_valid()); + + typedef mln_value(I) V; + log_image_dispatch(V(), ima, name); +# endif // ! SCRIBO_NDEBUG + } + + + template <unsigned n, typename I> + void + logger_::log_image_dispatch(const value::int_u<n>&, const Image<I>& ima, const char *name) + { + log_image_grayscale(exact(ima), name); + } + + template <unsigned n, typename I> + void + logger_::log_image_dispatch(const value::label<n>&, const Image<I>& ima, const char *name) + { + log_image_grayscale(exact(ima), name); + } + + + template <typename I> + void + logger_::log_image_dispatch(const value::rgb8&, const Image<I>& ima, const char *name) + { + log_image_rgb(exact(ima), name); + } + + template <typename I> + void + logger_::log_image_dispatch(const bool&, const Image<I>& ima, const char *name) + { + log_image_bool(exact(ima), name); + } + + + // template <typename I> + // void + // logger_::log_image_generic(const I& ima, const std::string& name) + // { + // io::magick::save(ima, mln::debug::filename(name + ".png")); + // } + + template <typename I> + void + logger_::log_image_rgb(const I& ima, const std::string& name) + { + io::ppm::save(ima, mln::debug::filename(name + ".ppm")); + } + + + template <typename I> + void + logger_::log_image_bool(const I& ima, const std::string& name) + { + io::pbm::save(ima, mln::debug::filename(name + ".pbm")); + } + + + template <typename I> + void + logger_::log_image_grayscale(const I& ima, const std::string& name) + { + io::pgm::save(data::wrap(value::int_u8(), ima), + mln::debug::filename(name + ".pgm")); + } + + } // end of namespace scribo::debug::internal + + + inline + scribo::debug::internal::logger_& + logger() + { + return scribo::debug::internal::logger_::instance(); + } + + +# endif // ! MLN_INCLUDE_ONLY + + } // end of namespace scribo::debug + +} // end of namespace scribo + +#endif // ! SCRIBO_CORE_LOGGER_HH -- 1.5.6.5
13 years, 9 months
1
0
0
0
last-svn-commit-799-g3f06d28 Introduce a logger class.
by Guillaume Lazzara
* scribo/debug/logger.hh: New. --- scribo/ChangeLog | 6 + scribo/scribo/debug/logger.hh | 293 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 299 insertions(+), 0 deletions(-) create mode 100644 scribo/scribo/debug/logger.hh diff --git a/scribo/ChangeLog b/scribo/ChangeLog index 58685f6..50c49e7 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,5 +1,11 @@ 2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Introduce a logger class. + + * scribo/debug/logger.hh: New. + +2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Introduce new anchors. * scribo/core/tag/anchor.hh: New anchors. diff --git a/scribo/scribo/debug/logger.hh b/scribo/scribo/debug/logger.hh new file mode 100644 index 0000000..d955f08 --- /dev/null +++ b/scribo/scribo/debug/logger.hh @@ -0,0 +1,293 @@ +// Copyright (C) 2011 EPITA Research and Development Laboratory +// (LRDE) +// +// This file is part of Olena. +// +// Olena is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation, version 2 of the License. +// +// Olena 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 Olena. If not, see <
http://www.gnu.org/licenses/
>. +// +// As a special exception, you may use this file as part of a free +// software project 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. + +#ifndef SCRIBO_CORE_LOGGER_HH +# define SCRIBO_CORE_LOGGER_HH + +# include <mln/core/concept/image.hh> +# include <mln/data/wrap.hh> +# include <mln/value/int_u8.hh> +# include <mln/debug/filename.hh> +# include <mln/io/pbm/save.hh> +# include <mln/io/pgm/save.hh> +# include <mln/io/ppm/save.hh> + +namespace scribo +{ + + namespace debug + { + + enum Level + { + None = 0, + Special, // Reserved + Results, + AuxiliaryResults, + All + }; + + + namespace internal + { + using namespace mln; + + class logger_ + { + public: + static logger_& instance(); + + bool is_enabled() const; + bool is_at_level(Level level) const; + + void set_level(Level level); + Level level() const; + + void set_filename_prefix(const char *name); + const char *filename_prefix() const; + + template <typename I> + void log_image(Level dbg_level, + const Image<I>& ima, const char *name); + + private: // Methods + logger_(); + logger_(const logger_&); + + template <unsigned n, typename I> + void log_image_dispatch(const value::int_u<n>&, + const Image<I>& ima, const char *name); + + template <unsigned n, typename I> + void + log_image_dispatch(const value::label<n>&, + const Image<I>& ima, const char *name); + + template <typename I> + void log_image_dispatch(const mln_value(I)&, + const Image<I>& ima, const char *name); + + template <typename I> + void log_image_dispatch(const value::rgb8&, + const Image<I>& ima, const char *name); + + template <typename I> + void log_image_dispatch(const bool&, + const Image<I>& ima, const char *name); + + template <typename I> + void log_image_rgb(const I& ima, const std::string& name); + + template <typename I> + void log_image_bool(const I& ima, const std::string& name); + + template <typename I> + void log_image_grayscale(const I& ima, const std::string& name); + + private: // Attributes + Level level_; + + }; + + } // end of namespace scribo::debug::internal + + + // Return a reference to the logger. + scribo::debug::internal::logger_& logger(); + + +# ifndef MLN_INCLUDE_ONLY + + namespace internal + { + + inline + logger_& + logger_::instance() + { + static logger_ log; + return log; + } + + + inline + logger_::logger_() + : level_(None) + { + // Magick::InitializeMagick(0); + } + + + inline + logger_::logger_(const logger_&) + { + abort(); + } + + + inline + bool + logger_::is_enabled() const + { + return level_ != None; + } + + + inline + bool + logger_::is_at_level(Level level) const + { + return level_ >= level; + } + + + inline + void + logger_::set_filename_prefix(const char *name) + { + mln::debug::internal::filename_prefix = name; + } + + + inline + const char * + logger_::filename_prefix() const + { + return mln::debug::internal::filename_prefix.c_str(); + } + + + inline + void logger_::set_level(Level level) + { + level_ = level; + } + + + inline + Level logger_::level() const + { + return level_; + } + + + template <typename I> + void + logger_::log_image(Level dbg_level, + const Image<I>& ima, const char *name) + { +# ifndef SCRIBO_NDEBUG + if (level_ < dbg_level) + return; + + std::cerr << "Logger - Saving image " << name << std::endl; + mln_assertion(exact(ima).is_valid()); + + typedef mln_value(I) V; + log_image_dispatch(V(), ima, name); +# endif // ! SCRIBO_NDEBUG + } + + + template <unsigned n, typename I> + void + logger_::log_image_dispatch(const value::int_u<n>&, const Image<I>& ima, const char *name) + { + log_image_grayscale(exact(ima), name); + } + + template <unsigned n, typename I> + void + logger_::log_image_dispatch(const value::label<n>&, const Image<I>& ima, const char *name) + { + log_image_grayscale(exact(ima), name); + } + + + template <typename I> + void + logger_::log_image_dispatch(const value::rgb8&, const Image<I>& ima, const char *name) + { + log_image_rgb(exact(ima), name); + } + + template <typename I> + void + logger_::log_image_dispatch(const bool&, const Image<I>& ima, const char *name) + { + log_image_bool(exact(ima), name); + } + + + // template <typename I> + // void + // logger_::log_image_generic(const I& ima, const std::string& name) + // { + // io::magick::save(ima, mln::debug::filename(name + ".png")); + // } + + template <typename I> + void + logger_::log_image_rgb(const I& ima, const std::string& name) + { + io::ppm::save(ima, mln::debug::filename(name + ".ppm")); + } + + + template <typename I> + void + logger_::log_image_bool(const I& ima, const std::string& name) + { + io::pbm::save(ima, mln::debug::filename(name + ".pbm")); + } + + + template <typename I> + void + logger_::log_image_grayscale(const I& ima, const std::string& name) + { + io::pgm::save(data::wrap(value::int_u8(), ima), + mln::debug::filename(name + ".pgm")); + } + + } // end of namespace scribo::debug::internal + + + inline + scribo::debug::internal::logger_& + logger() + { + return scribo::debug::internal::logger_::instance(); + } + + +# endif // ! MLN_INCLUDE_ONLY + + } // end of namespace scribo::debug + +} // end of namespace scribo + +#endif // ! SCRIBO_CORE_LOGGER_HH -- 1.5.6.5
13 years, 9 months
1
0
0
0
last-svn-commit-799-g257be9e Introduce new anchors.
by Guillaume Lazzara
* scribo/core/tag/anchor.hh: New anchors. * scribo/filter/internal/alignment_angle.hh, * scribo/primitive/link/internal/compute_anchor.hh: Make use of that new anchors. --- scribo/ChangeLog | 10 ++++++++++ scribo/scribo/core/tag/anchor.hh | 6 ++++-- scribo/scribo/filter/internal/alignment_angle.hh | 2 ++ .../primitive/link/internal/compute_anchor.hh | 16 ++++++++++++++-- 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/scribo/ChangeLog b/scribo/ChangeLog index f0bff06..d28a95b 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,5 +1,15 @@ 2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Introduce new anchors. + + * scribo/core/tag/anchor.hh: New anchors. + + * scribo/filter/internal/alignment_angle.hh, + * scribo/primitive/link/internal/compute_anchor.hh: Make use of + that new anchors. + +2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Rename document serializer base class. * scribo/core/internal/doc_xml_serializer.hh: Rename as... diff --git a/scribo/scribo/core/tag/anchor.hh b/scribo/scribo/core/tag/anchor.hh index bb6780c..7ce8ddc 100644 --- a/scribo/scribo/core/tag/anchor.hh +++ b/scribo/scribo/core/tag/anchor.hh @@ -37,11 +37,13 @@ namespace scribo { MassCenter = 0, Top, + StrictTopCenter, Bottom, + StrictBottomCenter, Center, - ActualLeft, + StrictLeft, Left, - ActualRight, + StrictRight, Right, TopLeft, TopStrictLeft, diff --git a/scribo/scribo/filter/internal/alignment_angle.hh b/scribo/scribo/filter/internal/alignment_angle.hh index 33855a8..035dec7 100644 --- a/scribo/scribo/filter/internal/alignment_angle.hh +++ b/scribo/scribo/filter/internal/alignment_angle.hh @@ -109,6 +109,7 @@ namespace scribo break; // Top + case anchor::StrictTopCenter: case anchor::TopStrictLeft: case anchor::Top: { @@ -122,6 +123,7 @@ namespace scribo break; // Bottom + case anchor::StrictBottomCenter: case anchor::BottomStrictRight: case anchor::Bottom: { diff --git a/scribo/scribo/primitive/link/internal/compute_anchor.hh b/scribo/scribo/primitive/link/internal/compute_anchor.hh index c1a9106..9afc33f 100644 --- a/scribo/scribo/primitive/link/internal/compute_anchor.hh +++ b/scribo/scribo/primitive/link/internal/compute_anchor.hh @@ -111,6 +111,12 @@ namespace scribo break; + // Bounding box Strict top center + case anchor::StrictTopCenter: + sp.row() = components(current_object).bbox().pmin().row(); + break; + + // Bounding box top left case anchor::TopStrictLeft: sp.col() = components(current_object).bbox().pmin().col(); @@ -138,13 +144,19 @@ namespace scribo break; + // Bounding box strict bottom center. + case anchor::StrictBottomCenter: + sp.row() = components(current_object).bbox().pmax().row(); + break; + + // Bounding box center case anchor::Center: return components(current_object).bbox().pcenter(); // Bounding box actual left center - case anchor::ActualLeft: + case anchor::StrictLeft: return P(components(current_object).bbox().pcenter().row(), components(current_object).bbox().pmin().col()); @@ -161,7 +173,7 @@ namespace scribo // Bounding box actual right center - case anchor::ActualRight: + case anchor::StrictRight: return P(components(current_object).bbox().pcenter().row(), components(current_object).bbox().pmax().col()); -- 1.5.6.5
13 years, 9 months
1
0
0
0
last-svn-commit-798-g5b25a55 Introduce new anchors.
by Guillaume Lazzara
* scribo/core/tag/anchor.hh: New anchors. * scribo/filter/internal/alignment_angle.hh, * scribo/primitive/link/internal/compute_anchor.hh: Make use of that new anchors. --- scribo/ChangeLog | 10 ++++++++++ scribo/scribo/core/tag/anchor.hh | 6 ++++-- scribo/scribo/filter/internal/alignment_angle.hh | 2 ++ .../primitive/link/internal/compute_anchor.hh | 16 ++++++++++++++-- 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/scribo/ChangeLog b/scribo/ChangeLog index 1de58fe..58685f6 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,5 +1,15 @@ 2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Introduce new anchors. + + * scribo/core/tag/anchor.hh: New anchors. + + * scribo/filter/internal/alignment_angle.hh, + * scribo/primitive/link/internal/compute_anchor.hh: Make use of + that new anchors. + +2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Rename document serializer base class. * scribo/core/internal/doc_xml_serializer.hh: Rename as... diff --git a/scribo/scribo/core/tag/anchor.hh b/scribo/scribo/core/tag/anchor.hh index bb6780c..7ce8ddc 100644 --- a/scribo/scribo/core/tag/anchor.hh +++ b/scribo/scribo/core/tag/anchor.hh @@ -37,11 +37,13 @@ namespace scribo { MassCenter = 0, Top, + StrictTopCenter, Bottom, + StrictBottomCenter, Center, - ActualLeft, + StrictLeft, Left, - ActualRight, + StrictRight, Right, TopLeft, TopStrictLeft, diff --git a/scribo/scribo/filter/internal/alignment_angle.hh b/scribo/scribo/filter/internal/alignment_angle.hh index 33855a8..035dec7 100644 --- a/scribo/scribo/filter/internal/alignment_angle.hh +++ b/scribo/scribo/filter/internal/alignment_angle.hh @@ -109,6 +109,7 @@ namespace scribo break; // Top + case anchor::StrictTopCenter: case anchor::TopStrictLeft: case anchor::Top: { @@ -122,6 +123,7 @@ namespace scribo break; // Bottom + case anchor::StrictBottomCenter: case anchor::BottomStrictRight: case anchor::Bottom: { diff --git a/scribo/scribo/primitive/link/internal/compute_anchor.hh b/scribo/scribo/primitive/link/internal/compute_anchor.hh index c1a9106..9afc33f 100644 --- a/scribo/scribo/primitive/link/internal/compute_anchor.hh +++ b/scribo/scribo/primitive/link/internal/compute_anchor.hh @@ -111,6 +111,12 @@ namespace scribo break; + // Bounding box Strict top center + case anchor::StrictTopCenter: + sp.row() = components(current_object).bbox().pmin().row(); + break; + + // Bounding box top left case anchor::TopStrictLeft: sp.col() = components(current_object).bbox().pmin().col(); @@ -138,13 +144,19 @@ namespace scribo break; + // Bounding box strict bottom center. + case anchor::StrictBottomCenter: + sp.row() = components(current_object).bbox().pmax().row(); + break; + + // Bounding box center case anchor::Center: return components(current_object).bbox().pcenter(); // Bounding box actual left center - case anchor::ActualLeft: + case anchor::StrictLeft: return P(components(current_object).bbox().pcenter().row(), components(current_object).bbox().pmin().col()); @@ -161,7 +173,7 @@ namespace scribo // Bounding box actual right center - case anchor::ActualRight: + case anchor::StrictRight: return P(components(current_object).bbox().pcenter().row(), components(current_object).bbox().pmax().col()); -- 1.5.6.5
13 years, 9 months
1
0
0
0
← Newer
1
...
21
22
23
24
25
26
27
28
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Results per page:
10
25
50
100
200