Mercurial > hg > orthanc-stone
comparison Samples/Sdl/TrackerSampleApp.h @ 654:462a5074f914
Turned the scene into an observable to be able to dynamically react to
scene to canvas transform changes --> now the handles and angle measure
adornments are immune to zoom changes
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Tue, 14 May 2019 13:51:00 +0200 |
parents | f939f449482c |
children | 002d9562c8f5 |
comparison
equal
deleted
inserted
replaced
653:4eccf698e52f | 654:462a5074f914 |
---|---|
17 * You should have received a copy of the GNU Affero General Public License | 17 * You should have received a copy of the GNU Affero General Public License |
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 **/ | 19 **/ |
20 | 20 |
21 #include <Framework/Scene2D/OpenGLCompositor.h> | 21 #include <Framework/Scene2D/OpenGLCompositor.h> |
22 #include <Framework/Messages/IObserver.h> | |
22 | 23 |
23 #include "../Common/IFlexiblePointerTracker.h" | 24 #include "../Common/IFlexiblePointerTracker.h" |
24 #include "../Common/MeasureTools.h" | 25 #include "../Common/MeasureTools.h" |
25 | 26 |
26 #include <SDL.h> | 27 #include <SDL.h> |
49 | 50 |
50 static const unsigned int FONT_SIZE = 32; | 51 static const unsigned int FONT_SIZE = 32; |
51 | 52 |
52 class Scene2D; | 53 class Scene2D; |
53 | 54 |
54 class TrackerSampleApp | 55 class TrackerSampleApp : public IObserver |
55 { | 56 { |
56 public: | 57 public: |
57 // 12 because. | 58 // 12 because. |
58 TrackerSampleApp() : currentTool_(GuiTool_Rotate) | 59 TrackerSampleApp(MessageBroker& broker) |
60 : IObserver(broker) | |
61 , currentTool_(GuiTool_Rotate) | |
62 , scene_(broker) | |
59 { | 63 { |
60 TEXTURE_2x2_1_ZINDEX = 1; | 64 TEXTURE_2x2_1_ZINDEX = 1; |
61 TEXTURE_1x1_ZINDEX = 2; | 65 TEXTURE_1x1_ZINDEX = 2; |
62 TEXTURE_2x2_2_ZINDEX = 3; | 66 TEXTURE_2x2_2_ZINDEX = 3; |
63 LINESET_1_ZINDEX = 4; | 67 LINESET_1_ZINDEX = 4; |