X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Fbox.hh;h=baa4ce0b7645791bd993f0a3b204d3f0a9c8f8e1;hb=c89f780d0c5c221e766ee6e818dcd85307fffaae;hp=cbdfc2da7aef9724821eb5a7ac37c313d051f153;hpb=e5990be98bd154f5dd6b2aa8259a56c546168450;p=lilypond.git diff --git a/lily/include/box.hh b/lily/include/box.hh index cbdfc2da7a..baa4ce0b76 100644 --- a/lily/include/box.hh +++ b/lily/include/box.hh @@ -1,39 +1,38 @@ /* - some 2D geometrical concepts + some 2D geometrical concepts */ #ifndef BOXES_HH #define BOXES_HH -#include "flower-proto.hh" -#include "real.hh" #include "interval.hh" #include "offset.hh" -#include "axes.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 operator[] (Axis a) const; - Interval &operator[] (Axis a); + 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 (Interval ix, Interval iy); }; - #endif