]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/simple-spacer.hh
``slikken kreng''
[lilypond.git] / lily / include / simple-spacer.hh
1 /*   
2   simple-spacer.hh -- declare Simple_spacer
3   
4   source file of the GNU LilyPond music typesetter
5   
6   (c) 1999--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7   
8  */
9
10 #ifndef SIMPLE_SPACER_HH
11 #define SIMPLE_SPACER_HH
12
13 #include "parray.hh"
14 #include "lily-proto.hh"
15
16
17 struct Spring_description
18 {
19   Real ideal_;
20   Real hooke_;
21   bool active_b_;
22
23   Real block_force_;
24
25   Real length (Real force) const;
26   Spring_description ();
27
28   bool sane_b () const;
29 };
30
31 struct Simple_spacer
32 {
33   Array<Spring_description> springs_;
34   Link_array<Grob> spaced_cols_;
35   Link_array<Grob> loose_cols_;
36   Real force_;
37   Real indent_;
38   Real line_len_;
39   Real default_space_;
40   int active_count_;
41   bool compression_penalty_b_;
42   
43   Simple_spacer ();
44   
45   void solve (Column_x_positions *, bool) const;
46   void add_columns (Link_array<Grob>const &);
47   void my_solve_linelen ();
48   void my_solve_natural_len ();
49   Real active_springs_stiffness () const;
50   Real range_stiffness (int, int) const;
51   void add_rod (int l, int r, Real dist);
52   Real range_ideal_len (int l, int r)const;
53   Real active_blocking_force ()const;
54   Real configuration_length ()const;
55   void set_active_states ();
56   bool active_b () const;
57 };
58
59 #endif /* SIMPLE_SPACER_HH */
60