expand_only option.
BUG HUNTERS/SUGGESTIONS
Bertalan Fodor
+Ed Jackson
Dave Phillips
David Bobroff
David Brandon
}
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;
}
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
DECLARE_SMOBS (Paper_system, );
Stencil stencil_;
bool is_title_;
-
public:
+ Interval staff_refpoints_;
Real penalty_;
int number_;
Real ideal_;
Real hooke_;
bool is_active_;
-
Real block_force_;
Real length (Real force) const;
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 ();
};
DECLARE_UNSMOB(Spring_smob, spring);
-struct Spring{
+struct Spring
+{
Drul_array<Item*> item_l_drul_;
Real distance_;
bool expand_only_b_;
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_);
+}
+
active_count_ ++;
}
-
- if (spring->expand_only_b_)
- {
- compression_penalty_b_ = true;
- }
-
}
for (int i=0; i < cols.size () - 1; i++)
}
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)
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);
}
*/
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);
}
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)
st.translate (o + extra);
*tail = scm_cons (st.expr (), SCM_EOL);
tail = SCM_CDRLOC(*tail);
+
}
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);
(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))