2 graphical-element.hh -- declare Graphical_element
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #ifndef GRAPHICAL_ELEMENT_HH
11 #define GRAPHICAL_ELEMENT_HH
14 #include "lily-proto.hh"
15 #include "interval.hh"
16 #include "virtual-methods.hh"
18 /** The 2d geometric aspects of a score-element.
20 class Graphical_element
24 Dimension_cache *dim_cache_[NO_AXES];
27 Set this if anyone points to me, or if I point to anyone.
31 char const * name () const;
33 Set empty in direction a1 and a2. If an argument is NO_AXES, it is ignored.
35 void set_empty (bool b, Axis a1 = NO_AXES, Axis a2 = NO_AXES);
36 bool empty_b (Axis a1 = NO_AXES, Axis a2 = NO_AXES);
38 Graphical_element (Graphical_element const&);
39 virtual ~Graphical_element ();
41 void invalidate_cache (Axis);
42 Interval extent (Axis) const;
47 void translate (Offset);
49 translate in one direction
52 void translate_axis (Real, Axis);
54 Real relative_coordinate (Graphical_element const* refp, Axis) const;
56 Find the group-element which has both #this# and #s#
58 Graphical_element*common_refpoint (Graphical_element const* s, Axis a) const;
59 Graphical_element*common_refpoint (Link_array<Graphical_element> elems, Axis a) const;
62 Set the parent refpoint of THIS to E
64 void set_parent (Graphical_element* e, Axis);
66 Graphical_element *parent_l (Axis a) const;
68 virtual void do_print () const;
69 virtual void print () const;
72 #endif // GRAPHICAL_ELEMENT_HH