lilypond-0.1.27
[lilypond.git] / lily / dots.cc
blob8bba43afcb4c7a9872c4038238484b572eb72e31
1 /*
2 dots.cc -- implement Dots
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
9 #include "dots.hh"
10 #include "molecule.hh"
11 #include "paper-def.hh"
12 #include "lookup.hh"
14 Dots::Dots ()
16 no_dots_i_ =0;
17 position_i_ =0;
20 void
21 Dots::do_post_processing ()
23 if (!(position_i_ % 2))
24 position_i_ ++;
25 if (!no_dots_i_)
27 transparent_b_ = true;
28 set_empty(true);
32 Molecule*
33 Dots::brew_molecule_p () const
35 Molecule *out = new Molecule;
36 Atom fill = paper()->lookup_l ()->fill (Box(Interval(0,0),Interval(0,0)));
37 out->add(fill);
39 Atom d = paper ()->lookup_l ()->dots ();
41 Real dw = d.dim_[X_AXIS].length();
42 d.translate_axis(-dw,X_AXIS);
43 for (int i=no_dots_i_; i--; )
45 d.translate_axis(2*dw,X_AXIS);
46 out->add (d);
48 Real inter_f = paper ()->internote_f ();
49 out->translate_axis (inter_f * position_i_, Y_AXIS);
50 return out;
53 IMPLEMENT_IS_TYPE_B1(Dots, Item);