]> git.donarmstrong.com Git - lilypond.git/blob - lily/axis-group-element.cc
8aa8263668e3f13dfc3cb3b6442d782e13ac9db0
[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 (elem_l_arr_[i]->access_Score_element());
40   return r;
41 }
42
43 Link_array<Score_element> 
44 Axis_group_element::get_children ()
45 {
46   Link_array<Score_element> childs;
47   Link_array<Score_element> elems = elem_l_arr ();
48   for (int i=0; i < elems.size (); i++) 
49     {
50       Score_element* e = elems[i];
51       childs.push (e) ;
52       Axis_group_element * axis_group= e->access_Axis_group_element ();
53       if (axis_group)
54         childs.concat (axis_group->get_children ());      
55     }
56   
57   return childs;
58 }
59
60 void
61 Axis_group_element::do_print() const
62 {
63   Graphical_axis_group::do_print();
64 }
65
66 Axis_group_element::Axis_group_element(Axis a1, Axis a2)
67   : Graphical_axis_group (a1,a2)
68 {
69   transparent_b_ = true;
70 }
71
72 Axis_group_element::Axis_group_element ()
73   : Graphical_axis_group (X_AXIS, Y_AXIS)
74 {
75   transparent_b_ = true;
76 }
77
78 Axis_group_element*
79 Axis_group_element::access_Axis_group_element ()
80 {
81   return this;
82 }
83
84
85
86 IMPLEMENT_IS_TYPE_B2(Axis_group_element, Score_element, Graphical_axis_group);