2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 1999--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
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.
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.
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/>.
20 #ifndef SIMPLE_SPACER_HH
21 #define SIMPLE_SPACER_HH
23 #include "std-vector.hh"
24 #include "lily-proto.hh"
33 void solve (Real line_len, bool ragged);
34 void add_rod (int l, int r, Real dist);
35 void add_spring (Spring const &);
36 Real range_ideal_len (int l, int r) const;
37 Real range_stiffness (int l, int r, bool stretch) const;
38 Real configuration_length (Real) const;
39 vector<Real> spring_positions () const;
41 void set_force (Real force);
43 Real force_penalty (bool ragged) const;
46 DECLARE_SIMPLE_SMOBS (Simple_spacer);
50 Real compress_line ();
51 Real rod_force (int l, int r, Real dist);
53 vector<Spring> springs_;
60 /* returns a vector of dimensions breaks.size () * breaks.size () */
61 vector<Real> get_line_forces (vector<Grob *> const &columns,
66 Column_x_positions get_line_configuration (vector<Grob *> const &columns,
71 #endif /* SIMPLE_SPACER_HH */