]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/tie-formatting-problem.hh
* input/regression/tie-dot.ly: new file.
[lilypond.git] / lily / include / tie-formatting-problem.hh
1 /*
2   tie-formatting-problem.hh -- declare
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
7
8 */
9
10 #ifndef TIE_FORMATTING_PROBLEM_HH
11 #define TIE_FORMATTING_PROBLEM_HH
12
13 #include "drul-array.hh"
14 #include "parray.hh"
15 #include "skyline.hh"
16 #include "lily-proto.hh"
17
18 #include <map>
19 #include <set>
20
21 struct Tie_details
22 {
23   Real height_limit_;
24   Real ratio_;
25   Real staff_space_;
26   Real x_gap_;
27   Real between_length_limit_;
28   Grob *staff_symbol_referencer_;
29   
30   Tie_details ();
31   void from_grob (Grob *);
32 };
33
34
35 typedef map< pair<int, int>, Tie_configuration *> Tie_configuration_map;
36
37 class Tie_formatting_problem
38 {
39   Drul_array< Array<Skyline_entry> > chord_outlines_;
40   set<int> dot_positions_;
41   Interval dot_x_;
42   
43   Tie_configuration_map possibilities_;
44
45   Tie_configuration *get_configuration (int position, Direction dir);
46   Tie_configuration *generate_configuration (int position, Direction dir);
47   Real score_configuration (Tie_configuration const&);
48   Real score_aptitude (Tie_configuration const&, int);
49   
50   Grob *x_refpoint_;
51
52   
53 public:
54   Tie_details details_;
55
56 public:
57   Tie_formatting_problem ();
58   ~Tie_formatting_problem ();
59
60   Tie_configuration find_optimal_tie_configuration (int p, Direction d);
61   void from_ties (Link_array<Grob> const &ties);
62   void from_tie (Grob *tie);
63   void from_lv_ties (Link_array<Grob> const &);
64   void set_chord_outline (Link_array<Item>, Direction);
65
66   Interval get_attachment (Real) const;
67   Grob *common_x_refpoint () const;
68 };
69
70 #endif /* TIE_FORMATTING_PROBLEM_HH */