2 dimension-cache.cc -- implement Dimension_cache
4 source file of the GNU LilyPond music typesetter
6 (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "dimension-cache.hh"
12 Dimension_cache::Dimension_cache (Dimension_cache const &d)
15 empty_b_ = d.empty_b_;
16 offset_ = d.offset_; //let's hope others will copy the refpoint appropriately.
19 Dimension_cache::Dimension_cache ()
25 Dimension_cache::init()
37 Dimension_cache::invalidate ()
40 invalidate_dependencies ();
44 Dimension_cache::invalidate_dependencies ()
46 for (int i=0; i < dependencies_l_arr_.size (); i++)
48 Dimension_cache * g = dependencies_l_arr_[i];
57 Dimension_cache::set_offset (Real x)
59 invalidate_dependencies ();
64 Dimension_cache::translate (Real x)
66 invalidate_dependencies ();
72 Dimension_cache::absolute_coordinate () const
75 for (Dimension_cache * c = parent_l_;
82 what *should* these functions *do* anyway.
85 Dimension_cache::relative_coordinate (Dimension_cache *d) const
91 for (Dimension_cache* c = parent_l_;
99 Dimension_cache::common_group (Dimension_cache const* s) const
101 Link_array<Dimension_cache const> my_groups;
102 for (Dimension_cache const *c = this;
103 c ; c = c->parent_l_)
107 Dimension_cache const *common=0;
109 for (Dimension_cache const * d = s;
112 common = my_groups.find_l (d);
114 return (Dimension_cache*)common;
120 Dimension_cache::set_empty (bool b)
131 Dimension_cache::set_dim (Interval v)
139 Dimension_cache::get_dim () const
151 if (!r.empty_b()) // float exception on DEC Alpha