2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 1999--2015 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/>.
23 #include "lily-proto.hh"
26 class Spring : public Simple_smob<Spring>
29 static SCM equal_p (SCM, SCM);
30 static const char * const type_p_name_;
35 Real inverse_stretch_strength_;
36 Real inverse_compress_strength_;
40 void update_blocking_force ();
44 Spring (Real distance, Real min_distance);
46 Real distance () const {return distance_;}
47 Real min_distance () const {return min_distance_;}
48 Real inverse_stretch_strength () const {return inverse_stretch_strength_;}
49 Real inverse_compress_strength () const {return inverse_compress_strength_;}
50 Real blocking_force () const {return blocking_force_;}
52 Real length (Real f) const;
54 void set_distance (Real);
55 void set_min_distance (Real);
56 void ensure_min_distance (Real);
57 void set_inverse_stretch_strength (Real);
58 void set_inverse_compress_strength (Real);
59 void set_blocking_force (Real);
60 void set_default_strength ();
61 void set_default_compress_strength ();
62 void set_default_stretch_strength ();
64 void operator *= (Real);
65 bool operator > (Spring const &) const;
68 Spring merge_springs (vector<Spring> const &springs);
70 #endif /* SPRING_HH */