]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/box.hh
patch::: 1.3.136.jcn3
[lilypond.git] / lily / include / box.hh
1 /*
2     some 2D geometrical concepts
3 */
4
5 #ifndef BOXES_HH
6 #define BOXES_HH
7
8 #include "flower-proto.hh"
9 #include "real.hh"
10 #include "interval.hh"
11 #include "offset.hh"
12 #include "axes.hh"
13
14
15 struct Box {
16   Interval interval_a_[NO_AXES];
17     
18   Interval &x () {return interval_a_[X_AXIS]; }
19   Interval &y (){ return interval_a_[Y_AXIS]; }
20   Interval x () const{ return interval_a_[X_AXIS]; }
21   Interval y () const{return interval_a_[Y_AXIS]; }
22   Interval operator[] (Axis a) const;
23   Interval &operator[] (Axis a);
24     
25   void translate (Offset o);
26   /// smallest box enclosing #b#
27   void set_empty ();
28   void scale (Real r);
29   void unite (Box b);
30   Box ();
31   Box (Interval ix, Interval iy);
32 };
33
34
35 #endif