QCAD
Open Source 2D CAD
Loading...
Searching...
No Matches
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
28
38public:
40 documentInterface(documentInterface),
41 lastSnap(RVector::invalid) {}
42 virtual ~RSnapRestriction() {}
43
48 virtual RVector restrictSnap(const RVector& position, const RVector& relativeZero) = 0;
49
50 virtual void showUiOptions() {}
51 virtual void hideUiOptions() {}
52
54 return lastSnap;
55 }
56
57 void reset() {
58 lastSnap = RVector::invalid;
59 }
60
61protected:
64};
65
67
68#endif
Q_DECLARE_METATYPE(RMath *)
Interface for interaction between a graphics document and a user.
Definition RDocumentInterface.h:97
Abstract base class for all snap restriction implementations.
Definition RSnapRestriction.h:37
RVector getLastSnap() const
Definition RSnapRestriction.h:53
RSnapRestriction(RDocumentInterface *documentInterface=NULL)
Definition RSnapRestriction.h:39
RDocumentInterface * documentInterface
Definition RSnapRestriction.h:62
RVector lastSnap
Definition RSnapRestriction.h:63
virtual ~RSnapRestriction()
Definition RSnapRestriction.h:42
void reset()
Definition RSnapRestriction.h:57
virtual void hideUiOptions()
Definition RSnapRestriction.h:51
virtual RVector restrictSnap(const RVector &position, const RVector &relativeZero)=0
virtual void showUiOptions()
Definition RSnapRestriction.h:50
Represents a 3d vector (x/y/z).
Definition RVector.h:47
static const RVector invalid
invalid vector
Definition RVector.h:335
#define QCADCORE_EXPORT
Definition core_global.h:10
#define NULL
Definition opennurbs_system.h:256