* scribo/filter/object_links_bbox_overlap.hh,
* scribo/filter/object_links_bbox_ratio.hh,
* scribo/filter/object_links_non_aligned_simple.hh,
* scribo/primitive/link/merge_double_link.hh: Ignore invalid links.
---
scribo/ChangeLog | 9 +++++++++
scribo/scribo/filter/object_links_bbox_overlap.hh | 2 +-
scribo/scribo/filter/object_links_bbox_ratio.hh | 7 ++++---
.../filter/object_links_non_aligned_simple.hh | 9 +++++----
scribo/scribo/primitive/link/merge_double_link.hh | 5 +++--
5 files changed, 22 insertions(+), 10 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index f6c6a4b..9493a12 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,14 @@
2010-10-21 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Fix issues with object_links and ignored components.
+
+ * scribo/filter/object_links_bbox_overlap.hh,
+ * scribo/filter/object_links_bbox_ratio.hh,
+ * scribo/filter/object_links_non_aligned_simple.hh,
+ * scribo/primitive/link/merge_double_link.hh: Ignore invalid links.
+
+2010-10-21 Guillaume Lazzara <z(a)lrde.epita.fr>
+
* scribo/core/component_set.hh: Fix component_set id type.
2010-10-21 Guillaume Lazzara <z(a)lrde.epita.fr>
diff --git a/scribo/scribo/filter/object_links_bbox_overlap.hh
b/scribo/scribo/filter/object_links_bbox_overlap.hh
index ffcbb6c..995ad68 100644
--- a/scribo/scribo/filter/object_links_bbox_overlap.hh
+++ b/scribo/scribo/filter/object_links_bbox_overlap.hh
@@ -81,7 +81,7 @@ namespace scribo
object_links<L> output(links);
for_all_comps(i, components)
- if (components(i).is_valid() && links(i) != i)
+ if (components(i).is_valid() && links(i) && links(i) != i)
{
bool has_intersection = true;
mln_site(L) pmin, pmax;
diff --git a/scribo/scribo/filter/object_links_bbox_ratio.hh
b/scribo/scribo/filter/object_links_bbox_ratio.hh
index e5d41c6..5318b57 100644
--- a/scribo/scribo/filter/object_links_bbox_ratio.hh
+++ b/scribo/scribo/filter/object_links_bbox_ratio.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -79,8 +80,8 @@ namespace scribo
const component_set<L>& components = links.components();
object_links<L> output = links.duplicate();
- for (unsigned i = 1; i < links.nelements(); ++i)
- if (links(i) != i)
+ for_all_links(i, links)
+ if (links(i) && links(i) != i)
{
float
lmin = components(i).bbox().pmax()[dim]
diff --git a/scribo/scribo/filter/object_links_non_aligned_simple.hh
b/scribo/scribo/filter/object_links_non_aligned_simple.hh
index 1f56d85..2381d88 100644
--- a/scribo/scribo/filter/object_links_non_aligned_simple.hh
+++ b/scribo/scribo/filter/object_links_non_aligned_simple.hh
@@ -109,10 +109,11 @@ namespace scribo
float max_alpha_rad = (max_alpha / 180.0f) * math::pi;
for_all_comps(i, comps)
- if (!::scribo::filter::internal::component_aligned_rad(comps, i, links(i),
- anchor,
- max_alpha_rad))
- output(i) = i;
+ if (comps(i).is_valid() && links(i))
+ if (!::scribo::filter::internal::component_aligned_rad(comps, i, links(i),
+ anchor,
+ max_alpha_rad))
+ output(i) = i;
trace::exiting("scribo::filter::object_links_non_aligned_simple");
diff --git a/scribo/scribo/primitive/link/merge_double_link.hh
b/scribo/scribo/primitive/link/merge_double_link.hh
index 94a44ef..e58c1ab 100644
--- a/scribo/scribo/primitive/link/merge_double_link.hh
+++ b/scribo/scribo/primitive/link/merge_double_link.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -92,7 +93,7 @@ namespace scribo
const component_set<L>& components = left_link.components();
- object_links<L> merge(left_link);
+ object_links<L> merge = left_link.duplicate();
for_all_ncomponents(i, components.nelements())
{
--
1.5.6.5
Show replies by date