X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Fbox.hh;h=af5695b3bce8f64978a623c4d16b56dea054b7a4;hb=b50658bea833eb7fd7650cbf5cd9a9bd0b6e1aca;hp=fc8eda7bec01e5b3dd8bd98f2d71ade0397443c6;hpb=bdf4ab13203502e7ec7cf9cf5896527643a07c1f;p=lilypond.git diff --git a/lily/include/box.hh b/lily/include/box.hh index fc8eda7bec..af5695b3bc 100644 --- a/lily/include/box.hh +++ b/lily/include/box.hh @@ -7,27 +7,31 @@ #include "interval.hh" #include "offset.hh" +#include "smobs.hh" -struct Box +class Box { Interval interval_a_[NO_AXES]; - + DECLARE_SIMPLE_SMOBS (Box); +public: Interval &x () {return interval_a_[X_AXIS]; } - Interval &y (){ return interval_a_[Y_AXIS]; } - Interval x () const{ return interval_a_[X_AXIS]; } - Interval y () const{return interval_a_[Y_AXIS]; } + Interval &y () { return interval_a_[Y_AXIS]; } + Interval x () const { return interval_a_[X_AXIS]; } + Interval y () const {return interval_a_[Y_AXIS]; } Interval operator [] (Axis a) const; Interval &operator [] (Axis a); Offset center () const; void translate (Offset o); + /// smallest box enclosing #b# void set_empty (); void add_point (Offset); void widen (Real x, Real y); void scale (Real r); void unite (Box b); + void print (); Box (); Box (Interval ix, Interval iy); };