X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fbreak-algorithm.cc;h=3337bff317a95f570e15a14b6314022e3f34377f;hb=8903693f3b43cf4b196b558aa939b9e148ddaec1;hp=fd5955fc3845a604f55641acf4e0d33e65a6794d;hpb=d1965f31e75a5e1e9faeb995ef2d37ce5fb3ff85;p=lilypond.git diff --git a/lily/break-algorithm.cc b/lily/break-algorithm.cc index fd5955fc38..3337bff317 100644 --- a/lily/break-algorithm.cc +++ b/lily/break-algorithm.cc @@ -3,10 +3,10 @@ source file of the GNU LilyPond music typesetter - (c) 1996, 1997--1999 Han-Wen Nienhuys + (c) 1996--2000 Han-Wen Nienhuys */ -#include "score-column.hh" +#include "paper-column.hh" #include "break-algorithm.hh" #include "paper-def.hh" #include "debug.hh" @@ -16,22 +16,22 @@ #include "cpu-timer.hh" #include "command-request.hh" #include "simple-spacer.hh" - - - +#include "group-interface.hh" Array Break_algorithm::find_break_indices () const { - Line_of_cols all (pscore_l_->col_l_arr_); + Link_array all = pscore_l_->line_l_->column_l_arr (); + + Array retval; for (int i=0; i < all.size (); i++) if (all[i]->breakable_b ()) retval.push (i); - if (linelength <=0) + if (linewidth_f_ <=0) while (retval.size () >2) retval.del (1); @@ -39,17 +39,18 @@ Break_algorithm::find_break_indices () const } -Line_of_cols +Link_array Break_algorithm::find_breaks () const { - Line_of_cols all (pscore_l_->col_l_arr_); - Line_of_cols retval; + Link_array all = pscore_l_->line_l_->column_l_arr (); + + Link_array retval; for (int i=0; i < all.size (); i++) if (all[i]->breakable_b ()) retval.push (all[i]); - if (linelength <=0) + if (linewidth_f_ <=0) while (retval.size () >2) retval.del (1); @@ -58,7 +59,7 @@ Break_algorithm::find_breaks () const Simple_spacer* -Break_algorithm::generate_spacing_problem (Line_of_cols curline, Interval line) const +Break_algorithm::generate_spacing_problem (Link_array curline, Interval line) const { Simple_spacer * sp = new Simple_spacer; Paper_def * d = pscore_l_->paper_l_; @@ -86,43 +87,14 @@ Break_algorithm::generate_spacing_problem (Line_of_cols curline, Interval line) Break_algorithm::Break_algorithm () { pscore_l_ = 0; - linelength = 0; + linewidth_f_ = 0; } void Break_algorithm::set_pscore (Paper_score*s) { pscore_l_ = s; - linelength = s->paper_l_->linewidth_f (); - do_set_pscore (); -} - -bool -Break_algorithm::feasible (Line_of_cols curline) const -{ - if (linelength <= 0) - return true; - - for (int i=0; i < curline.size (); i++) - { - if (i && i < curline.size () -1 - && ((dynamic_cast(curline[i]))->break_penalty_i () >= Break_req::FORCE)) - return false; - } - return true; -} - -void -Break_algorithm::problem_OK () const -{ - if (pscore_l_->col_l_arr_.empty ()) - error (_("Score does not have any columns")); - OK (); -} - -void -Break_algorithm::OK () const -{ + linewidth_f_ = s->paper_l_->get_var("linewidth"); } Array @@ -133,8 +105,3 @@ Break_algorithm::solve () const return h; } -void -Break_algorithm::do_set_pscore () -{ - -}