Qubet  1.0
The ultimate QGL addicting videogame!
 All Classes Functions Variables Pages
cubestringlist.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 CUBESTRINGLIST_H
20 #define CUBESTRINGLIST_H
21 
22 #include "cubestring.h"
23 
32 {
33 
34 public:
35 
46  explicit CubeStringList(QList< QPair<QString,GLuint> > _labels, GLfloat _cubeDimension, Alphabet *_alphabet);
47 
62  explicit CubeStringList(QList< QPair<QString,GLuint> > _labels, GLfloat _maxWidth, GLfloat _maxHeight, Alphabet *_alphabet, GLfloat _maxCubeDimension = 0.0f);
63 
76  explicit CubeStringList(QString _labels, GLfloat _cubeDimension, Alphabet *_alphabet, GLuint _name = 0);
77 
93  explicit CubeStringList(QString _labels, GLfloat _maxWidth, GLfloat _maxHeight, Alphabet *_alphabet, GLfloat _maxCubeDimension = 0.0f, GLuint _name = 0);
94 
99 
106  GLvoid draw(GLboolean simplifyForPicking = false);
107 
113  GLint getLabelCount();
114 
122  QString getLabel(GLuint _stringName);
123 
144  GLvoid startLetterRotation(GLuint _stringName, GLuint _letterName, GLint _angleStep, GLint _turns);
145 
164  GLvoid startStringRotation(GLuint _stringName, GLint _angleStep, GLint _turns);
165 
173  GLvoid startStringListRotation(GLint _angleStep, GLint _turns);
174 
183  GLboolean isRotating(GLuint _stringName, GLuint _letterName);
184 
194  GLfloat setCurrentAngle(GLfloat _firstLetterAngle, GLfloat _nextLetterDelta = 0.0f);
195 
196 
197 private:
198 
199  QList<CubeString*> cubeStrings;
200  GLuint name;
201  GLfloat interline;
210  GLvoid computeHeights(GLfloat _cubeDimension);
211 
218  CubeString *getCubeStringFromName(GLuint _name);
219 
226  CubeString *getCubeStringFromLabel(QString _label);
227 
235  QList< QPair<QString,GLuint> > splitLabels(QString _labels);
236 
244  GLvoid init(QList< QPair<QString,GLuint> > _labels, GLfloat _cubeDimension, Alphabet *_alphabet);
245 
256  GLvoid init(QList< QPair<QString,GLuint> > _labels, GLfloat _maxWidth, GLfloat _maxHeight, Alphabet *_alphabet, GLfloat _maxCubeDimension = 0.0f);
257 
258 };
259 
260 #endif // CUBESTRINGLIST_H
This class is used to draw a vertical list of CubeString. Look at CubeString to have a better specifi...
Definition: cubestringlist.h:31
GLboolean isRotating(GLuint _stringName, GLuint _letterName)
Check if a letter of the CubeString is already rotating.
Definition: cubestringlist.cpp:128
GLfloat stringsHeightDelta
Definition: cubestringlist.h:203
This class is used to draw, a string composed the horizontal justapposition of Different cubes on whi...
Definition: cubestring.h:37
QList< QPair< QString, GLuint > > splitLabels(QString _labels)
Split the QString in a QList of QPair.
Definition: cubestringlist.cpp:208
GLint getLabelCount()
Returns the number of labels in the CubeStringList.
Definition: cubestringlist.cpp:90
GLuint name
Definition: cubestringlist.h:200
CubeStringList(QList< QPair< QString, GLuint > > _labels, GLfloat _cubeDimension, Alphabet *_alphabet)
Creates a CubeStringList from a QList of QPair, the first item of each pair is the string to draw...
Definition: cubestringlist.cpp:21
GLfloat firstStringHeight
Definition: cubestringlist.h:202
QList< CubeString * > cubeStrings
Definition: cubestringlist.h:199
GLvoid draw(GLboolean simplifyForPicking=false)
Draws the CubeStringList at the current position.
Definition: cubestringlist.cpp:64
GLvoid startStringListRotation(GLint _angleStep, GLint _turns)
Start the rotation of the whole CubeStringList (woo-woo-wao).
Definition: cubestringlist.cpp:116
GLvoid startStringRotation(GLuint _stringName, GLint _angleStep, GLint _turns)
Start the rotation of a whole CubeString contained in the CubeStringList.
Definition: cubestringlist.cpp:111
~CubeStringList()
Safely destroy a CubeStringList.
Definition: cubestringlist.cpp:53
This class is used to keep a list of Letter (from this the name Alphabet) It provide access to Letter...
Definition: alphabet.h:33
GLfloat interline
Definition: cubestringlist.h:201
GLfloat setCurrentAngle(GLfloat _firstLetterAngle, GLfloat _nextLetterDelta=0.0f)
Set the current angle for the letters in the CubeString.
Definition: cubestringlist.cpp:133
GLvoid init(QList< QPair< QString, GLuint > > _labels, GLfloat _cubeDimension, Alphabet *_alphabet)
Common part to the constructors that uses the cubeDimension.
Definition: cubestringlist.cpp:225
GLvoid startLetterRotation(GLuint _stringName, GLuint _letterName, GLint _angleStep, GLint _turns)
Start the rotation of a single letter in a single CubeString contained in the CubeStrigList.
Definition: cubestringlist.cpp:106
GLvoid computeHeights(GLfloat _cubeDimension)
It compute the heights (firstStringHeight and stringsHeightDelta) basing on constructor parameters...
Definition: cubestringlist.cpp:148
CubeString * getCubeStringFromLabel(QString _label)
Return a pointer to the CubeString having the parameter label.
Definition: cubestringlist.cpp:186
CubeString * getCubeStringFromName(GLuint _name)
Return a pointer to the CubeString having the parameter OpenGL name.
Definition: cubestringlist.cpp:164
QString getLabel(GLuint _stringName)
Returns the label which name is _stringName.
Definition: cubestringlist.cpp:95