00001 #ifndef BOXCONSTRAINT_H 00002 #define BOXCONSTRAINT_H 00003 00004 #include <QRectF> 00005 00006 #include "Constraint.h" 00007 00008 namespace Elve { 00009 00010 class BoxConstraint : public Constraint 00011 { 00012 public: 00013 BoxConstraint(const QRectF& bounds = {0,0,1024,1024}); 00014 void setBounds(const QRectF& bounds) ; 00015 void constrain(Point& point) override; 00016 private: 00017 QRectF mBounds; 00018 }; 00019 00020 } 00021 #endif // BOXCONSTRAINT_H