]> git.donarmstrong.com Git - lilypond.git/blob - lily/hara-kiri-vertical-group-spanner.cc
4b09a5d8a76efc183152923166c087c998099f4d
[lilypond.git] / lily / hara-kiri-vertical-group-spanner.cc
1 /*
2   hara-kiri-vertical-group-spanner.cc 
3     -- implement Hara_kiri_vertical_group_spanner
4
5   source file of the GNU LilyPond music typesetter
6
7   (c)  1998,1999 Jan Nieuwenhuizen <janneke@gnu.org>
8   Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 */
10
11 #include "hara-kiri-vertical-group-spanner.hh"
12 #include "debug.hh"
13 #include "item.hh"
14
15 Hara_kiri_group_spanner::Hara_kiri_group_spanner()
16 {
17   set_axes(Y_AXIS,Y_AXIS);
18 }
19
20 void 
21 Hara_kiri_group_spanner::add_interesting_item (Item* n)
22 {
23   add_dependency (n);
24   interesting_items_.push (n);
25 }
26
27 void 
28 Hara_kiri_group_spanner::do_post_processing ()
29 {
30   if (!interesting_items_.empty ())
31     return;
32
33   Link_array<Score_element> childs = get_children ();
34   for (int i = 0; i < childs.size (); i++)
35     {
36       Score_element* s = childs[i];
37
38       if ( line_l () != s->line_l ())
39         programming_error ("Killing other children too");
40       s->set_elt_property (transparent_scm_sym, SCM_BOOL_T);
41       s->set_empty (true, X_AXIS, Y_AXIS);
42
43     }
44   set_empty (true);
45 }
46
47 void
48 Hara_kiri_group_spanner::do_substitute_element_pointer (Score_element*o, Score_element*n)
49 {
50   Axis_group_spanner::do_substitute_element_pointer (o,n);
51   if (Item *it = dynamic_cast<Item *> (o))
52     interesting_items_.substitute (it, dynamic_cast<Item *> (n));
53 }
54
55
56 void
57 Hara_kiri_group_spanner::do_print () const
58 {
59   Axis_group_spanner::do_print ();
60 }