comparison Framework/Scene2D/Scene2D.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 500c3f70b6c2
children 8b6adfb62a2f
comparison
equal deleted inserted replaced
653:4eccf698e52f 654:462a5074f914
21 21
22 #pragma once 22 #pragma once
23 23
24 #include "ISceneLayer.h" 24 #include "ISceneLayer.h"
25 #include "../Toolbox/AffineTransform2D.h" 25 #include "../Toolbox/AffineTransform2D.h"
26 #include <Framework/Messages/IObservable.h>
27 #include <Framework/Messages/IMessage.h>
28
26 #include <map> 29 #include <map>
27 30
28 namespace OrthancStone 31 namespace OrthancStone
29 { 32 {
30 class Scene2D : public boost::noncopyable 33 class Scene2D : public IObservable
31 { 34 {
32 public: 35 public:
36 ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, SceneTransformChanged, Scene2D);
37
33 class IVisitor : public boost::noncopyable 38 class IVisitor : public boost::noncopyable
34 { 39 {
35 public: 40 public:
36 virtual ~IVisitor() 41 virtual ~IVisitor()
37 { 42 {
53 uint64_t layerCounter_; 58 uint64_t layerCounter_;
54 59
55 Scene2D(const Scene2D& other); 60 Scene2D(const Scene2D& other);
56 61
57 public: 62 public:
58 Scene2D() : 63 Scene2D(MessageBroker& broker)
59 layerCounter_(0) 64 : IObservable(broker)
65 , layerCounter_(0)
60 { 66 {
61 } 67 }
62 68
63 ~Scene2D(); 69 ~Scene2D();
64 70