-Axis
-Dimension_cache::axis () const
-{
- if (elt_l_-> dim_cache_[X_AXIS] == this)
- return X_AXIS;
- else
- return Y_AXIS;
-}
-
-Real
-Dimension_cache::get_offset () const
-{
- Dimension_cache *me = (Dimension_cache*) this;
- while (off_callbacks_.size ())
- {
- Offset_cache_callback c = me->off_callbacks_[0];
- me->off_callbacks_.del (0);
- Real r = (*c) (me);
- if (isinf (r) || isnan (r))
- {
- r = 0.0;
- programming_error ("Infinity or NaN encountered");
- }
- me->basic_offset_ +=r;
- }
- return basic_offset_ + extra_offset_;
-}
-
-Dimension_cache *
-Dimension_cache::common_refpoint (Dimension_cache const* s) const
-{
- /*
- I don't like the quadratic aspect of this code. Maybe this should
- be rewritten some time, but the largest chain of parents might be
- 10 high or so, so it shouldn't be a real issue. */
- for (Dimension_cache const *c = this; c; c = c->parent_l_)
- for (Dimension_cache const * d = s; d; d = d->parent_l_)
- if (d == c)
- return (Dimension_cache*)d;
-
- return 0;
-}
-
-Interval
-Dimension_cache::point_dimension_callback (Dimension_cache const* )
-{
- return Interval (0,0);
-}
-
-Interval
-Dimension_cache::get_dim () const
-{
- Interval r;
- Dimension_cache *nc = ((Dimension_cache*)this);
- if (!extent_callback_l_)
- {
- nc->dim_.set_empty ();
- }
- else if (!valid_b_)
- {
- nc->dim_= (*extent_callback_l_ ) (nc);
- nc->valid_b_ = true;
- }
-
- r=dim_;
- return r;
-}
-
-void
-Dimension_cache::set_callback (Dim_cache_callback c)
-{
- extent_callback_l_ =c;
-}
-
-