2 skyline-pair.cc -- implement Skyline_pair
4 source file of the GNU LilyPond music typesetter
6 (c) 2008--2009 Han-Wen Nienhuys <hanwen@lilypond.org>
10 #include "skyline-pair.hh"
12 #include "ly-smobs.icc"
14 Skyline_pair::Skyline_pair ()
15 : skylines_ (Skyline (DOWN
), Skyline (UP
))
19 Skyline_pair::Skyline_pair (vector
<Box
> const &boxes
, Real padding
, Axis a
)
20 : skylines_ (Skyline (boxes
, padding
, a
, DOWN
), Skyline (boxes
, padding
, a
, UP
))
24 Skyline_pair::Skyline_pair (Box
const &b
, Real padding
, Axis a
)
25 : skylines_ (Skyline (b
, padding
, a
, DOWN
), Skyline (b
, padding
, a
, UP
))
30 Skyline_pair::raise (Real r
)
32 skylines_
[UP
].raise (r
);
33 skylines_
[DOWN
].raise (r
);
37 Skyline_pair::shift (Real r
)
39 skylines_
[UP
].shift (r
);
40 skylines_
[DOWN
].shift (r
);
44 Skyline_pair::insert (Box
const &b
, Real padding
, Axis a
)
46 skylines_
[UP
].insert (b
, padding
, a
);
47 skylines_
[DOWN
].insert (b
, padding
, a
);
51 Skyline_pair::merge (Skyline_pair
const &other
)
53 skylines_
[UP
].merge (other
[UP
]);
54 skylines_
[DOWN
].merge (other
[DOWN
]);
58 Skyline_pair::print () const
60 skylines_
[UP
].print ();
61 skylines_
[DOWN
].print ();
65 Skyline_pair::print_points () const
67 skylines_
[UP
].print ();
68 skylines_
[DOWN
].print ();
73 Skyline_pair::is_empty () const
75 return skylines_
[UP
].is_empty ()
76 && skylines_
[DOWN
].is_empty ();
80 Skyline_pair::operator [] (Direction d
)
86 Skyline_pair::operator [] (Direction d
) const
91 IMPLEMENT_SIMPLE_SMOBS (Skyline_pair
);
92 IMPLEMENT_TYPE_P (Skyline_pair
, "ly:skyline-pair?");
93 IMPLEMENT_DEFAULT_EQUAL_P (Skyline_pair
);
96 Skyline_pair::mark_smob (SCM
)
102 Skyline_pair::print_smob (SCM s
, SCM port
, scm_print_state
*)
104 Skyline_pair
*r
= (Skyline_pair
*) SCM_CELL_WORD_1 (s
);
107 scm_puts ("#<Skyline-pair>", port
);