QCAD
Open Source 2D CAD
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RSnapRestriction.h
Go to the documentation of this file.
1 
20 #ifndef RSNAPRESTRICTION_H
21 #define RSNAPRESTRICTION_H
22 
23 #include "core_global.h"
24 
25 #include "RVector.h"
26 
27 class RDocumentInterface;
28 
38 public:
39  RSnapRestriction(RDocumentInterface& documentInterface) : documentInterface(documentInterface), lastSnap(RVector::invalid) {}
40  virtual ~RSnapRestriction() {}
41 
46  virtual RVector restrictSnap(const RVector& position, const RVector& relativeZero) = 0;
47 
48  virtual void showUiOptions() {}
49  virtual void hideUiOptions() {}
50 
51  RVector getLastSnap() const {
52  return lastSnap;
53  }
54 
55  void reset() {
56  lastSnap = RVector::invalid;
57  }
58 
59 protected:
62 };
63 
65 
66 #endif