X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Fbox.hh;h=901987f1ad381d8ff83ec97fb9a5e5b3270ab77c;hb=29c0474da054e124937aa219dbb07a0f164d6a45;hp=c53543d05855087590009b5e1dff587cbe182709;hpb=622b379cd71af8dde94f68135a489b2536309e6f;p=lilypond.git diff --git a/lily/include/box.hh b/lily/include/box.hh index c53543d058..901987f1ad 100644 --- a/lily/include/box.hh +++ b/lily/include/box.hh @@ -5,28 +5,30 @@ #ifndef BOXES_HH #define BOXES_HH -#include "fproto.hh" -#include "real.hh" #include "interval.hh" #include "offset.hh" -#include "axes.hh" - -struct Box { +struct Box +{ Interval interval_a_[NO_AXES]; - 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 operator[](Axis a) const; + 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 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); - Box(); + Box (); Box (Interval ix, Interval iy); };