]> git.donarmstrong.com Git - lilypond.git/blob - lily/axis-group-element.cc
release: 1.1.1
[lilypond.git] / lily / axis-group-element.cc
1 /*
2   axis-group-element.cc -- implement Axis_group_element
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #include "axis-group-element.hh"
10 #include "graphical-axis-group.hh"
11
12 void
13 Axis_group_element::do_unlink()
14 {
15   remove_all();
16 }
17
18 void
19 Axis_group_element::do_junk_links()
20 {
21   elem_l_arr_.set_size (0);
22 }
23
24
25 Link_array<Score_element>
26 Axis_group_element::get_extra_dependencies() const
27 {
28   return elem_l_arr ();
29 }
30
31 Link_array<Score_element>
32 Axis_group_element::elem_l_arr () const
33 {  
34   /*
35     ugh. I know
36   */
37   Link_array<Score_element> r;
38   for (int i=0; i < elem_l_arr_.size (); i++)
39     r.push (dynamic_cast<Score_element*>(elem_l_arr_[i]));
40       
41   return r;
42 }
43
44 Link_array<Score_element> 
45 Axis_group_element::get_children ()
46 {
47   Link_array<Score_element> childs;
48   Link_array<Score_element> elems = elem_l_arr ();
49   for (int i=0; i < elems.size (); i++) 
50     {
51       Score_element* e = elems[i];
52       childs.push (e) ;
53       Axis_group_element * axis_group= dynamic_cast <Axis_group_element *> (e);
54       if (axis_group)
55         childs.concat (axis_group->get_children ());      
56     }
57   
58   return childs;
59 }
60
61 void
62 Axis_group_element::do_print() const
63 {
64   Graphical_axis_group::do_print();
65 }
66
67 Axis_group_element::Axis_group_element(Axis a1, Axis a2)
68   : Graphical_axis_group (a1,a2)
69 {
70   transparent_b_ = true;
71 }
72
73 Axis_group_element::Axis_group_element ()
74   : Graphical_axis_group (X_AXIS, Y_AXIS)
75 {
76   transparent_b_ = true;
77 }
78
79
80 IMPLEMENT_IS_TYPE_B2(Axis_group_element, Score_element, Graphical_axis_group);