Overte C++ Documentation
Overlay2D.h
1 //
2 // Overlay2D.h
3 // interface/src/ui/overlays
4 //
5 // Copyright 2014 High Fidelity, Inc.
6 //
7 // Distributed under the Apache License, Version 2.0.
8 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
9 //
10 
11 #ifndef hifi_Overlay2D_h
12 #define hifi_Overlay2D_h
13 
14 #include <QRect>
15 
16 #include "Overlay.h"
17 
18 class Overlay2D : public Overlay {
19  Q_OBJECT
20 
21 public:
22  Overlay2D() {}
23  Overlay2D(const Overlay2D* overlay2D);
24 
25  virtual AABox getBounds() const override;
26  virtual uint32_t fetchMetaSubItems(render::ItemIDs& subItems) const override { subItems.push_back(getRenderItemID()); return 1; }
27 
28  // getters
29  const QRect& getBoundingRect() const { return _bounds; }
30 
31  // setters
32  void setX(int x) { _bounds.setX(x); }
33  void setY(int y) { _bounds.setY(y); }
34  void setWidth(int width) { _bounds.setWidth(width); }
35  void setHeight(int height) { _bounds.setHeight(height); }
36  void setBounds(const QRect& bounds) { _bounds = bounds; }
37 
38  void setProperties(const QVariantMap& properties) override;
39 
40 protected:
41  QRect _bounds; // where on the screen to draw
42 };
43 
44 
45 #endif // hifi_Overlay2D_h