| 1 |
#pragma once |
| 2 |
|
| 3 |
#include "imousetoolevent.h" |
| 4 |
#include "math/Vector3.h" |
| 5 |
|
| 6 |
namespace ui |
| 7 |
{ |
| 8 |
|
| 9 |
// Special event subtype for XY View events. Provides |
| 10 |
// information about view type, for example. |
| 11 |
class XYMouseToolEvent: public OrthoViewMouseToolEvent |
| 12 |
{ |
| 13 |
IOrthoView& _view; |
| 14 |
|
| 15 |
// Current mouse coordinates, relative to 0,0,0 world origin |
| 16 |
Vector3 _worldPos; |
| 17 |
|
| 18 |
public: |
| 19 |
XYMouseToolEvent(IOrthoView& view, const Vector3& worldPos, const Vector2& devicePos) : |
| 20 |
OrthoViewMouseToolEvent(view, devicePos), |
| 21 |
_view(view), |
| 22 |
_worldPos(worldPos) |
| 23 |
{} |
| 24 |
|
| 25 |
XYMouseToolEvent(IOrthoView& view, const Vector3& worldPos, const Vector2& devicePos, const Vector2& delta) : |
| 26 |
OrthoViewMouseToolEvent(view, devicePos, delta), |
| 27 |
_view(view), |
| 28 |
_worldPos(worldPos) |
| 29 |
{} |
| 30 |
|
| 31 |
IOrthoView& getView() |
| 32 |
{ |
| 33 |
return _view; |
| 34 |
} |
| 35 |
|
| 36 |
const Vector3& getWorldPos() const |
| 37 |
{ |
| 38 |
return _worldPos; |
| 39 |
} |
| 40 |
|
| 41 |
OrthoOrientation getViewType() const |
| 42 |
{ |
| 43 |
return _view.getOrientation(); |
| 44 |
} |
| 45 |
|
| 46 |
float getScale() const |
| 47 |
{ |
| 48 |
return _view.getScale(); |
| 49 |
} |
| 50 |
}; |
| 51 |
|
| 52 |
} |