2 note-head-side.cc -- implement Note_head_side
4 source file of the GNU LilyPond music typesetter
6 (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "note-head-side.hh"
13 Note_head_side::add_support (Item
*head_l
)
15 if (support_l_arr_
.find_l(head_l
))
17 support_l_arr_
.push (head_l
);
18 add_dependency (head_l
);
22 Note_head_side::do_pre_processing ()
25 for (int i
=0; i
< support_l_arr_
.size(); i
++)
27 Dimension_cache
*common
=
28 common_group (support_l_arr_
[i
], X_AXIS
);
30 Real x
= support_l_arr_
[i
]->relative_coordinate (common
, X_AXIS
)
31 - relative_coordinate (common
, X_AXIS
);
33 x_int
.unite (x
+ support_l_arr_
[i
]->extent (X_AXIS
));
37 x_int
= Interval(0,0);
39 translate_axis (-extent(X_AXIS
)[-notehead_align_dir_
] + x_int
[notehead_align_dir_
], X_AXIS
);
43 Note_head_side::do_substitute_element_pointer (Score_element
*o
,Score_element
*n
)
45 if (Item
* o_l
= dynamic_cast <Item
*> (o
))
46 support_l_arr_
.substitute (o_l
,dynamic_cast <Item
*> (n
));
49 Note_head_side:: Note_head_side()
51 notehead_align_dir_
= LEFT
;
54 Note_head_side::supported_b ()const
56 return support_l_arr_
.size ();