source file of the GNU LilyPond music typesetter
- (c) 1997--1998 Han-Wen Nienhuys <hanwen@stack.nl>
+ (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "axis-group-element.hh"
+#include "graphical-axis-group.hh"
void
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<Score_elem>
+Link_array<Score_element>
Axis_group_element::get_extra_dependencies() const
{
return elem_l_arr ();
}
-Link_array<Score_elem>
+Link_array<Score_element>
Axis_group_element::elem_l_arr () const
{
/*
ugh. I know
- */
- Link_array<Score_elem> 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<Score_element> r;
+ for (int i=0; i < elem_l_arr_.size (); i++)
+ r.push (elem_l_arr_[i]->access_Score_element());
return r;
}
+Link_array<Score_element>
+Axis_group_element::get_children ()
+{
+ Link_array<Score_element> childs;
+ Link_array<Score_element> 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);
source file of the GNU LilyPond music typesetter
- (c) 1997--1998 Han-Wen Nienhuys <hanwen@stack.nl>
+ (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#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
*/
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;
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;