source file of the GNU LilyPond music typesetter
- (c) 1997--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include <math.h> // tanh.
-#include "molecule.hh"
+#include "stencil.hh"
#include "directional-element-interface.hh"
#include "beaming.hh"
#include "beam.hh"
/*
TODO: should not make beams per stem, but per Y-level.
*/
-MAKE_SCHEME_CALLBACK (Beam, brew_molecule, 1);
+MAKE_SCHEME_CALLBACK (Beam, print, 1);
SCM
-Beam::brew_molecule (SCM grob)
+Beam::print (SCM grob)
{
Grob *me = unsmob_grob (grob);
position_beam (me);
Real gap_length =robust_scm2double ( me->get_grob_property ("gap"), 0.0);
- Molecule the_beam;
+ Stencil the_beam;
Real lt = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
for (int i = 0; i<= stems.size(); i++)
Real blot = me->get_paper ()->get_realvar (ly_symbol2scm ("blotdiameter"));
- Molecule whole = Lookup::beam (dydx, w, thick, blot);
- Molecule gapped;
+ Stencil whole = Lookup::beam (dydx, w, thick, blot);
+ Stencil gapped;
int gap_count = 0;
if (gh_number_p (me->get_grob_property ("gap-count")))
int k = 0;
for (int j = full_beams.size (); j--;)
{
- Molecule b (whole);
+ Stencil b (whole);
if (k++ < gap_count)
{
b.translate_axis (last_xposn - x0 + stem_offset, X_AXIS);
b.translate_axis (dydx * (last_xposn - x0) + bdy * full_beams[j], Y_AXIS);
- the_beam.add_molecule (b);
+ the_beam.add_stencil (b);
}
Real w = (i>0 && st) ? (xposn - last_xposn) : break_overshoot;
w = w/2 <? nw_f;
- Molecule half = Lookup::beam (dydx, w, thick, blot);
+ Stencil half = Lookup::beam (dydx, w, thick, blot);
for (int j = lfliebertjes.size(); j--;)
{
- Molecule b (half);
+ Stencil b (half);
b.translate_axis (last_xposn - x0, X_AXIS);
b.translate_axis (dydx * (last_xposn-x0) + bdy * lfliebertjes[j], Y_AXIS);
- the_beam.add_molecule (b);
+ the_beam.add_stencil (b);
}
for (int j = rfliebertjes.size(); j--;)
{
- Molecule b (half);
+ Stencil b (half);
b.translate_axis (xposn - x0 - w , X_AXIS);
b.translate_axis (dydx * (xposn-x0 -w) + bdy * rfliebertjes[j], Y_AXIS);
- the_beam.add_molecule (b);
+ the_beam.add_stencil (b);
}
}
String str;
SCM properties = Font_interface::font_alist_chain (me);
- Molecule tm = *unsmob_molecule (Text_item::interpret_markup
+ Stencil tm = *unsmob_stencil (Text_item::interpret_markup
(me->get_paper ()->self_scm (), properties, quant_score));
the_beam.add_at_edge (Y_AXIS, UP, tm, 5.0, 0);
}
slope esp. of the first part of a broken beam should predict
where the second part goes.
*/
-
+ me->set_grob_property ("least-squares-dy",
+ gh_double2scm (pos[RIGHT] - pos[LEFT]));
}
else
{