]> git.donarmstrong.com Git - lilypond.git/blob - lily/col-info.cc
release: 1.1.59
[lilypond.git] / lily / col-info.cc
1 /*
2   col-info.cc -- implement Column_info
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #include "paper-column.hh"
10 #include "col-info.hh"
11 #include "debug.hh"
12
13 void
14 Column_info::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 Column_info::Column_info (Paper_column *col_l, Real const *fixed_C)
33 {
34   if (fixed_C)
35     fixpos_p_.set_l (fixed_C);
36   pcol_l_ = col_l;
37   width_ = pcol_l_->extent(X_AXIS);
38   if (width_.empty_b())
39     width_ = Interval(0,0);
40 }
41
42
43 Column_info::Column_info()
44 {
45   pcol_l_ =0;
46 }
47
48 bool
49 Column_info::fixed_b () const
50 {
51  return fixpos_p_.get_C();
52 }
53
54 Real
55 Column_info::fixed_position () const
56 {
57   return *fixpos_p_;
58 }
59
60 int
61 Column_info::rank_i () const
62 {
63   return pcol_l_->rank_i ();
64 }
65
66 void
67 Spacer_rod::print ()const
68 {
69   DOUT << "Other " << other_idx_ << "dist = " << distance_f_ << '\n';
70 }