2 axis-group-spanner.cc -- implement Axis_group_spanner
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
9 #include "axis-group-spanner.hh"
13 /** Do stuff if we're not broken. In this case the last and first
14 columns usually are pre- and postbreak respectively,
15 so the items from these columns need adjusting.
18 Axis_group_spanner::do_break_processing_if_unbroken()
20 Link_array<Score_elem> elems = axis_admin_.elem_l_arr_;
21 Line_of_score *my_line = line_l();
22 for (int i=0; i < elems.size(); i++)
24 if (!elems[i]->line_l())
26 Item * item_l = elems[i]->item();
28 && item_l->breakable_b_
29 && item_l->break_status_i() == 0)
31 // last two checks are paranoia
32 Item * broken_item_l =
33 item_l->find_prebroken_piece (my_line);
34 add_element (broken_item_l);
36 remove_element (elems[i]);
42 Axis_group_spanner::do_break_processing()
45 bool breaking_self_b = ! Spanner::line_l();
48 do_break_processing_if_unbroken();
49 Spanner::do_break_processing();
53 break_into_pieces (true);
54 Link_array<Score_elem> loose_elems = axis_admin_.elem_l_arr_;
57 for (int i=0; i < loose_elems.size(); i++)
59 Score_elem * elt = loose_elems[i];
60 Line_of_score *elt_line = elt->line_l();
64 /* this piece doesn't know where it belongs.
65 Find out if it was broken, and use the broken remains
69 Spanner * sp = elt->spanner();
71 for (int j =0; j < broken_into_l_arr_.size(); j++)
73 Axis_group_spanner * my_broken_l
74 = (Axis_group_spanner*)broken_into_l_arr_[j];
76 Spanner * broken_span_l
77 = sp->find_broken_piece (
78 ((Score_elem*)my_broken_l)->line_l());
81 my_broken_l->add_element (broken_span_l);
86 && elt->item()->breakable_b_
87 && elt->item()->break_status_i () == 0)
91 for (int j =0; j < 2; j++)
93 Item * my_item = elt->item()->broken_to_a_[j];
94 Line_of_score * item_line_l = my_item->line_l() ;
98 Axis_group_spanner * v
99 = (Axis_group_spanner*)find_broken_piece (item_line_l);
101 v->add_element (my_item);
108 /* this piece *does* know where it belongs.
109 Put it in appropriate piece of this spanner
111 Axis_group_spanner * my_broken_l
112 = (Axis_group_spanner*)find_broken_piece (elt->line_l());
113 my_broken_l->add_element (elt);
117 Spanner::do_break_processing();
121 Axis_group_spanner::do_print() const
123 Axis_group_element::do_print();
128 IMPLEMENT_IS_TYPE_B2(Axis_group_spanner, Spanner, Axis_group_element);