]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/spring.hh
Merge branch 'jneeman' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond into jneeman
[lilypond.git] / lily / include / spring.hh
1 /*
2   spring.hh -- declare Spring, Column_spring
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1999--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #ifndef SPRING_HH
10 #define SPRING_HH
11
12 #include "lily-proto.hh"
13 #include "smobs.hh"
14
15 struct Spring_smob
16 {
17   Grob *other_;
18   Real distance_;
19   bool expand_only_b_;
20   Real inverse_strength_;
21
22   DECLARE_SIMPLE_SMOBS (Spring_smob);
23 public:
24   Spring_smob ();
25 };
26 DECLARE_UNSMOB (Spring_smob, spring);
27
28 struct Spring
29 {
30   Drul_array<Item *> item_drul_;
31   Real distance_;
32   bool expand_only_b_;
33
34   /*
35     TODO: make 2 strengths: one for stretching, and one for shrinking.
36   */
37   Real inverse_strength_;
38   void add_to_cols ();
39   void set_to_cols ();
40   Spring ();
41 };
42
43 #endif /* SPRING_HH */
44