qaugmentedrealitycameraitem.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #ifndef QAUGMENTEDREALITYCAMERAITEM_H
  2. #define QAUGMENTEDREALITYCAMERAITEM_H
  3. #include <QDeclarativeItem>
  4. #include <QGeoCoordinate>
  5. #include "qdll_global.h"
  6. QTM_USE_NAMESPACE
  7. class QAugmentedRealityPositionInfo {
  8. public:
  9. float angle;
  10. float distance;
  11. };
  12. class QDLLSHARED_EXPORT QAugmentedRealityCameraItem : public QDeclarativeItem
  13. {
  14. Q_OBJECT
  15. Q_CLASSINFO("Author", "Sebastiano Galazzo")
  16. Q_CLASSINFO("Email", "sebastiano.galazzo@gmail.com")
  17. Q_PROPERTY(float latitude READ latitude WRITE setLatitude)
  18. Q_PROPERTY(float longitude READ longitude WRITE setLongitude)
  19. Q_PROPERTY(QString message READ message WRITE setMessage)
  20. Q_PROPERTY(QString infoBox READ infoBox WRITE setInfoBox)
  21. Q_PROPERTY(QString source READ source WRITE setSource)
  22. Q_PROPERTY(float x READ x)
  23. Q_PROPERTY(float y READ y)
  24. Q_PROPERTY(float z READ z)
  25. public:
  26. enum Roles {
  27. MessageRole = Qt::UserRole+1,
  28. LatitudeRole= Qt::UserRole+2,
  29. LongitudeRole = Qt::UserRole+3,
  30. InfoBoxRole = Qt::UserRole+4,
  31. SourceRole = Qt::UserRole+5
  32. };
  33. QAugmentedRealityCameraItem(QDeclarativeItem *parent = 0);
  34. virtual ~QAugmentedRealityCameraItem() {}
  35. QVariant data(int role) const;
  36. QHash<int, QByteArray> roleNames() const;
  37. QString id() const;
  38. float latitude() const;
  39. float longitude() const;
  40. QString message() const;
  41. QString infoBox() const;
  42. QString source() const;
  43. void setLatitude(float value );
  44. void setLongitude(float value );
  45. void setMessage(QString message );
  46. void setInfoBox(QString infoBox );
  47. void setSource(QString source );
  48. float x() const;
  49. float y() const;
  50. float z() const;
  51. QAugmentedRealityPositionInfo relativePosition(QGeoCoordinate, float angle);
  52. signals:
  53. void dataChanged();
  54. private:
  55. float m_latitude;
  56. float m_longitude;
  57. QString m_message;
  58. QString m_infobox;
  59. QString m_source;
  60. };
  61. #endif // QAUGMENTEDREALITYCAMERAITEM_H