renderworldwrapperwidget.h
1 /********************************************************************************
2  * FARSA Experiments Library *
3  * Copyright (C) 2007-2014 *
4  * Stefano Nolfi <stefano.nolfi@istc.cnr.it> *
5  * Onofrio Gigliotta <onofrio.gigliotta@istc.cnr.it> *
6  * Gianluca Massera <emmegian@yahoo.it> *
7  * Tomassino Ferrauto <tomassino.ferrauto@istc.cnr.it> *
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  * This program is distributed in the hope that it will be useful, *
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
17  * GNU General Public License for more details. *
18  * *
19  * You should have received a copy of the GNU General Public License *
20  * along with this program; if not, write to the Free Software *
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *
22  ********************************************************************************/
23 
24 #ifndef RENDERWORLDWRAPPERWIDGET_H
25 #define RENDERWORLDWRAPPERWIDGET_H
26 
27 #include "experimentsconfig.h"
28 #include "resourcesuser.h"
29 #include "wmatrix.h"
30 #include <QWidget>
31 #include <QTimer>
32 
33 class QVBoxLayout;
34 
35 namespace farsa {
36 
37 class RenderWorld;
38 
47 class FARSA_EXPERIMENTS_API RenderWorldWrapperWidget : public QWidget, public ConcurrentResourcesUser
48 {
49  Q_OBJECT
50 public:
57  RenderWorldWrapperWidget(QWidget* parent = NULL, Qt::WindowFlags flags = 0);
58 
62  virtual ~RenderWorldWrapperWidget();
63 
74  virtual void shareResourcesWith(ResourcesUser* buddy);
75 
76 public slots:
80  void updateRenderWorld();
82  void setSelfUpdate( bool enable );
84  bool isSelfUpdate();
85 protected:
93  virtual void resourceChanged(QString resourceName, ResourceChangeType changeType);
94 
103  virtual void customEvent(QEvent* event);
104 
108  void lookAtRobot();
109 
114 
118  QVBoxLayout* const m_layout;
119 
124 
131 
134 };
135 
136 } //end namespace farsa
137 
138 #endif
139 
The wrapper widget for RenderWorld.
QVBoxLayout *const m_layout
The layout for this widget.
This file contains the common type defitions used on the whole framework.
bool m_setCameraToLookAtRobot
True if we have to set camera to look at the robot.
wMatrix m_robotTm
The transformation matrix of the iCub.
QTimer * m_selfUpdateTimer
Timer used for self update the render world.
RenderWorld *const m_renderWorld
The object actually rendering the world.