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"
18 /** The 2d geometric aspects of a score-element. It was put in a
19 separate class, because Score_element got quite big.
22 class Graphical_element
25 /** Is this element dimensionless?.
26 This is private to guarantee correctness of the cache
31 Interval cached_dimension_a_[NO_AXES];
32 bool cached_valid_b_a_[NO_AXES];
35 void set_empty (bool);
37 bool empty_b () const;
41 Graphical_axis_group * axis_group_l_a_[NO_AXES];
44 Graphical_element (Graphical_element const&);
46 void invalidate_cache (Axis);
47 Interval extent (Axis) const;
48 Interval width() const;
49 Interval height() const;
52 translate the symbol. The symbol does not have to be created yet.
54 void translate (Offset);
56 translate in one direction
59 void translate_axis (Real, Axis);
61 Real relative_coordinate (Graphical_axis_group*group, Axis) const;
62 Offset absolute_offset() const;
63 Real absolute_coordinate (Axis) const;
65 Find the group-element which has both #this# and #s#
67 Graphical_axis_group*common_group (Graphical_element const* s, Axis a) const;
70 virtual void do_print () const;
72 virtual Interval do_height () const=0;
73 virtual Interval do_width () const=0;
76 #endif // GRAPHICAL_ELEMENT_HH