2 graphical-element.hh -- declare Graphical_element
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1998 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"
17 #include "dimension-cache.hh"
21 /** The 2d geometric aspects of a score-element. It was put in a
22 separate class, because Score_element got quite big.
24 class Graphical_element
28 Dimension_cache dim_cache_[NO_AXES];
30 char const * name () const;
31 void set_empty (bool);
32 bool empty_b () const;
35 Graphical_element (Graphical_element const&);
36 virtual ~Graphical_element ();
38 void invalidate_cache (Axis);
39 Interval extent (Axis) const;
42 translate the symbol. The symbol does not have to be created yet.
44 void translate (Offset);
46 translate in one direction
49 void translate_axis (Real, Axis);
51 Real relative_coordinate (Dimension_cache*group, Axis) const;
52 Offset absolute_offset() const;
53 Real absolute_coordinate (Axis) const;
55 Find the group-element which has both #this# and #s#
57 Dimension_cache*common_group (Graphical_element const* s, Axis a) const;
58 Dimension_cache*common_group (Link_array<Graphical_element> elems, Axis a) const;
60 Graphical_element *parent_l (Axis a) const;
64 virtual void do_print () const;
66 virtual Interval do_height () const=0;
67 virtual Interval do_width () const=0;
70 #endif // GRAPHICAL_ELEMENT_HH