QCAD
Open Source 2D CAD
RSnapEntityBase.h
Go to the documentation of this file.
1 
20 #ifndef RSNAPENTITYBASE_H
21 #define RSNAPENTITYBASE_H
22 
23 #include "snap_global.h"
24 
25 #include "RSnap.h"
26 #include "RGraphicsView.h"
27 
28 class RMouseEvent;
29 
38 public:
40  virtual ~RSnapEntityBase() {}
41 
42  virtual RVector snap(
43  const RVector& position,
44  RGraphicsView& view,
45  double range=RNANDOUBLE);
46 
47  virtual RVector snap(
48  const RVector& position,
49  RGraphicsView& view,
50  const QSet<REntity::Id>& candidates,
51  const RBox& queryBox);
52 
53 protected:
54  virtual QList<RVector> snapEntity(
55  QSharedPointer<REntity> entity,
56  const RVector& point,
57  const RBox& queryBox,
58  RGraphicsView& view) = 0;
59 };
60 
62 
63 #endif
Represents a box e.g.
Definition: RBox.h:43
Abstract base class for all grid and object snap implementations.
Definition: RSnap.h:44
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
Base class for entity based snap classes.
Definition: RSnapEntityBase.h:37
#define RNANDOUBLE
Definition: RMath.h:71
Q_DECLARE_METATYPE(RMath *)
virtual RVector snap(const RVector &position, RGraphicsView &view, double range=RNANDOUBLE)=0
A mouse event for a graphics scene.
Definition: RMouseEvent.h:42
Status
Snap status, returned by snap tools (most importantly auto snap tool) to indicate what snap was used...
Definition: RSnap.h:50
RSnapEntityBase(RSnap::Status s)
Definition: RSnapEntityBase.h:39
virtual ~RSnapEntityBase()
Definition: RSnapEntityBase.h:40
#define QCADSNAP_EXPORT
Definition: snap_global.h:10
Graphics view.
Definition: RGraphicsView.h:58