27 #ifndef SCRIBO_FILTER_INTERNAL_COMPONENT_ALIGNED_HH
28 # define SCRIBO_FILTER_INTERNAL_COMPONENT_ALIGNED_HH
35 # include <mln/util/array.hh>
36 # include <mln/math/abs.hh>
37 # include <mln/math/pi.hh>
39 # include <scribo/core/macros.hh>
40 # include <scribo/core/tag/anchor.hh>
41 # include <scribo/core/component_set.hh>
42 # include <scribo/filter/internal/alignment_angle.hh>
58 component_aligned(
const component_set<L>& comps,
59 unsigned current_object,
unsigned nbh_object,
60 anchor::Type anchor,
float max_alpha);
65 component_aligned_rad(
const component_set<L>& comps,
66 unsigned current_object,
unsigned nbh_object,
67 anchor::Type anchor,
float max_alpha_rad);
70 # ifndef MLN_INCLUDE_ONLY
75 component_aligned(
const component_set<L>& comps,
76 unsigned current_object,
unsigned ,
77 anchor::Type anchor,
float max_alpha)
79 float max_alpha_rad = (max_alpha / 180.0f) *
math::pi;
81 return component_aligned(comps, current_object, anchor, max_alpha_rad);
88 component_aligned_rad(
const component_set<L>& comps,
89 unsigned current_object,
unsigned nbh_object,
90 anchor::Type anchor,
float max_alpha_rad)
92 mln_trace(
"scribo::filter::internal::component_aligned_rad");
94 mln_precondition(comps.is_valid());
96 float angle = alignment_angle(comps, current_object,
99 bool output = (angle <= max_alpha_rad);
104 # endif // ! MLN_INCLUDE_ONLY
113 #endif // ! SCRIBO_FILTER_INTERNAL_COMPONENT_ALIGNED_HH