]> git.donarmstrong.com Git - lilypond.git/commitdiff
(struct Simple_spacer): remove
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 31 Aug 2004 22:39:51 +0000 (22:39 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 31 Aug 2004 22:39:51 +0000 (22:39 +0000)
expand_only option.

THANKS
lily/coherent-ligature-engraver.cc
lily/include/paper-system.hh
lily/include/simple-spacer.hh
lily/include/spring.hh
lily/paper-system.cc
lily/simple-spacer.cc
lily/spaceable-grob.cc
lily/spacing-spanner.cc
lily/system.cc
scm/page-layout.scm

diff --git a/THANKS b/THANKS
index 61b823e18bdf1201353b33ac1885df5f2ebc318a..0064bc24b7cf3987bf40be84208c7284ef659405 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -24,6 +24,7 @@ Peter Lutek
 BUG HUNTERS/SUGGESTIONS
 
 Bertalan Fodor
+Ed Jackson
 Dave Phillips
 David Bobroff
 David Brandon
index 3e7e6b45eb9443e53e0b52608fa4295f79d31120..05f9a96d3e50902f224ce9404b5a7dad61f3409c 100644 (file)
@@ -95,9 +95,9 @@
            }
          me->warning (_f ("distance=%f", distance));//debug
          Real strength = 1.0;
-         Spaceable_grob::add_spring (lc, rc, distance, strength, false);
+         Spaceable_grob::add_spring (lc, rc, distance, strength);
          if (Item *rb = r->find_prebroken_piece (LEFT))
-           Spaceable_grob::add_spring (lc, rb, distance, strength, false);
+           Spaceable_grob::add_spring (lc, rb, distance, strength);
 
          continue;
        }
index 879ed05b00b70550707956156fe077397f6aa785..63cffb3fb1a22405ec5c9f74216d778ae14a208f 100644 (file)
@@ -17,8 +17,8 @@
   A formatted "system" (A block of titling also is a Paper_system)
 
   To save memory, we don't keep around the System grobs, but put the
-  formatted content of the grob is put into a Paper_system. Page-breaking handles
-  Paper_system objects.
+  formatted content of the grob is put into a
+  Paper_system. Page-breaking handles Paper_system objects.
   
  */
 class Paper_system
@@ -26,8 +26,8 @@ class Paper_system
   DECLARE_SMOBS (Paper_system, );
   Stencil stencil_;
   bool is_title_;
-  
 public:
+  Interval staff_refpoints_;
   Real penalty_;
   int number_;
 
index 48e8dd2e34b87f1caa6e35bbe8b94ef9251a3dd0..bfd8b38b6523ba5bd4c767441b23d32ee206d15d 100644 (file)
@@ -19,7 +19,6 @@ struct Spring_description
   Real ideal_;
   Real hooke_;
   bool is_active_;
-
   Real block_force_;
 
   Real length (Real force) const;
@@ -38,18 +37,17 @@ struct Simple_spacer
   Real line_len_;
   Real default_space_;
   int active_count_;
-  bool compression_penalty_b_;
   
   Simple_spacer ();
   
   void solve (Column_x_positions *, bool);
-  void add_columns (Link_array<Grob>const &);
+  void add_columns (Link_array<Grob> const &);
   void my_solve_linelen ();
   void my_solve_natural_len ();
   Real active_springs_stiffness () const;
   Real range_stiffness (int, int) const;
   void add_rod (int l, int r, Real dist);
-  Real range_ideal_len (int l, int r)const;
+  Real range_ideal_len (int l, int r) const;
   Real is_activelocking_force ()const;
   Real configuration_length ()const;
   void set_active_states ();
index 0decf664f7c57509747bd15b52a8870c0926a517..3224d77189c7bba1ed4e5c68335562ca97c7585d 100644 (file)
@@ -27,7 +27,8 @@ public:
 };
 DECLARE_UNSMOB(Spring_smob, spring);
 
-struct Spring{
+struct Spring
+{
   Drul_array<Item*> item_l_drul_;
   Real distance_;
   bool expand_only_b_;
index f51d2cbd7e502165d9e641aa9bc2b85db6166b89..885b865cab169c9ded49f77ff95a8b775297276e 100644 (file)
@@ -127,3 +127,14 @@ LY_DEFINE (ly_paper_system_stencil, "ly:paper-system-stencil",
   return ps->to_stencil ().smobbed_copy ();
 }
 
+
+
+LY_DEFINE (ly_paper_system_staff_extent, "ly:paper-system-staff-extents",
+          1, 0, 0, (SCM system),
+          "Return the top and bottom staff refpoint.")
+{
+  Paper_system *ps = unsmob_paper_system (system);
+  SCM_ASSERT_TYPE (ps, system, SCM_ARG1, __FUNCTION__, "paper-system");
+  return ly_interval2scm (ps->staff_refpoints_);
+}
+
index 8aab99bc4fa19410f4cd280b988055f8baa81fc2..f8c1f94b646079bbf9c7cb48c589127768b8c886 100644 (file)
@@ -274,12 +274,6 @@ Simple_spacer::add_columns (Link_array<Grob> const &icols)
       
          active_count_ ++;
        }
-
-      if (spring->expand_only_b_)
-       {
-         compression_penalty_b_ = true;
-       }
-      
     }
   
   for (int i=0; i < cols.size () - 1; i++)
