00001 /* 00002 Challenge - Virtual Robot Challenge System 00003 Copyright (C) 1999--2008: 00004 Stephane Magnenat <stephane at magnenat dot net> 00005 (http://stephane.magnenat.net) 00006 3D models 00007 Copyright (C) 2008: 00008 Basilio Noris 00009 Aseba - an event-based framework for distributed robot control 00010 Copyright (C) 2007--2012: 00011 Stephane Magnenat <stephane at magnenat dot net> 00012 (http://stephane.magnenat.net) 00013 and other contributors, see authors.txt for details 00014 00015 This program is free software: you can redistribute it and/or modify 00016 it under the terms of the GNU Lesser General Public License as published 00017 by the Free Software Foundation, version 3 of the License. 00018 00019 This program is distributed in the hope that it will be useful, 00020 but WITHOUT ANY WARRANTY; without even the implied warranty of 00021 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00022 GNU Lesser General Public License for more details. 00023 00024 You should have received a copy of the GNU Lesser General Public License 00025 along with this program. If not, see <http://www.gnu.org/licenses/>. 00026 */ 00027 00028 #ifndef __CHALLENGE_H 00029 #define __CHALLENGE_H 00030 00031 #include <viewer/Viewer.h> 00032 #include <QDialog> 00033 #include <QWidget> 00034 00035 class QPushButton; 00036 class QCheckBox; 00037 class QComboBox; 00038 class QTextBrowser; 00039 00040 namespace Enki 00041 { 00042 class ChallengeViewer : public ViewerWidget 00043 { 00044 Q_OBJECT 00045 00046 protected: 00047 bool savingVideo; 00048 int ePuckCount; 00049 00050 bool autoCamera; 00051 00052 QFont titleFont; 00053 QFont entryFont; 00054 QFont labelFont; 00055 00056 public: 00057 ChallengeViewer(World* world, int ePuckCount); 00058 00059 public slots: 00060 void addNewRobot(); 00061 void removeRobot(); 00062 void autoCameraStateChanged(bool state); 00063 00064 protected: 00065 virtual void timerEvent(QTimerEvent * event); 00066 //virtual void mouseMoveEvent ( QMouseEvent * event ); 00067 virtual void keyPressEvent ( QKeyEvent * event ); 00068 virtual void keyReleaseEvent ( QKeyEvent * event ); 00069 00070 void drawQuad2D(double x, double y, double w, double ar); 00071 00072 virtual void initializeGL(); 00073 00074 virtual void renderObjectsTypesHook(); 00075 virtual void displayObjectHook(PhysicalObject *object); 00076 virtual void sceneCompletedHook(); 00077 }; 00078 00079 class ChallengeApplication : public QWidget 00080 { 00081 Q_OBJECT 00082 00083 protected: 00084 ChallengeViewer viewer; 00085 00086 QTextBrowser* helpViewer; 00087 00088 public: 00089 ChallengeApplication(World* world, int ePuckCount); 00090 00091 public slots: 00092 void fullScreenStateChanged(bool fullScreen); 00093 00094 signals: 00095 void windowClosed(); 00096 00097 protected: 00098 virtual void closeEvent ( QCloseEvent * event ); 00099 }; 00100 } 00101 00102 class LanguageSelectionDialog : public QDialog 00103 { 00104 Q_OBJECT 00105 00106 public: 00107 QComboBox* languageSelectionBox; 00108 00109 LanguageSelectionDialog(); 00110 }; 00111 00112 #endif 00113