lilypond-1.3.28
[lilypond.git] / lily / col-info.cc
blob2ebfd15d4f06ab5313a04a9bb18c25efe54bce7e
1 /*
2 col-info.cc -- implement Column_info
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
9 #include "paper-column.hh"
10 #include "col-info.hh"
11 #include "debug.hh"
13 void
14 Column_info::print() const
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);
28 DOUT <<"}\n";
29 #endif
32 Column_info::Column_info (Paper_column *col_l, Real const *fixed_C)
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);
43 Column_info::Column_info()
45 pcol_l_ =0;
48 bool
49 Column_info::fixed_b () const
51 return fixpos_p_.get_C();
54 Real
55 Column_info::fixed_position () const
57 return *fixpos_p_;
60 int
61 Column_info::rank_i () const
63 return pcol_l_->rank_i ();
66 void
67 Spacer_rod::print ()const
69 DOUT << "Other " << other_idx_ << "dist = " << distance_f_ << '\n';