]> git.donarmstrong.com Git - lilypond.git/blob - lily/dots.cc
release: 1.0.1
[lilypond.git] / lily / dots.cc
1 /*
2   dots.cc -- implement Dots
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #include "dots.hh"
10 #include "molecule.hh"
11 #include "paper-def.hh"
12 #include "lookup.hh"
13
14 Dots::Dots ()
15 {
16   no_dots_i_ =0;
17   position_i_ =0;
18 }
19
20 void
21 Dots::do_post_processing ()
22 {
23   if (!(position_i_ % 2))
24     position_i_ ++;
25   if (!no_dots_i_)
26     {
27       transparent_b_ = true;
28       set_empty (true);
29     }
30 }
31
32 Molecule* 
33 Dots::brew_molecule_p () const
34 {
35   Molecule *out = new Molecule;
36   Atom fill = lookup_l ()->fill (Box (Interval (0,0),
37                                                Interval (0,0)));
38   out->add_atom (fill);
39
40   Atom d = lookup_l ()->dots ();
41
42   Real dw = d.dim_[X_AXIS].length ();
43   d.translate_axis (-dw, X_AXIS);
44   for (int i=no_dots_i_; i--; )
45     {
46       d.translate_axis (2*dw,X_AXIS);
47       out->add_atom (d);
48     }
49   Real inter_f = paper ()->internote_f ();
50   out->translate_axis (inter_f * position_i_, Y_AXIS);
51   return out;
52 }
53
54 IMPLEMENT_IS_TYPE_B1(Dots, Item);