2 graphical-element.hh -- declare Graphical_element
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1998 Han-Wen Nienhuys <hanwen@stack.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_elem got quite big.
22 class Graphical_element
25 /** Is this element dimensionless?.
26 This is private to guarantee correctness of the cache
31 void set_empty (bool);
32 bool empty_b () const;
34 DECLARE_MY_RUNTIME_TYPEINFO;
36 This is needed, because #output# may still be
41 Axis_group_element * axis_group_l_a_[NO_AXES];
42 Interval cached_dimension_a_[NO_AXES];
43 bool cached_valid_b_a_[NO_AXES];
46 Graphical_element (Graphical_element const&);
47 virtual ~Graphical_element ();
49 void invalidate_cache (Axis);
50 Interval extent (Axis) const;
51 Interval width() const;
52 Interval height() const;
55 translate the symbol. The symbol does not have to be created yet.
57 void translate (Offset);
59 translate in one direction
62 void translate_axis (Real, Axis);
64 Real relative_coordinate (Axis_group_element*group, Axis) const;
65 Offset absolute_offset() const;
66 Real absolute_coordinate (Axis) const;
68 Find the group-element which has both #this# and #s#
70 Axis_group_element*common_group (Graphical_element const* s, Axis a) const;
75 virtual Interval do_height () const=0;
76 virtual Interval do_width () const=0;
79 #endif // GRAPHICAL_ELEMENT_HH