2 simple-spacer.hh -- declare Simple_spacer
4 source file of the GNU LilyPond music typesetter
6 (c) 1999--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
9 #ifndef SIMPLE_SPACER_HH
10 #define SIMPLE_SPACER_HH
12 #include "std-vector.hh"
13 #include "lily-proto.hh"
16 struct Spring_description
22 Real length (Real force) const;
23 Spring_description ();
25 bool is_sane () const;
27 bool operator> (const Spring_description &s) const
29 return block_force_ > s.block_force_;
32 bool operator< (const Spring_description &s) const
34 return block_force_ < s.block_force_;
43 void solve (Real line_len, bool ragged);
44 void add_rod (int l, int r, Real dist);
45 void add_spring (Real, Real);
46 Real range_ideal_len (int l, int r) const;
47 Real range_stiffness (int l, int r) const;
48 Real configuration_length () const;
49 vector<Real> spring_positions () const;
54 DECLARE_SIMPLE_SMOBS (Simple_spacer,);
58 Real compress_line ();
59 Real rod_force (int l, int r, Real dist);
61 vector<Spring_description> springs_;
68 /* returns a vector of dimensions breaks.size () * breaks.size () */
69 vector<Real> get_line_forces (vector<Grob*> const &columns,
75 Column_x_positions get_line_configuration (vector<Grob*> const &columns,
80 #endif /* SIMPLE_SPACER_HH */