]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/simple-spacer.cc
patch::: 1.4.0.jcn4
[lilypond.git] / lily / simple-spacer.cc
index 36971396df3c7229b3a83ae974a157992818ff9a..edf841a7737b9cc4e49d67ba582eecfeb10fde43 100644 (file)
@@ -3,7 +3,7 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1999--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1999--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 
   TODO:
   - add support for different stretch/shrink constants?
@@ -141,7 +141,7 @@ Simple_spacer::my_solve_linelen ()
 
       if (conf < line_len_f_)
        {
-         force_f_ +=  (line_len_f_  - conf) * active_springs_stiffness ();
+         force_f_ += (line_len_f_  - conf) * active_springs_stiffness ();
          break;
        }
       else
@@ -165,16 +165,16 @@ Simple_spacer::my_solve_natural_len ()
 }
 
 void
-Simple_spacer::add_columns (Link_array<Score_element> cols)
+Simple_spacer::add_columns (Link_array<Grob> cols)
 {
   for (int i=0; i < cols.size () - 1; i++)
     {
       SCM spring_params = SCM_UNDEFINED;
-      for (SCM s = Spaceable_element::get_ideal_distances (cols[i]);
+      for (SCM s = Spaceable_grob::get_ideal_distances (cols[i]);
           spring_params == SCM_UNDEFINED && gh_pair_p (s);
           s = gh_cdr (s))
        {
-         Score_element *other = unsmob_element (gh_caar (s));
+         Grob *other = unsmob_grob (gh_caar (s));
          if (other != cols[i+1])
            continue;
 
@@ -189,6 +189,7 @@ Simple_spacer::add_columns (Link_array<Score_element> cols)
        }
       else
        {
+         programming_error ("No spring between adjacent columns");
          desc.hooke_f_ = 1.0;
          desc.ideal_f_ = default_space_f_;
        }
@@ -201,15 +202,15 @@ Simple_spacer::add_columns (Link_array<Score_element> cols)
        }
       
       desc.block_force_f_ = - desc.hooke_f_ * desc.ideal_f_; // block at distance 0
-      springs_.push  (desc);
+      springs_.push (desc);
     }
   
   for (int i=0; i < cols.size () - 1; i++)
     {
-      for (SCM s = Spaceable_element::get_minimum_distances (cols[i]);
+      for (SCM s = Spaceable_grob::get_minimum_distances (cols[i]);
           gh_pair_p (s); s = gh_cdr (s))
        {
-         Score_element * other = unsmob_element (gh_caar (s));
+         Grob * other = unsmob_grob (gh_caar (s));
          int oi = cols.find_i (other);
          if (oi >= 0)
            {
@@ -238,12 +239,12 @@ Simple_spacer::solve (Column_x_positions *positions) const
       positions->config_.push (positions->config_.top () + springs_[i].length (force_f_));
     }
 
-  positions->satisfies_constraints_b_ =  (line_len_f_ < 0) || active_b ();
+  positions->satisfies_constraints_b_ = (line_len_f_ < 0) || active_b ();
 }
 
 
 
-Spring_description::Spring_description)
+Spring_description::Spring_description ()
 {
   ideal_f_ =0.0;
   hooke_f_ =0.0;