]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/tie-configuration.hh
d65604c1dc195f34264eeceebca5229db629fbe9
[lilypond.git] / lily / include / tie-configuration.hh
1 /*
2   tie-configuration.hh -- declare Tie_configuration
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 2005--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
7
8 */
9
10 #ifndef TIE_CONFIGURATION_HH
11 #define TIE_CONFIGURATION_HH
12
13 #include "direction.hh"
14 #include "interval.hh"
15 #include "std-vector.hh"
16 #include "main.hh" // DEBUG_SLUR_SCORING
17
18 class Tie_configuration
19 {
20 #if DEBUG_SLUR_SCORING
21   string score_card_;
22 #endif
23   Real score_;
24   bool scored_;
25   friend class Tie_formatting_problem;
26
27 public:
28   Real score () const { return score_; }
29   string card () const { return score_card_; }
30
31   int position_;
32   Direction dir_;
33   Real delta_y_;
34   Drul_array<int> column_ranks_;
35   
36   /* computed. */
37   Interval attachment_x_;
38
39   void add_score (Real, string);
40   Tie_configuration ();
41   void center_tie_vertically (Tie_details const &);
42   Bezier get_transformed_bezier (Tie_details const &) const;
43   Bezier get_untransformed_bezier (Tie_details const &) const;
44   Real height (Tie_details const&) const;
45   int column_span_length () const;
46   
47   static int compare (Tie_configuration const &a,
48                       Tie_configuration const &b);
49   static Real distance (Tie_configuration const &a,
50                        Tie_configuration const &b);
51 };
52
53 INSTANTIATE_COMPARE (Tie_configuration, Tie_configuration::compare);
54
55 class Ties_configuration : public vector<Tie_configuration>
56 {
57   Real score_;
58   string score_card_;
59   bool scored_;
60   vector<string> tie_score_cards_;
61
62   friend class Tie_formatting_problem;
63 public:
64   Ties_configuration ();
65   void add_score (Real amount, string description);
66   void add_tie_score (Real amount, int i, string description);
67   Real score () const;
68   void reset_score ();
69   string card () const; 
70   string tie_card (int i) const { return tie_score_cards_[i]; }
71   string complete_tie_card (vsize i) const;
72   string complete_score_card () const; 
73 };
74
75 #endif /* TIE_CONFIGURATION_HH */
76
77
78