]> git.donarmstrong.com Git - lilypond.git/blob - lily/rod.cc
patch::: 1.1.39.hwn1
[lilypond.git] / lily / rod.cc
1 /*   
2   rod.cc --  implement Rod, Column_rod
3   
4   source file of the GNU LilyPond music typesetter
5   
6   (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7   
8  */
9 #include "rod.hh"
10 #include "p-col.hh"
11 #include "debug.hh"
12 #include "dimensions.hh"
13 #include "single-malt-grouping-item.hh"
14
15
16 Rod::Rod ()
17 {
18   distance_f_ = 0.0;
19   item_l_drul_[LEFT] = item_l_drul_[RIGHT] =0;
20 }
21
22 void
23 Column_rod::print () const
24 {
25 #ifndef NDEBUG
26   DOUT << "Column_rod { rank = "
27        << other_l_->rank_i () << ", dist = " << distance_f_ << "}\n";   
28 #endif
29 }
30
31 Column_rod::Column_rod ()
32 {
33   distance_f_ = 0;
34   other_l_ = 0;
35 }
36   
37 int
38 Column_rod::compare (const Column_rod &r1, const Column_rod &r2)
39 {
40   return r1.other_l_->rank_i() - r2.other_l_->rank_i();
41 }
42 void
43 Rod::add_to_cols ()
44 {
45   item_l_drul_[RIGHT]->column_l ()->add_rod
46     (item_l_drul_[LEFT]->column_l (), distance_f_);
47   item_l_drul_[LEFT]->column_l ()->add_rod
48     (item_l_drul_[RIGHT]->column_l (), distance_f_);
49 }
50
51 void
52 Column_spring::print () const
53 {
54 #ifndef NDEBUG
55   DOUT << "Column_spring { rank = "
56        << other_l_->rank_i () << ", dist = " << distance_f_ << "}\n";   
57 #endif
58 }
59
60 Column_spring::Column_spring ()
61 {
62   distance_f_ = 0;
63   other_l_ = 0;
64 }
65   
66 int
67 Column_spring::compare (const Column_spring &r1, const Column_spring &r2)
68 {
69   return r1.other_l_->rank_i() - r2.other_l_->rank_i();
70 }