]> git.donarmstrong.com Git - lilypond.git/blob - lily/dimension-cache.cc
* The grand 2005-2006 replace.
[lilypond.git] / lily / dimension-cache.cc
1 /*
2   dimension-cache.cc -- implement Dimension_cache
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1998--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9
10 #include "dimension-cache.hh"
11 #include "warn.hh"
12 #include "grob.hh"
13
14 Dimension_cache::Dimension_cache (Dimension_cache const &d)
15 {
16   init ();
17   offset_ = d.offset_ ? new Real (*d.offset_) : 0;
18   parent_ = d.parent_;
19   extent_ = d.extent_ ? new Interval (*d.extent_) : 0;
20 }
21
22 Dimension_cache::Dimension_cache ()
23 {
24   init ();
25 }
26
27 void
28 Dimension_cache::init ()
29 {
30   offset_ = 0;
31   extent_ = 0;
32   parent_ = 0;
33 }
34
35 Dimension_cache::~Dimension_cache ()
36 {
37   clear ();
38 }
39
40 void
41 Dimension_cache::clear ()
42 {
43   delete extent_;
44   delete offset_;
45   extent_ = 0;
46   offset_ = 0;
47 }