Qubet  1.0
The ultimate QGL addicting videogame!
 All Classes Functions Variables Pages
cubestring.h
1 // Qubet - Copyright (C) 2011
2 // Enrico Bacis
3 // Daniele Ciriello
4 
5 // Qubet is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 
15 // You should have received a copy of the GNU General Public License
16 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18 
19 #ifndef CUBESTRING_H
20 #define CUBESTRING_H
21 
22 #include "utilities.h"
23 
38 {
39 
40 public:
41 
54  explicit CubeString(QString _label, GLfloat _cubeDimension, Alphabet *_alphabet, GLuint _name = 0);
55 
72  explicit CubeString(QString _label, GLfloat _maxWidth, GLfloat _maxHeight, Alphabet *_alphabet, GLfloat _maxCubeDimension = 0.0f, GLuint _name = 0);
73 
79  ~CubeString();
80 
90  GLvoid draw(GLboolean simplifyForPicking = false);
91 
97  QString getLabel();
98 
104  GLuint getName();
105 
125  GLvoid startLetterRotation(GLuint _letterName, GLint _angleStep, GLint _turns);
126 
144  GLvoid startStringRotation(GLint _angleStep, GLint _turns);
145 
154  GLboolean isRotating(GLuint _letterName);
155 
165  GLfloat setCurrentAngle(GLfloat _firstLetterAngle, GLfloat _nextLetterDelta = 0);
166 
167 
168 private:
169 
170  QString label;
171  GLfloat cubeDimension;
172  GLuint name;
175  QList<GLint> angleSteps;
176  QList<GLint> currentAngles;
177  QList<GLint> finalAngles;
179 #ifdef USE_DISPLAY_LISTS_FOR_LETTERS
180 
181  QList<GLuint> letterDisplayLists;
183 #else
184 
185  QList<Skin*> letterSkins;
187 #endif
188 
196  GLuint createLetterDisplayList(QChar _letter);
197 
205  GLuint createLetterDisplayList(Skin *_skin);
206 
210  GLvoid init();
211 
212 };
213 
214 #endif // CUBESTRING_H
QList< Skin * > letterSkins
Definition: cubestring.h:185
~CubeString()
Safely destroys a CubeString.
Definition: cubestring.cpp:49
GLfloat setCurrentAngle(GLfloat _firstLetterAngle, GLfloat _nextLetterDelta=0)
Set the current angle for the letters in the CubeString.
Definition: cubestring.cpp:171
Alphabet * alphabet
Definition: cubestring.h:173
GLvoid draw(GLboolean simplifyForPicking=false)
Draws the CubeString in the current selected point of the scene.
Definition: cubestring.cpp:66
This class is used to draw, a string composed the horizontal justapposition of Different cubes on whi...
Definition: cubestring.h:37
It is the Skin Class.
Definition: skin.h:30
GLfloat cubeDimension
Definition: cubestring.h:171
GLboolean isRotating(GLuint _letterName)
Check if a letter of the CubeString is already rotating.
Definition: cubestring.cpp:166
QList< GLint > angleSteps
Definition: cubestring.h:175
CubeString(QString _label, GLfloat _cubeDimension, Alphabet *_alphabet, GLuint _name=0)
Creates a CubeString of the text _label, using the Alphabet _alphabet and every cube letter of the st...
Definition: cubestring.cpp:21
GLuint createLetterDisplayList(QChar _letter)
It is an internal function to create the OpenGL displayList of a letter.
Definition: cubestring.cpp:184
GLvoid init()
It is an internal function used to initialize CubeString's values.
Definition: cubestring.cpp:198
GLuint name
Definition: cubestring.h:172
GLvoid startStringRotation(GLint _angleStep, GLint _turns)
Start the rotation of the entire CubeString.
Definition: cubestring.cpp:160
QList< GLint > currentAngles
Definition: cubestring.h:176
QString label
Definition: cubestring.h:170
QString getLabel()
Returns the text of the CubeString.
Definition: cubestring.cpp:120
This class is used to keep a list of Letter (from this the name Alphabet) It provide access to Letter...
Definition: alphabet.h:33
GLvoid startLetterRotation(GLuint _letterName, GLint _angleStep, GLint _turns)
Start the rotation of a letter in the CubeString.
Definition: cubestring.cpp:130
GLuint getName()
Returns the name given to the entire string (for picking purposes). [default = 0].
Definition: cubestring.cpp:125
QList< GLint > finalAngles
Definition: cubestring.h:177