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];
36 virtual Score_element* access_Score_element () { return 0; }
37 void set_empty (bool);
39 bool empty_b () const;
41 DECLARE_MY_RUNTIME_TYPEINFO;
43 Graphical_axis_group * axis_group_l_a_[NO_AXES];
46 Graphical_element (Graphical_element const&);
48 void invalidate_cache (Axis);
49 Interval extent (Axis) const;
50 Interval width() const;
51 Interval height() const;
54 translate the symbol. The symbol does not have to be created yet.
56 void translate (Offset);
58 translate in one direction
61 void translate_axis (Real, Axis);
63 Real relative_coordinate (Graphical_axis_group*group, Axis) const;
64 Offset absolute_offset() const;
65 Real absolute_coordinate (Axis) const;
67 Find the group-element which has both #this# and #s#
69 Graphical_axis_group*common_group (Graphical_element const* s, Axis a) const;
72 virtual void do_print () const;
74 virtual Interval do_height () const=0;
75 virtual Interval do_width () const=0;
78 #endif // GRAPHICAL_ELEMENT_HH