X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=lily%2Finclude%2Fsimple-spacer.hh;h=c050f2f8ff64f12b36f0629a109c092c7d14af88;hb=f84fa056117227739b77c1c50efc06e6ef4f32da;hp=80fd7f153d447a508468d28e046a7552c250cba8;hpb=c3f1e9e806a3d386f82439130f9593c3537ed08c;p=lilypond.git diff --git a/lily/include/simple-spacer.hh b/lily/include/simple-spacer.hh index 80fd7f153d..c050f2f8ff 100644 --- a/lily/include/simple-spacer.hh +++ b/lily/include/simple-spacer.hh @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 1999--2001 Han-Wen Nienhuys + (c) 1999--2003 Han-Wen Nienhuys */ @@ -16,11 +16,11 @@ struct Spring_description { - Real ideal_f_; - Real hooke_f_; + Real ideal_; + Real hooke_; bool active_b_; - Real block_force_f_; + Real block_force_; Real length (Real force) const; Spring_description (); @@ -28,53 +28,22 @@ struct Spring_description bool sane_b () const; }; -/** - A simple spacing constraint solver. The approach: - - Stretch the line uniformly until none of the constraints (rods) - block. It then is very wide. - - - Compress until the next constraint blocks, - - Mark the springs over the constrained part to be non-active. - - Repeat with the smaller set of non-active constraints, until all - constraints blocked, or until the line is as short as desired. - - This is much simpler, and much much faster than full scale - Constrained QP. On the other hand, a situation like this will not - be typeset as dense as possible, because - - c4 c4 c4 c4 - veryveryverylongsyllable2 veryveryverylongsyllable2 - " "4 veryveryverylongsyllable2 syllable4 - - - can be further compressed to - - - c4 c4 c4 c4 - veryveryverylongsyllable2 veryveryverylongsyllable2 - " "4 veryveryverylongsyllable2 syllable4 - - - Perhaps this is not a bad thing, because the 1st looks better anyway. */ struct Simple_spacer { Array springs_; Link_array spaced_cols_; Link_array loose_cols_; - Real force_f_; - Real indent_f_; - Real line_len_f_; - Real default_space_f_; + Real force_; + Real indent_; + Real line_len_; + Real default_space_; int active_count_; - + bool compression_penalty_b_; + Simple_spacer (); - void solve (Column_x_positions *) const; - void add_columns (Link_array); + void solve (Column_x_positions *, bool); + void add_columns (Link_arrayconst &); void my_solve_linelen (); void my_solve_natural_len (); Real active_springs_stiffness () const;