]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/slur-configuration.hh
992472f22a23f4c2d46472346d1c5e28c1eb0b09
[lilypond.git] / lily / include / slur-configuration.hh
1 /*
2   This file is part of LilyPond, the GNU music typesetter.
3
4   Copyright (C) 2004--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
5
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.
10
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.
15
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/>.
18 */
19
20 #ifndef SLUR_CONFIGURATION_HH
21 #define SLUR_CONFIGURATION_HH
22
23 #include "bezier.hh"
24 #include "lily-proto.hh"
25 #include "std-vector.hh"
26
27
28 enum Configuration_tag
29   {
30     SLUR_STEM = 0x01,
31     SLUR_HEAD = 0x02,
32     SLUR_FREE = 0x04,
33     SLUR_FREE_HEAD = 0x08,
34     SLUR_FREE_STEM = 0x10,
35     SLUR_STEM_TIP = 0x10,
36   };
37
38 class Slur_configuration
39 {
40   Real score_;
41   string score_card_;
42
43 public:
44   Drul_array<Offset> attachment_;
45   Bezier curve_;
46   Real height_;
47   unsigned tags_;
48   int index_;
49
50   Slur_configuration ();
51
52   Real score () const { return score_; }
53   string card () const { return score_card_; } 
54   void add_score (Real, string);
55   
56   void generate_curve (Slur_score_state const &state, Real r0, Real h_inf,
57                        vector<Offset> const &);
58   void calculate_score (Slur_score_state const &);
59 protected:
60   void score_extra_encompass (Slur_score_state const &);
61   void score_slopes (Slur_score_state const &);
62   void score_edges (Slur_score_state const &);
63   void score_encompass (Slur_score_state const &);
64 };
65
66 #endif /* SLUR_CONFIGURATION_HH */
67