- Main Page
- Classes
- Files

- File List

# qaugmentedrealitycamera.h

    00001 #ifndef QAUGMENTEDREALITYCAMERA_H
    00002 #define QAUGMENTEDREALITYCAMERA_H
    00003
    00004 /*#include <QtDeclarative>
    00005 #include <QDeclarativeEngine>
    00006
    00007 #include <QList>
    00008 #include <QDeclarativeExtensionPlugin>
    00009 */
    00010
    00011 #include "QNativeCamera.h"
    00012
    00013 #include <QGeoPositionInfo>
    00014 #include <QGeoPositionInfoSource>
    00015
    00016 QTM_USE_NAMESPACE
    00017
    00018 #include "qdll_global.h"
    00019
    00020 #include "accelerometerinfo.h"
    00021 #include "compassinfo.h"
    00022 #include "qaugmentedrealitycameraitem.h"
    00023 #include "qaugmentedrealitycameradelegate.h"
    00024 #include "qaugmentedrealitycameramodel.h"
    00025
    00026 // http://qt-project.org/forums/viewthread/14464
    00027 // http://doc.qt.nokia.com/4.7-snapshot/declarative-tutorials-extending-chapter6-plugins.html
    00028 // http://doc.qt.nokia.com/4.7-snapshot/declarative-cppextensions-plugins-plugin-cpp.html
    00029 // http://cdumez.blogspot.it/2010/11/how-to-use-c-list-model-in-qml.html
    00030
    00031 class QDLLSHARED_EXPORT QAugmentedRealityCamera : public QNativeCamera
    00032 {
    00033     Q_OBJECT
    00034     Q_CLASSINFO("Author", "Sebastiano Galazzo")
    00035     Q_CLASSINFO("Email", "sebastiano.galazzo@gmail.com")
    00036
    00037     //Q_PROPERTY(QVariantList model READ getModel WRITE setModel NOTIFY modelChanged)
    00038     Q_PROPERTY(QAugmentedRealityCameraModel* model READ getModel WRITE setModel NOTIFY modelChanged)
    00039     //Q_PROPERTY(QDeclarativeComponent* delegate READ getDelegate WRITE setDelegate NOTIFY delegateChanged)
    00040     //Q_PROPERTY(QAugmentedRealityCameraDelegate* delegate READ getDelegate WRITE setDelegate NOTIFY delegateChanged)
    00041     Q_PROPERTY(int distance READ distance WRITE setDistance)
    00042
    00043 public:
    00044     explicit QAugmentedRealityCamera(QDeclarativeItem *parent = 0);
    00045
    00046    /*void setModel(QVariantList const &m_data);
    00047     QVariantList getModel() const;*/
    00048
    00049     void setModel(QAugmentedRealityCameraModel* model);
    00050     QAugmentedRealityCameraModel *getModel() const;
    00051
    00052    /* void setItemDelegate(QAbstractItemDelegate *delegate);
    00053     QAbstractItemDelegate *itemDelegate() const;*/
    00054
    00055     //void setDelegate(QAugmentedRealityCameraDelegate *delegate);
    00056     //QAugmentedRealityCameraDelegate *getDelegate() const;
    00057
    00058     //void setDelegate(QObject *delegate);
    00059     //void setDelegate(QDeclarativeComponent *delegate);
    00060    // QDeclarativeComponent *getDelegate() const;
    00061
    00065     int distance();
    00069     void setDistance(int value);
    00070
    00071     void paint(QPainter *painter,
    00072                        const QStyleOptionGraphicsItem *option,
    00073                        QWidget *widget);
    00074
    00075 signals:
    00076     void modelChanged();
    00077     void delegateChanged(QDeclarativeComponent *delegate);
    00078
    00079 public slots:
    00080     void captureImage();
    00081     void imageAvailable(int,QVideoFrame);
    00082
    00083 private slots:
    00084      void positionUpdated(const QGeoPositionInfo &info);
    00085
    00086 private:
    00087     int m_distance;
    00088     AccelerometerInfo m_accelerometer;
    00089     CompassInfo m_compass;
    00090
    00091     QGeoPositionInfo position;
    00092
    00093     //QVariantList m_data;
    00094     QAugmentedRealityCameraModel* m_data;
    00095
    00096     //QDeclarativeComponent *m_delegate;
    00097     QAugmentedRealityCameraDelegate* m_delegate;
    00098
    00099 private:
    00100     void drawPins(QPainter *painter);
    00101 };
    00102
    00103 #endif // QAUGMENTEDREALITYCAMERA_H

All Classes Functions