annotate Samples/Qt/Scene2DInteractor.h @ 883:30268a0cafca am-dev

basic scene Qt sample working
author Alain Mazy <alain@mazy.be>
date Tue, 09 Jul 2019 14:34:56 +0200
parents a8cd3755db21
children aad5ccf1be10
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
879
12b591d5d63c some Qt integration (wip)
Alain Mazy <alain@mazy.be>
parents:
diff changeset
1 #pragma once
12b591d5d63c some Qt integration (wip)
Alain Mazy <alain@mazy.be>
parents:
diff changeset
2
881
Alain Mazy <alain@mazy.be>
parents: 879
diff changeset
3 #include "../../Framework/Scene2D/PointerEvent.h"
879
12b591d5d63c some Qt integration (wip)
Alain Mazy <alain@mazy.be>
parents:
diff changeset
4 #include "../../Framework/Scene2DViewport/ViewportController.h"
881
Alain Mazy <alain@mazy.be>
parents: 879
diff changeset
5 #include "../../Framework/Scene2DViewport/IFlexiblePointerTracker.h"
883
30268a0cafca basic scene Qt sample working
Alain Mazy <alain@mazy.be>
parents: 881
diff changeset
6 #include "../../Framework/Scene2D/Internals/CompositorHelper.h"
879
12b591d5d63c some Qt integration (wip)
Alain Mazy <alain@mazy.be>
parents:
diff changeset
7 #include "../../Applications/Generic/GuiAdapter.h"
12b591d5d63c some Qt integration (wip)
Alain Mazy <alain@mazy.be>
parents:
diff changeset
8
12b591d5d63c some Qt integration (wip)
Alain Mazy <alain@mazy.be>
parents:
diff changeset
9
12b591d5d63c some Qt integration (wip)
Alain Mazy <alain@mazy.be>
parents:
diff changeset
10 namespace OrthancStone
12b591d5d63c some Qt integration (wip)
Alain Mazy <alain@mazy.be>
parents:
diff changeset
11 {
12b591d5d63c some Qt integration (wip)
Alain Mazy <alain@mazy.be>
parents:
diff changeset
12
12b591d5d63c some Qt integration (wip)
Alain Mazy <alain@mazy.be>
parents:
diff changeset
13 class Scene2DInteractor
12b591d5d63c some Qt integration (wip)
Alain Mazy <alain@mazy.be>
parents:
diff changeset
14 {
12b591d5d63c some Qt integration (wip)
Alain Mazy <alain@mazy.be>
parents:
diff changeset
15 protected:
883
30268a0cafca basic scene Qt sample working
Alain Mazy <alain@mazy.be>
parents: 881
diff changeset
16 boost::shared_ptr<ViewportController> viewportController_;
30268a0cafca basic scene Qt sample working
Alain Mazy <alain@mazy.be>
parents: 881
diff changeset
17 boost::shared_ptr<IFlexiblePointerTracker> currentTracker_;
30268a0cafca basic scene Qt sample working
Alain Mazy <alain@mazy.be>
parents: 881
diff changeset
18 boost::shared_ptr<ICompositor> compositor_;
879
12b591d5d63c some Qt integration (wip)
Alain Mazy <alain@mazy.be>
parents:
diff changeset
19
12b591d5d63c some Qt integration (wip)
Alain Mazy <alain@mazy.be>
parents:
diff changeset
20 public:
12b591d5d63c some Qt integration (wip)
Alain Mazy <alain@mazy.be>
parents:
diff changeset
21 Scene2DInteractor(boost::shared_ptr<ViewportController> viewportController) :
12b591d5d63c some Qt integration (wip)
Alain Mazy <alain@mazy.be>
parents:
diff changeset
22 viewportController_(viewportController)
12b591d5d63c some Qt integration (wip)
Alain Mazy <alain@mazy.be>
parents:
diff changeset
23 {}
12b591d5d63c some Qt integration (wip)
Alain Mazy <alain@mazy.be>
parents:
diff changeset
24
883
30268a0cafca basic scene Qt sample working
Alain Mazy <alain@mazy.be>
parents: 881
diff changeset
25 void SetCompositor(boost::shared_ptr<ICompositor> compositor)
30268a0cafca basic scene Qt sample working
Alain Mazy <alain@mazy.be>
parents: 881
diff changeset
26 {
30268a0cafca basic scene Qt sample working
Alain Mazy <alain@mazy.be>
parents: 881
diff changeset
27 compositor_ = compositor;
30268a0cafca basic scene Qt sample working
Alain Mazy <alain@mazy.be>
parents: 881
diff changeset
28 }
30268a0cafca basic scene Qt sample working
Alain Mazy <alain@mazy.be>
parents: 881
diff changeset
29
30268a0cafca basic scene Qt sample working
Alain Mazy <alain@mazy.be>
parents: 881
diff changeset
30 virtual bool OnMouseEvent(const GuiAdapterMouseEvent& guiEvent, const PointerEvent& pointerEvent) = 0; // returns true if it has handled the event
30268a0cafca basic scene Qt sample working
Alain Mazy <alain@mazy.be>
parents: 881
diff changeset
31 virtual bool OnKeyboardEvent(const GuiAdapterKeyboardEvent& guiEvent) = 0; // returns true if it has handled the event
30268a0cafca basic scene Qt sample working
Alain Mazy <alain@mazy.be>
parents: 881
diff changeset
32 virtual bool OnWheelEvent(const GuiAdapterWheelEvent& guiEvent) = 0; // returns true if it has handled the event
881
Alain Mazy <alain@mazy.be>
parents: 879
diff changeset
33
879
12b591d5d63c some Qt integration (wip)
Alain Mazy <alain@mazy.be>
parents:
diff changeset
34 };
12b591d5d63c some Qt integration (wip)
Alain Mazy <alain@mazy.be>
parents:
diff changeset
35 }
12b591d5d63c some Qt integration (wip)
Alain Mazy <alain@mazy.be>
parents:
diff changeset
36
883
30268a0cafca basic scene Qt sample working
Alain Mazy <alain@mazy.be>
parents: 881
diff changeset
37
30268a0cafca basic scene Qt sample working
Alain Mazy <alain@mazy.be>
parents: 881
diff changeset
38
30268a0cafca basic scene Qt sample working
Alain Mazy <alain@mazy.be>
parents: 881
diff changeset
39
879
12b591d5d63c some Qt integration (wip)
Alain Mazy <alain@mazy.be>
parents:
diff changeset
40 class BasicScene2DInteractor : public OrthancStone::Scene2DInteractor
12b591d5d63c some Qt integration (wip)
Alain Mazy <alain@mazy.be>
parents:
diff changeset
41 {
12b591d5d63c some Qt integration (wip)
Alain Mazy <alain@mazy.be>
parents:
diff changeset
42 public:
12b591d5d63c some Qt integration (wip)
Alain Mazy <alain@mazy.be>
parents:
diff changeset
43 BasicScene2DInteractor(boost::shared_ptr<OrthancStone::ViewportController> viewportController) :
12b591d5d63c some Qt integration (wip)
Alain Mazy <alain@mazy.be>
parents:
diff changeset
44 Scene2DInteractor(viewportController)
12b591d5d63c some Qt integration (wip)
Alain Mazy <alain@mazy.be>
parents:
diff changeset
45 {}
12b591d5d63c some Qt integration (wip)
Alain Mazy <alain@mazy.be>
parents:
diff changeset
46
883
30268a0cafca basic scene Qt sample working
Alain Mazy <alain@mazy.be>
parents: 881
diff changeset
47 virtual bool OnMouseEvent(const OrthancStone::GuiAdapterMouseEvent& event, const OrthancStone::PointerEvent& pointerEvent) override;
30268a0cafca basic scene Qt sample working
Alain Mazy <alain@mazy.be>
parents: 881
diff changeset
48 virtual bool OnKeyboardEvent(const OrthancStone::GuiAdapterKeyboardEvent& guiEvent);
30268a0cafca basic scene Qt sample working
Alain Mazy <alain@mazy.be>
parents: 881
diff changeset
49 virtual bool OnWheelEvent(const OrthancStone::GuiAdapterWheelEvent& guiEvent);
879
12b591d5d63c some Qt integration (wip)
Alain Mazy <alain@mazy.be>
parents:
diff changeset
50 };
12b591d5d63c some Qt integration (wip)
Alain Mazy <alain@mazy.be>
parents:
diff changeset
51