]> git.donarmstrong.com Git - lilypond.git/blob - lily/col-info.cc
release: 0.1.57
[lilypond.git] / lily / col-info.cc
1 /*
2   col-info.cc -- implement Colinfo
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9 #include "p-col.hh"
10 #include "col-info.hh"
11 #include "debug.hh"
12
13 void
14 Colinfo::print() const
15 {
16 #ifndef NPRINT
17   DOUT << "column { ";
18   if (fixed_b())
19     DOUT << "fixed at " << fixed_position()<<", ";
20   assert (pcol_l_);
21   DOUT << width_.str();
22   Direction d = LEFT;
23   do {
24     for (int i=0; i < rods_[d].size (); i++)
25       rods_[d][i].print ();
26   } while (flip (&d) != LEFT);
27   
28   DOUT <<"}\n";
29 #endif
30 }
31
32 Colinfo::Colinfo (Paper_column *col_l, Real const *fixed_C)
33 {
34   if (fixed_C)
35     fixpos_p_.set_l (fixed_C);
36   ugh_b_ = false;
37   pcol_l_ = col_l;
38   width_ = pcol_l_->width();
39   if (width_.empty_b())
40     width_ = Interval(0,0);
41 }
42
43
44 Colinfo::Colinfo()
45 {
46   ugh_b_ = false;
47   pcol_l_ =0;
48 }
49
50 bool
51 Colinfo::fixed_b () const
52 {
53  return fixpos_p_.get_C();
54 }
55
56 Real
57 Colinfo::fixed_position () const
58 {
59   return *fixpos_p_;
60 }
61
62 int
63 Colinfo::rank_i () const
64 {
65   return pcol_l_->rank_i ();
66 }
67
68 void
69 Spacer_rod::print ()const
70 {
71   DOUT << "Other " << other_idx_ << "dist = " << distance_f_ << '\n';
72 }