QCAD
Open Source 2D CAD
RInputEvent.h
Go to the documentation of this file.
1 
20 #ifndef RINPUTEVENT_H
21 #define RINPUTEVENT_H
22 
23 #include "core_global.h"
24 
25 #include <QMouseEvent>
26 
27 #include "RVector.h"
28 
29 class RGraphicsScene;
30 class RGraphicsView;
31 
42 public:
43  RInputEvent(const RVector& position, RGraphicsScene& s, RGraphicsView& v, qreal devicePixelRatio=1.0);
44  virtual ~RInputEvent();
45 
46  RVector getModelPosition() const;
47  void setModelPosition(const RVector& v);
48  void setScreenPosition(const RVector& v);
49 // RVector getUcsPosition() const;
50  RVector getScreenPosition() const;
51 
53  RGraphicsScene& getGraphicsScene() const;
54 
58  bool isValid() const {
59  return modelPosition.valid;
60  }
61 
62 protected:
64 // RVector ucsPosition;
66 
69 };
70 
72 
73 #endif
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
An input event for a graphics scene.
Definition: RInputEvent.h:41
RGraphicsScene & scene
Definition: RInputEvent.h:67
Abstract base class for all graphics scenes.
Definition: RGraphicsScene.h:60
RGraphicsView & view
Definition: RInputEvent.h:68
#define QCADCORE_EXPORT
Definition: core_global.h:10
RVector screenPosition
Definition: RInputEvent.h:65
Q_DECLARE_METATYPE(RMath *)
void getGraphicsView()
Returns the current or last active RGraphicsView.
Definition: simple.js:38
bool isValid() const
Definition: RInputEvent.h:58
RVector modelPosition
Definition: RInputEvent.h:63
Graphics view.
Definition: RGraphicsView.h:58