iCub-main
qticubskinguiplugin.h
Go to the documentation of this file.
1 #ifndef QTICUBSKINGUIPLUGIN_H
2 #define QTICUBSKINGUIPLUGIN_H
3 
4 #include <QtQuick>
5 #include <QPainter>
6 #include <QTimer>
7 #include <yarp/os/all.h>
10 
11 
12 class QtICubSkinGuiPlugin : public QQuickPaintedItem
13 {
14  Q_OBJECT
15  Q_DISABLE_COPY(QtICubSkinGuiPlugin)
16  Q_PROPERTY(QString windowTitle READ windowTitle NOTIFY windowTitleChanged)
17  Q_PROPERTY(int posX READ posX NOTIFY posXChanged)
18  Q_PROPERTY(int posY READ posY NOTIFY posYChanged)
19  Q_PROPERTY(int windowWidth READ windowWidth NOTIFY widthChanged)
20  Q_PROPERTY(int windowHeight READ windowHeight NOTIFY heightChanged)
21 
22 public:
23  QtICubSkinGuiPlugin(QQuickItem *parent = 0);
25  Q_INVOKABLE bool parseParameters(QStringList params);
26 
27  void paint(QPainter *painter);
28 
29  QString windowTitle();
30  int posX();
31  int posY();
32  int windowWidth();
33  int windowHeight();
34 
35 private:
36  yarp::os::ResourceFinder rf;
37  QMutex mutex;
38  int gWidth;
39  int gHeight;
40  int gRowStride;
41  int gImageSize;
42  int gMapSize;
43  int gImageArea;
44  int gXpos;
45  int gYpos;
46  bool bDrawing;
47  enum TheadTypeEnum {TYPE_CAN, TYPE_PORT};
48  int TheadType;
49  double *gpActivationMap;
50  uchar *gpImageBuff;
51  SkinMeshThreadCan *gpSkinMeshThreadCan;
52  SkinMeshThreadPort *gpSkinMeshThreadPort;
53 
54  QTimer timer;
55  QString window_title;
56 
57 signals:
58  void init();
59  void sendWindowTitle(QString title);
60  void sendWindowSize(int width, int height);
61  void sendWindowPos(int xPos, int yPos);
62  void done();
63 
64 
65  void posXChanged();
66  void posYChanged();
67  void widthChanged();
68  void heightChanged();
70 
71 private slots:
72  void onTimeout();
73 
74  void onInit();
75 };
76 
77 #endif // QTICUBSKINGUIPLUGIN_H
78 
void paint(QPainter *painter)
int windowHeight
Returns the height.
int posX
Returns the x position.
QtICubSkinGuiPlugin(QQuickItem *parent=0)
void sendWindowSize(int width, int height)
QString windowTitle
Returns the title.
Q_INVOKABLE bool parseParameters(QStringList params)
parse the parameters received from the main container in QstringList form
int posY
Returns the y position.
void sendWindowTitle(QString title)
void sendWindowPos(int xPos, int yPos)
int windowWidth
Returns the width.