2 beam.hh -- part of GNU LilyPond
4 (c) 1996--1999 Han-Wen Nienhuys
10 #include "lily-proto.hh"
11 #include "directional-spanner.hh"
12 #include "stem-info.hh"
15 /** a beam connects multiple stems.
17 Beam adjusts the stems its owns to make sure that they reach the
18 beam and that point in the correct direction
22 damping: amount of beam slope damping. (int)
24 should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams
28 class Beam : public Directional_spanner {
31 The beams should be prevented to conflict with the stafflines,
32 especially at small slopes.
34 enum Quantisation { NONE, NORMAL, TRADITIONAL, TEST };
35 enum Dir_algorithm { /* DOWN=-1, UP=1, */ MAJORITY=2, MEAN, MEDIAN };
37 Link_array<Stem> stems_;
38 /// the slope of the beam in posns / point (dimension)
40 /// the slope as solved; not quantised or damped
43 /// position of leftmost end of beam
46 /** should beam pos / slope be quantised? 0: no, 1: yes, 2: traditional
49 Quantisation quantisation_;
51 /// maximum number of beams (for opening-up of beam-spacing)
54 /// vertical align distance between staffs
55 Drul_array<Real> vertical_align_drul_;
57 Array<Stem_info> sinfo_;
60 void add_stem (Stem*);
62 void set_grouping (Rhythmic_grouping def, Rhythmic_grouping current);
64 VIRTUAL_COPY_CONS(Score_element);
67 virtual Interval do_width () const;
68 Offset center () const;
69 void set_default_dir ();
71 virtual void do_pre_processing ();
72 virtual void do_post_processing ();
73 virtual void do_substitute_element_pointer (Score_element*, Score_element*);
74 virtual void do_print() const;
75 virtual void quantise_left_y (bool extend_b);
76 virtual Molecule stem_beams (Stem *here, Stem *next, Stem *prev) const;
77 virtual void calculate_slope ();
78 virtual Real check_stemlengths_f (bool set_b);
79 virtual void solve_slope ();
80 virtual void quantise_dy ();
81 virtual Molecule*do_brew_molecule_p () const;