2 axis-group-spanner.cc -- implement Axis_group_spanner
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "axis-group-spanner.hh"
14 /** Do stuff if we're not broken. In this case the last and first
15 columns usually are pre- and postbreak respectively,
16 so the items from these columns need adjusting.
19 Axis_group_spanner::do_break_processing_if_unbroken()
21 Link_array<Score_element> elems = elem_l_arr ();
22 Line_of_score *my_line = line_l();
23 for (int i=0; i < elems.size(); i++)
25 if (!elems[i]->line_l())
27 Item * item_l = dynamic_cast<Item*> (elems[i]);
29 && item_l->breakable_b_
30 && item_l->break_status_dir() == 0)
32 // last two checks are paranoia
33 Item * broken_item_l =
34 item_l->find_prebroken_piece (my_line);
35 add_element (broken_item_l);
37 remove_element (elems[i]);
43 Axis_group_spanner::do_break_processing()
45 DOUT << "do_break_processing ()\n";
46 bool breaking_self_b = ! Spanner::line_l();
49 do_break_processing_if_unbroken();
50 Spanner::do_break_processing();
55 Link_array<Score_element> loose_elems = elem_l_arr ();
58 for (int i=0; i < loose_elems.size(); i++)
60 Score_element * elt = loose_elems[i];
61 Line_of_score *elt_line = elt->line_l();
65 /* this piece doesn't know where it belongs.
66 Find out if it was broken, and use the broken remains
69 Item *it = dynamic_cast <Item *> (elt) ;
70 if (Spanner * sp =dynamic_cast <Spanner *> (elt))
72 for (int j =0; j < sp->broken_info_.size(); j++)
74 Line_of_score *l = sp->broken_info_[j].line_l_;
76 Axis_group_spanner * my_broken_l
77 = dynamic_cast<Axis_group_spanner*>(find_broken_piece (l));
79 Spanner * broken_span_l
80 = sp->find_broken_piece (l);
83 my_broken_l->add_element (broken_span_l);
86 else if (it && it->breakable_b_ && it->break_status_dir () == 0)
92 Item * my_item = it->broken_to_drul_[j];
93 Line_of_score * item_line_l = my_item->line_l() ;
97 Axis_group_spanner * v
98 = dynamic_cast<Axis_group_spanner*>(find_broken_piece (item_line_l));
100 v->add_element (my_item);
103 my_item->transparent_b_ = true;
104 my_item->set_empty (true);
105 /*my_item->unlink ();
110 while (flip(&j) != LEFT);
115 /* this piece *does* know where it belongs.
116 Put it in appropriate piece of this spanner
118 Axis_group_spanner * my_broken_l
119 = dynamic_cast<Axis_group_spanner*> (find_broken_piece (elt->line_l()));
120 my_broken_l->add_element (elt);
124 Spanner::do_break_processing();
128 Axis_group_spanner::do_print() const
130 Axis_group_element::do_print();
132 Spanner::do_print ();