X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Fbox.hh;h=b0f899431188bf4d653ac448afbb6e074efdd6fa;hb=1daa96e1881e50d9abcca1f8f81cd7259da30ab6;hp=a8119664b798d4f74bfe5c3fa272eb2f98c30caa;hpb=9f3572d98bb948c9689cd1f75401a029451fa001;p=lilypond.git diff --git a/lily/include/box.hh b/lily/include/box.hh index a8119664b7..b0f8994311 100644 --- a/lily/include/box.hh +++ b/lily/include/box.hh @@ -12,26 +12,34 @@ class Box { Interval interval_a_[NO_AXES]; - DECLARE_SIMPLE_SMOBS (Box,); + 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); + Real area () const; + bool is_empty () const; + bool is_empty (Axis a) const; 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 intersect (Box b); + void print (); Box (); Box (Interval ix, Interval iy); }; +DECLARE_UNSMOB (Box, box); + #endif