index 5477f624ade6ab2a732bff15b9484c1339e5aca5..a25f2973dbba8def6e80a0aa85f5d7634470724e 100644 (file)
@@ -47,7 +47,7 @@ Spaceable_grob::add_rod (Grob *me , Grob * p, Real d)
 }
 
 void
-Spaceable_grob::add_spring (Grob*me, Grob * p, Real d, Real strength, bool expand_only)
+Spaceable_grob::add_spring (Grob*me, Grob * p, Real d, Real strength)
 {
   //  printf ("dist %lf, str %lf\n", d, strength); 
   if (d <= 0.0 || strength <= 0.0)
index fdc5bacad4a0c78c87c63f6b75f6d370c8a5f7b6..85b7c3dbaf716374c3b526cc7c70a67ab5fcba58 100644 (file)
@@ -654,9 +654,7 @@ Spacing_spanner::musical_column_spacing (Grob *me, Item * lc, Item *rc, Real inc
       distance = compound_note_space;
     }
 
-  //  Spaceable_grob::add_spring (lc, rc, distance, strength, expand_only);
-
-  Spaceable_grob::add_spring (lc, rc, distance, strength, false);  
+  Spaceable_grob::add_spring (lc, rc, distance, strength);  
 }
 
 
@@ -803,7 +801,7 @@ Spacing_spanner::breakable_column_spacing (Grob*me, Item* l, Item *r,Moment shor
    */
   Real strength = 1 / (compound_space - compound_fixed);
   Real distance = compound_space;
-  Spaceable_grob::add_spring (l, r, distance, strength, false);
+  Spaceable_grob::add_spring (l, r, distance, strength);
 }
 
 
index ff7d30c43fbadf2b80250a68589f1466efdcce1b..6f57b2db616251cadcf8045dba8c812b8a462438 100644 (file)
@@ -335,13 +335,20 @@ System::get_line ()
 
      Start with layer 3, since scm_cons prepends to list.  */
   SCM all = get_property ("all-elements");
-
+  Interval staff_refpoints;
   for (int i = LAYER_COUNT; i--;)
     for (SCM s = all; ly_c_pair_p (s); s = ly_cdr (s))
       {
        Grob *g = unsmob_grob (ly_car (s));
        Stencil *stil = g->get_stencil ();
 
+       if (i == 0
+           && Axis_group_interface::has_interface (g)
+           && dynamic_cast<Spanner*> (g))
+         {
+           staff_refpoints.add_point (g->relative_coordinate (this, Y_AXIS));
+         }
+  
        /* Skip empty stencils and grobs that are not in this layer.  */
        if (!stil
            || robust_scm2int (g->get_property ("layer"), 1) != i)
@@ -361,6 +368,7 @@ System::get_line ()
        st.translate (o + extra);
        *tail = scm_cons (st.expr (), SCM_EOL);
        tail = SCM_CDRLOC(*tail);
+
        
       }
 
@@ -374,7 +382,7 @@ System::get_line ()
                                 exprs));
   
   Paper_system *pl = new Paper_system (sys_stencil, false);
-
+  pl->staff_refpoints_ = staff_refpoints;
   Item * break_point =this->get_bound(LEFT);
   pl->penalty_ =
     robust_scm2double (break_point->get_property ("page-penalty"), 0.0);
index 8672062a3d909ece9e9ffba56ff04046c1ac6f59..1b2f7db5f08cfa8b6d30eea438996934b03c1fab 100644 (file)
@@ -279,7 +279,7 @@ CURRENT-BEST is the best result sofar, or #f."
                              (node-penalty (car best-paths))))
            (page-height (page-height this-page-num last?))
            (space-used (cumulative-height current-lines))
-           (this-page-penalty (height-penalty  page-height space-used))
+           (this-page-penalty (height-penalty page-height space-used))
            (user-penalty (ly:paper-system-break-penalty (car current-lines)))
            (total-penalty (combine-penalties
                            user-penalty this-page-penalty prev-penalty))