2 graphical-element.hh -- declare Graphical_element
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 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 DECLARE_MY_RUNTIME_TYPEINFO;
34 This is needed, because #output# may still be
39 Axis_group_element * axis_group_l_a_[NO_AXES];
40 Interval cached_dimension_a_[NO_AXES];
41 bool cached_valid_b_a_[NO_AXES];
44 Graphical_element (Graphical_element const&);
45 virtual ~Graphical_element ();
47 void invalidate_cache (Axis);
48 Interval extent (Axis) const;
49 Interval width() const;
50 Interval height() const;
53 translate the symbol. The symbol does not have to be created yet.
55 void translate (Offset);
57 translate in one direction
60 void translate (Real, Axis);
62 Real relative_coordinate (Axis_group_element*group, Axis) const;
63 Offset absolute_offset() const;
64 Real absolute_coordinate (Axis) const;
66 Find the group-element which has both #this# and #s#
68 Axis_group_element*common_group (Graphical_element const* s, Axis a) const;
73 virtual Interval do_height () const=0;
74 virtual Interval do_width () const=0;
77 #endif // GRAPHICAL_ELEMENT_HH