Add FiguredBass to ChoirStaff's accepts list.
[lilypond/mpolesky.git] / lily / include / slur-scoring.hh
blob3d735e62668ed79b0ec7d8c4f3a12bc283f4bc63
1 /*
2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 2004--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
6 LilyPond is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 LilyPond is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef SLUR_SCORING_HH
21 #define SLUR_SCORING_HH
23 #include "box.hh"
24 #include "std-vector.hh"
25 #include "lily-guile.hh"
26 #include "slur-score-parameters.hh"
28 struct Extra_collision_info
30 Real idx_;
31 Box extents_;
32 Real penalty_;
33 Grob *grob_;
34 SCM type_;
36 Extra_collision_info (Grob *g, Real idx, Interval x, Interval y, Real p);
37 Extra_collision_info ();
41 struct Encompass_info
43 Real x_;
44 Real stem_;
45 Real head_;
46 Encompass_info ()
48 x_ = 0.0;
49 stem_ = 0.0;
50 head_ = 0.0;
52 Real get_point (Direction dir) const
54 Interval y;
55 y.add_point (stem_);
56 y.add_point (head_);
57 return y[dir];
61 struct Bound_info
63 Box stem_extent_;
64 Direction stem_dir_;
65 Item *bound_;
66 Grob *note_column_;
67 Grob *slur_head_;
68 Grob *staff_;
69 Grob *stem_;
70 Interval slur_head_x_extent_;
71 Real staff_space_;
73 Bound_info ()
75 stem_ = 0;
76 staff_ = 0;
77 slur_head_ = 0;
78 stem_dir_ = CENTER;
79 note_column_ = 0;
83 struct Slur_score_state
85 Spanner *slur_;
86 Grob *common_[NO_AXES];
87 bool valid_;
88 bool edge_has_beams_;
89 bool is_broken_;
90 bool has_same_beam_;
92 Real musical_dy_;
93 vector<Grob*> columns_;
94 vector<Encompass_info> encompass_infos_;
95 vector<Extra_collision_info> extra_encompass_infos_;
97 Direction dir_;
98 Slur_score_parameters parameters_;
99 Drul_array<Bound_info> extremes_;
100 Drul_array<Offset> base_attachments_;
101 vector<Slur_configuration*> configurations_;
102 Real staff_space_;
103 Real thickness_;
105 Slur_score_state ();
106 ~Slur_score_state ();
108 Bezier get_best_curve ();
109 void fill (Grob *);
110 void set_next_direction ();
112 vector<Offset> generate_avoid_offsets () const;
113 Drul_array<Bound_info> get_bound_info () const;
114 void generate_curves () const;
115 vector<Slur_configuration*> enumerate_attachments (Drul_array<Real> end_ys) const;
116 Drul_array<Offset> get_base_attachments () const;
117 Drul_array<Real> get_y_attachment_range () const;
118 Encompass_info get_encompass_info (Grob *col) const;
119 vector<Extra_collision_info> get_extra_encompass_infos () const;
120 Real move_away_from_staffline (Real y, Grob *on_staff) const;
121 int get_closest_index (SCM inspect_quants) const;
123 Grob *breakable_bound_item (Direction) const;
126 void set_slur_control_points (Grob *me);
128 #endif /* SLUR_SCORING_HH */