Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class XMTelestration:
- public InputHandler,
- public enable_defer,
- public std::enable_shared_from_this<XMTelestration>,
- public ControlChannelHubObserver
- {
- private:
- const int width = 1024;
- const int height = 1024;
- const float previewScale;
- PTR<ControlChannelHub> hub;
- PTR<XMRendererInterface> renderer;
- std::vector<PTR<XMTelestrationNode>> nodes;
- std::stack<PTR<XMTelestrationNode>> undoStack;
- std::map<int, PTR<XMTelestrationLine>> currentDrawings;
- Stroke stroke;
- PortableMutex<std::recursive_mutex> mtx;
- PTR<InvokeQueue> updateQueue;
- PTR<XMTelestrationLine> existingDrawingFor(int index);
- struct Layers
- {
- PTR<XMRendererSVGLayer> primary = nullptr;
- PTR<XMRendererSVGLayer> preview = nullptr;
- } layers;
- enum UpdateMode { Primary, Preview, Both };
- void updateLayers(UpdateMode mode);
- virtual void onMessage(ControlChannelHub* hub, PTR<XMUser> sender, ControlMessage* msg) override;
- void removeNode(const std::string& nodeId, bool redraw, bool notifyRemote);
- PTR<XMTelestrationNode> getNode(const std::string& nodeId);
- virtual void onTouchDown(int index, float x, float y) override;
- virtual void onTouchMoved(int index, float x, float y) override;
- virtual void onTouchReleased(int index) override;
- public:
- XMTelestration(PTR<ControlChannelHub> hub, const Stroke& stroke, float previewScale);
- const std::vector<PTR<XMTelestrationNode>>& getNodes();
- void clear(bool notifyRemote = true);
- void undo();
- void attach(PTR<LayerFactoryInterface> layerFactory, PTR<XMRendererInterface> renderer);
- void detach();
- Stroke getStroke();
- void setStroke(const Stroke& stroke);
- static PTR<XMTelestration> create(PTR<ControlChannelHub> controlChannelHub, const Stroke& stroke, float previewScale);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement