X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Fgraphical-element.hh;h=465fe357001ac384593a6245aa98350615349e46;hb=refs%2Ftags%2Frelease%2F1.1.18;hp=b74fe14535108f73c0da083bb93f6cb37c6e4542;hpb=f56e1381aaa6edc69dfc36dcba16777fe83f3631;p=lilypond.git diff --git a/lily/include/graphical-element.hh b/lily/include/graphical-element.hh index b74fe14535..465fe35700 100644 --- a/lily/include/graphical-element.hh +++ b/lily/include/graphical-element.hh @@ -14,39 +14,29 @@ #include "lily-proto.hh" #include "interval.hh" #include "virtual-methods.hh" +#include "dimension-cache.hh" + + /** The 2d geometric aspects of a score-element. It was put in a separate class, because Score_element got quite big. - */ class Graphical_element { void init (); - /** Is this element dimensionless?. - This is private to guarantee correctness of the cache - */ - bool empty_b_; - - Offset offset_; - Interval cached_dimension_a_[NO_AXES]; - bool cached_valid_b_a_[NO_AXES]; public: + Dimension_cache dim_cache_[NO_AXES]; + char const * name () const; void set_empty (bool); - bool empty_b () const; - - - Graphical_axis_group * axis_group_l_a_[NO_AXES]; - Graphical_element (); Graphical_element (Graphical_element const&); + virtual ~Graphical_element (); void invalidate_cache (Axis); Interval extent (Axis) const; - Interval width() const; - Interval height() const; /** translate the symbol. The symbol does not have to be created yet. @@ -58,13 +48,17 @@ public: void translate_axis (Real, Axis); - Real relative_coordinate (Graphical_axis_group*group, Axis) const; + Real relative_coordinate (Dimension_cache*group, Axis) const; Offset absolute_offset() const; Real absolute_coordinate (Axis) const; /** Find the group-element which has both #this# and #s# */ - Graphical_axis_group*common_group (Graphical_element const* s, Axis a) const; + Dimension_cache*common_group (Graphical_element const* s, Axis a) const; + Dimension_cache*common_group (Link_array elems, Axis a) const; + + Graphical_element *parent_l (Axis a) const; + void unlink (); void junk_links (); virtual void do_print () const;