2 page-turn-page-breaking.hh -- break lines and pages optimally
3 for a whole Paper_book such that page turns can only occur
6 source file of the GNU LilyPond music typesetter
8 (c) 2006 Joe Neeman <joeneeman@gmail.com>
11 #ifndef PAGE_TURN_PAGE_BREAKING_HH
12 #define PAGE_TURN_PAGE_BREAKING_HH
14 #include "constrained-breaking.hh"
15 #include "page-breaking.hh"
16 #include "lily-guile.hh"
19 A dynamic programming solution to breaking pages
21 class Page_turn_page_breaking: public Page_breaking
26 Page_turn_page_breaking (Paper_book *pb);
27 virtual ~Page_turn_page_breaking ();
33 int first_page_number_;
42 /* true if every score here is too widely spaced */
46 vsize break_pos_; /* index into breaks_ */
48 vector<vsize> div_; /* our division of systems between scores on this page */
49 vector<vsize> system_count_; /* systems per page */
53 prev_ = break_pos_ = VPOS;
54 penalty_ = force_ = 0;
55 line_penalty_ = line_force_ = 0;
56 demerits_ = infinity_f;
57 first_page_number_ = 0;
58 too_many_lines_ = false;
62 std::vector<Break_node> state_;
64 Break_node put_systems_on_pages (vsize start,
66 vector<Line_details> const &lines,
67 vector<vsize> const &system_div,
70 SCM make_lines (vector<Break_node> *breaks);
71 SCM make_pages (vector<Break_node> const &breaks, SCM systems);
73 Real calc_demerits (Break_node const &me);
74 void calc_subproblem (vsize i);
76 #endif /* PAGE_TURN_PAGE_BREAKING_HH */