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()
26 Line_of_score::add_element (Score_element*e)
28 // avoid excess dependencies.
29 if (! (e->parent_l (X_AXIS) || e->parent_l (Y_AXIS)) )
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 Link_array<Paper_column> &curline (breaking[j].cols);
43 const Link_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 line_l->cols_ = curline;
59 /* Array<Paper_column*> &
60 ((Array<Paper_column*> &)) = */
61 line_l->set_bounds(LEFT,curline[0]);
63 line_l->set_bounds(RIGHT,curline.top());
65 for (int i=0; i < curline.size(); i++)
67 curline[i]->translate_axis (config[i],X_AXIS);
68 curline[i]->line_l_ = dynamic_cast<Line_of_score*>(line_l);
78 Line_of_score::do_print() const
84 Line_of_score::do_width() const
86 return Spanner::do_width();
89 Link_array<Score_element>
90 Line_of_score::get_extra_dependencies () const
92 Link_array<Score_element> r;
93 for (int i=0; i < cols_.size (); i++)
99 Line_of_score::do_unlink ()
101 Spanner::do_unlink ();
102 for (int i=0; i < cols_.size (); i++)
103 cols_[i]->line_l_ =0;
109 Line_of_score::do_junk_links ()