2 scoreline.cc -- implement Line_of_score
4 source file of the GNU LilyPond music typesetter
6 (c) 1996, 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "line-of-score.hh"
12 #include "paper-def.hh"
17 Line_of_score::Line_of_score()
23 IMPLEMENT_IS_TYPE_B1(Line_of_score,Spanner);
26 Line_of_score::add_element (Score_element*e)
28 // avoid excess dependencies.
29 if (!(e->axis_group_l_a_[0] || e->axis_group_l_a_[1]))
34 Line_of_score::contains_b (Paper_column const* c) const
36 return cols.find_l ((Paper_column*)c);
40 Line_of_score::set_breaking (Array<Column_x_positions> const &breaking, int j) const
42 const Array<Paper_column*> &curline (breaking[j].cols);
43 const Array<Paper_column*> &errors (breaking[j].error_col_l_arr_);
44 const Array<Real> &config (breaking[j].config);
46 for (int i=0; i < errors.size(); i++)
47 errors[i]->error_mark_b_ = true;
49 Line_of_score *line_l=0;
51 if (breaking.size() >1)
53 line_l = dynamic_cast <Line_of_score*> (clone());
56 line_l = (Line_of_score*) this;
58 ((Array<Paper_column*> &)line_l->cols) = curline;
59 line_l->set_bounds(LEFT,curline[0]);
61 line_l->set_bounds(RIGHT,curline.top());
63 for (int i=0; i < curline.size(); i++)
65 curline[i]->translate_axis (config[i],X_AXIS);
66 curline[i]->line_l_ = (Line_of_score*)line_l;
76 Line_of_score::do_print() const
82 Line_of_score::do_width() const
84 return Spanner::do_width();
87 Link_array<Score_element>
88 Line_of_score::get_extra_dependencies () const
90 Link_array<Score_element> r;
91 for (int i=0; i < cols.size (); i++)
97 Line_of_score::do_unlink ()
99 Spanner::do_unlink ();
100 for (int i=0; i < cols.size (); i++)
107 Line_of_score::do_junk_links ()