2 dimension-cache.hh -- declare Dimension_cache
4 source file of the GNU LilyPond music typesetter
6 (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #ifndef DIMENSION_CACHE_HH
11 #define DIMENSION_CACHE_HH
13 #include "interval.hh"
15 #include "lily-proto.hh"
18 class Dimension_cache;
19 typedef Interval (*Dim_cache_callback)(Dimension_cache const *);
20 typedef Real (*Offset_cache_callback)(Dimension_cache const *);
23 Adminstration of offset dimension info.
30 The offset wrt. to the center of #parent_l_#
37 Score_element *elt_l_;
38 friend class Score_element;
42 Array<Offset_cache_callback> off_callbacks_;
44 What to call to find extent. Nil means empty.
46 Dim_cache_callback callback_l_;
47 static Interval point_dimension_callback (Dimension_cache const* );
49 Real get_offset () const;
50 void set_callback (Dim_cache_callback);
51 Dimension_cache * parent_l_;
53 Score_element *element_l () const { return elt_l_; }
55 Dimension_cache(Dimension_cache const&);
60 Find the offset relative to D. If D equals THIS, then it is 0.
61 Otherwise, it recursively defd as
63 OFFSET_ + PARENT_L_->relative_coordinate (D)
65 Real relative_coordinate (Dimension_cache *d) const;
66 Dimension_cache*common_refpoint (Dimension_cache const* s) const;
67 Dimension_cache*common_refpoint (Link_array<Dimension_cache> caches) const;
68 void set_empty (bool);
69 void translate (Real);
71 bool valid_b () const { return valid_b_; }
73 Interval get_dim () const;
77 #endif /* DIMENSION_CACHE_HH */