From: fred Date: Sun, 24 Mar 2002 20:12:31 +0000 (+0000) Subject: lilypond-1.0.1 X-Git-Tag: release/1.5.59~3055 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=9d95ad39741141065405c836a79452790589047e;p=lilypond.git lilypond-1.0.1 --- diff --git a/lily/axis-group-element.cc b/lily/axis-group-element.cc index b4061af7f5..8aa8263668 100644 --- a/lily/axis-group-element.cc +++ b/lily/axis-group-element.cc @@ -3,10 +3,11 @@ source file of the GNU LilyPond music typesetter - (c) 1997--1998 Han-Wen Nienhuys + (c) 1997--1998 Han-Wen Nienhuys */ #include "axis-group-element.hh" +#include "graphical-axis-group.hh" void Axis_group_element::do_unlink() @@ -17,45 +18,69 @@ Axis_group_element::do_unlink() void Axis_group_element::do_junk_links() { - axis_admin_.elem_l_arr_.set_size (0); + elem_l_arr_.set_size (0); } -bool -Axis_group_element::contains_b (Graphical_element const*e) const -{ - return axis_admin_.contains_b (e); -} - -Link_array +Link_array Axis_group_element::get_extra_dependencies() const { return elem_l_arr (); } -Link_array +Link_array Axis_group_element::elem_l_arr () const { /* ugh. I know - */ - Link_array r; - for (int i=0; i < axis_admin_.elem_l_arr_.size (); i++) - r.push ((Score_elem*)axis_admin_.elem_l_arr_[i]); + */ + Link_array r; + for (int i=0; i < elem_l_arr_.size (); i++) + r.push (elem_l_arr_[i]->access_Score_element()); return r; } +Link_array +Axis_group_element::get_children () +{ + Link_array childs; + Link_array elems = elem_l_arr (); + for (int i=0; i < elems.size (); i++) + { + Score_element* e = elems[i]; + childs.push (e) ; + Axis_group_element * axis_group= e->access_Axis_group_element (); + if (axis_group) + childs.concat (axis_group->get_children ()); + } + + return childs; +} + void Axis_group_element::do_print() const { - axis_admin_.print(); + Graphical_axis_group::do_print(); } +Axis_group_element::Axis_group_element(Axis a1, Axis a2) + : Graphical_axis_group (a1,a2) +{ + transparent_b_ = true; +} -Axis_group_element::Axis_group_element() +Axis_group_element::Axis_group_element () + : Graphical_axis_group (X_AXIS, Y_AXIS) { transparent_b_ = true; } +Axis_group_element* +Axis_group_element::access_Axis_group_element () +{ + return this; +} + + -IMPLEMENT_IS_TYPE_B1(Axis_group_element, Score_elem); +IMPLEMENT_IS_TYPE_B2(Axis_group_element, Score_element, Graphical_axis_group); diff --git a/lily/include/graphical-element.hh b/lily/include/graphical-element.hh index 6dce57708b..3a57588a7d 100644 --- a/lily/include/graphical-element.hh +++ b/lily/include/graphical-element.hh @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 1997--1998 Han-Wen Nienhuys + (c) 1997--1998 Han-Wen Nienhuys */ @@ -16,7 +16,7 @@ #include "virtual-methods.hh" /** The 2d geometric aspects of a score-element. It was put in a - separate class, because Score_elem got quite big. + separate class, because Score_element got quite big. */ class Graphical_element @@ -27,24 +27,23 @@ class Graphical_element */ bool empty_b_; + Offset offset_; + Interval cached_dimension_a_[NO_AXES]; + bool cached_valid_b_a_[NO_AXES]; public: + + // suck me plenty + virtual Score_element* access_Score_element () { return 0; } void set_empty (bool); + bool empty_b () const; DECLARE_MY_RUNTIME_TYPEINFO; - /** - This is needed, because #output# may still be - NULL. - */ - Offset offset_; - Axis_group_element * axis_group_l_a_[NO_AXES]; - Interval cached_dimension_a_[NO_AXES]; - bool cached_valid_b_a_[NO_AXES]; + Graphical_axis_group * axis_group_l_a_[NO_AXES]; Graphical_element (); Graphical_element (Graphical_element const&); - virtual ~Graphical_element (); void invalidate_cache (Axis); Interval extent (Axis) const; @@ -61,16 +60,16 @@ public: void translate_axis (Real, Axis); - Real relative_coordinate (Axis_group_element*group, Axis) const; + Real relative_coordinate (Graphical_axis_group*group, Axis) const; Offset absolute_offset() const; Real absolute_coordinate (Axis) const; /** Find the group-element which has both #this# and #s# */ - Axis_group_element*common_group (Graphical_element const* s, Axis a) const; + Graphical_axis_group*common_group (Graphical_element const* s, Axis a) const; void unlink (); void junk_links (); - void print () const; + virtual void do_print () const; protected: virtual Interval do_height () const=0; virtual Interval do_width () const=0;