]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/spring.hh
use springs instead of fixed/distance pairs
[lilypond.git] / lily / include / spring.hh
1 /*
2   spring.hh -- declare Spring
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1999--2007 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 class Spring
16 {
17   Real distance_;
18   Real min_distance_;
19
20   Real inverse_stretch_strength_;
21   Real inverse_compress_strength_;
22
23   DECLARE_SIMPLE_SMOBS (Spring);
24 public:
25   Spring ();
26   Spring (Real distance, Real min_distance);
27
28   Real distance () const {return distance_;}
29   Real min_distance () const {return min_distance_;}
30   Real inverse_stretch_strength () const {return inverse_stretch_strength_;}
31   Real inverse_compress_strength () const {return inverse_compress_strength_;}
32
33   void set_distance (Real);
34   void set_min_distance (Real);
35   void set_inverse_stretch_strength (Real);
36   void set_inverse_compress_strength (Real);
37
38   void operator*= (Real);
39   Grob *other_;
40 };
41 DECLARE_UNSMOB (Spring, spring);
42
43 Spring merge_springs (vector<Spring> const &springs);
44
45 #endif /* SPRING_HH */
46