lilypond-0.0.61
[lilypond.git] / hdr / boxes.hh
blob22a2eec3a5f29ee524cd192aaee3e5277ac1f177
1 /*
2 some 2D geometrical concepts
3 */
5 #ifndef BOXES_HH
6 #define BOXES_HH
8 #include "fproto.hh"
9 #include "real.hh"
10 #include "interval.hh"
11 #include "offset.hh"
13 /// a square subset of Real^2
14 struct Box {
15 Interval x, y;
17 void translate(Offset o) {
18 x.translate(o.x);
19 y.translate(o.y);
21 /// smallest box enclosing #b#
22 void unite(Box b) {
23 x.unite(b.x);
24 y.unite(b.y);
26 Box();
27 Box(Interval ix, Interval iy);
31 #endif