Commit 87288fed authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

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.
parent b44674d0
2010-10-21 Guillaume Lazzara <z@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@lrde.epita.fr>
* scribo/core/component_set.hh: Fix component_set id type.
......
......@@ -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;
......
// 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]
......
......@@ -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");
......
// 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())
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment