This class is used to draw a vertical list of CubeString. Look at CubeString to have a better specification of the class. More...
#include <cubestringlist.h>
Public Member Functions | |
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, the second the OpenGL name you want to give the string. Using this constructor you can define the dimension of the cubes. More... | |
CubeStringList (QList< QPair< QString, GLuint > > _labels, GLfloat _maxWidth, GLfloat _maxHeight, Alphabet *_alphabet, GLfloat _maxCubeDimension=0.0f) | |
Creates a CubeStringList from a QList of QPair, the first item of each pair is the string to draw, the second the OpenGL name you want to give the string. Using this constructor you can define a maximum space the CubeStringList can grow, the class then will manage the list to fit this space. More... | |
CubeStringList (QString _labels, GLfloat _cubeDimension, Alphabet *_alphabet, GLuint _name=0) | |
Creates a CubeStringList from QString, it will be splitted on the character space to tokenize the string and create the list of words. You can also set the OpenGL name of the CubeStringList (the same for all the lines). Using this constructor you can define a maximum space the CubeStringList can grow, the class then will manage the list to fit this space. More... | |
CubeStringList (QString _labels, GLfloat _maxWidth, GLfloat _maxHeight, Alphabet *_alphabet, GLfloat _maxCubeDimension=0.0f, GLuint _name=0) | |
Creates a CubeStringList from QString, it will be splitted on the character space to tokenize the string and create the list of words. You can also set the OpenGL name of the CubeStringList (the same for all the lines). Using this constructor you can define a maximum space the CubeStringList can grow, the class then will manage the list to fit this space. More... | |
~CubeStringList () | |
Safely destroy a CubeStringList. | |
GLvoid | draw (GLboolean simplifyForPicking=false) |
Draws the CubeStringList at the current position. More... | |
GLint | getLabelCount () |
Returns the number of labels in the CubeStringList. More... | |
QString | getLabel (GLuint _stringName) |
Returns the label which name is _stringName. More... | |
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. More... | |
GLvoid | startStringRotation (GLuint _stringName, GLint _angleStep, GLint _turns) |
Start the rotation of a whole CubeString contained in the CubeStringList. More... | |
GLvoid | startStringListRotation (GLint _angleStep, GLint _turns) |
Start the rotation of the whole CubeStringList (woo-woo-wao). More... | |
GLboolean | isRotating (GLuint _stringName, GLuint _letterName) |
Check if a letter of the CubeString is already rotating. More... | |
GLfloat | setCurrentAngle (GLfloat _firstLetterAngle, GLfloat _nextLetterDelta=0.0f) |
Set the current angle for the letters in the CubeString. More... | |
Private Member Functions | |
GLvoid | computeHeights (GLfloat _cubeDimension) |
It compute the heights (firstStringHeight and stringsHeightDelta) basing on constructor parameters. More... | |
CubeString * | getCubeStringFromName (GLuint _name) |
Return a pointer to the CubeString having the parameter OpenGL name. More... | |
CubeString * | getCubeStringFromLabel (QString _label) |
Return a pointer to the CubeString having the parameter label. More... | |
QList< QPair< QString, GLuint > > | splitLabels (QString _labels) |
Split the QString in a QList of QPair. More... | |
GLvoid | init (QList< QPair< QString, GLuint > > _labels, GLfloat _cubeDimension, Alphabet *_alphabet) |
Common part to the constructors that uses the cubeDimension. More... | |
GLvoid | init (QList< QPair< QString, GLuint > > _labels, GLfloat _maxWidth, GLfloat _maxHeight, Alphabet *_alphabet, GLfloat _maxCubeDimension=0.0f) |
Common part to the constructors that uses the maxWidth and maxHeight. More... | |
Private Attributes | |
QList< CubeString * > | cubeStrings |
GLuint | name |
GLfloat | interline |
GLfloat | firstStringHeight |
GLfloat | stringsHeightDelta |
This class is used to draw a vertical list of CubeString. Look at CubeString to have a better specification of the class.
|
explicit |
Creates a CubeStringList from a QList of QPair, the first item of each pair is the string to draw, the second the OpenGL name you want to give the string. Using this constructor you can define the dimension of the cubes.
_labels | is a QList of QPair, the first item of each pair is the string to draw, the second the OpenGL name you want to give the string. |
_cubeDimension | is the dimension of each cube of the single CubeString. |
_alphabet | is the Alphabet to use. |
|
explicit |
Creates a CubeStringList from a QList of QPair, the first item of each pair is the string to draw, the second the OpenGL name you want to give the string. Using this constructor you can define a maximum space the CubeStringList can grow, the class then will manage the list to fit this space.
_labels | is a QList of QPair, the first item of each pair is the string to draw, the second the OpenGL name you want to give the string. |
_maxWidth | is the maximum width the CubeStringList can grow. |
_maxHeight | is the maximum height the CubeStringList can grow. |
_alphabet | is the Alphabet to use. |
_maxCubeDimension | is the maximum cubeDimension. If set to a number <= 0.0f it will not be computated. [default = 0.0f] |
|
explicit |
Creates a CubeStringList from QString, it will be splitted on the character space to tokenize the string and create the list of words. You can also set the OpenGL name of the CubeStringList (the same for all the lines). Using this constructor you can define a maximum space the CubeStringList can grow, the class then will manage the list to fit this space.
_labels | is the QString that will be splitted on the character space to create the list of words. |
_cubeDimension | is the dimension of each cube of the single CubeString. |
_alphabet | is the Alphabet to use. |
_name | is the OpenGL name of the CubeStringList (the same for all the lines). [default = 0] |
|
explicit |
Creates a CubeStringList from QString, it will be splitted on the character space to tokenize the string and create the list of words. You can also set the OpenGL name of the CubeStringList (the same for all the lines). Using this constructor you can define a maximum space the CubeStringList can grow, the class then will manage the list to fit this space.
_labels | is the QString that will be splitted on the character space to create the list of words. |
_maxWidth | is the maximum width the CubeStringList can grow. |
_maxHeight | is the maximum height the CubeStringList can grow. |
_alphabet | is the Alphabet to use. |
_maxCubeDimension | is the maximum cubeDimension. If set to a number <= 0.0f it will not be computated. [default = 0.0f] |
_name | is the OpenGL name of the CubeStringList (the same for all the lines). [default = 0] |
|
private |
It compute the heights (firstStringHeight and stringsHeightDelta) basing on constructor parameters.
_cubeDimension | is the dimension of the cubes. |
GLvoid CubeStringList::draw | ( | GLboolean | simplifyForPicking = false | ) |
Draws the CubeStringList at the current position.
simplifyForPicking | is the is used to draw a simplified scene used for the picking function and does not compute the change to angles. [default = false] |
|
private |
Return a pointer to the CubeString having the parameter label.
_label | is the label you want the CubeString. |
|
private |
Return a pointer to the CubeString having the parameter OpenGL name.
_name | is the OpenGL name you want the CubeString. |
QString CubeStringList::getLabel | ( | GLuint | _stringName | ) |
Returns the label which name is _stringName.
_stringName | is the name of the string you want the label. |
GLint CubeStringList::getLabelCount | ( | ) |
Returns the number of labels in the CubeStringList.
|
private |
Common part to the constructors that uses the cubeDimension.
_labels | is the QString that will be splitted on the character space to create the list of words. |
_cubeDimension | is the dimension of each cube of the single CubeString. |
_alphabet | is the Alphabet to use. |
|
private |
Common part to the constructors that uses the maxWidth and maxHeight.
_labels | is the QString that will be splitted on the character space to create the list of words. |
_maxWidth | is the maximum width the CubeStringList can grow. |
_maxHeight | is the maximum height the CubeStringList can grow. |
_alphabet | is the Alphabet to use. |
_maxCubeDimension | is the maximum cubeDimension. If set to a number <= 0.0f it will not be computated. [default = 0.0f] |
GLboolean CubeStringList::isRotating | ( | GLuint | _stringName, |
GLuint | _letterName | ||
) |
Check if a letter of the CubeString is already rotating.
_stringName | is the name of the string (it is the second name (after the entire list name) in the nameList of the picking function. You don't have to know which is, let the picking function and the CubeStringList code work for you. |
_letterName | is the name of the letter (it is the third name (after the entire list and the string names) in the nameList of the picking function. You don't have to know which is, let the picking function and the CubeStringList code work for you. |
GLfloat CubeStringList::setCurrentAngle | ( | GLfloat | _firstLetterAngle, |
GLfloat | _nextLetterDelta = 0.0f |
||
) |
Set the current angle for the letters in the CubeString.
_firstLetterAngle | is the angle of the current letter of the CubeStringList. |
_nextLetterDelta | is the delta you want to apply from the previous and the next letter's angle. [default = 0] |
|
private |
Split the QString in a QList of QPair.
_labels | is the QString to split. |
GLvoid CubeStringList::startLetterRotation | ( | GLuint | _stringName, |
GLuint | _letterName, | ||
GLint | _angleStep, | ||
GLint | _turns | ||
) |
Start the rotation of a single letter in a single CubeString contained in the CubeStrigList.
If you use this function when a letter is already rotating, the _turns will be summed to the current rotation but the new _angleStep will be used only if: (current angleStep) % _angleStep == 0 This is the only sure way to keep the validity.
_stringName | is the string that contains the letter you want to start the rotation. |
_letterName | is the name of the Letter (it is the second name (after the entire string name) in the nameList of the picking function. You don't have to know which is, let the picking function and the CubeString code work for you. |
_angleStep | is the angle that will be summed to letter on each frame. |
_turns | is an integer that states how many 90 degrees turns you want the letter to do. |
GLvoid CubeStringList::startStringListRotation | ( | GLint | _angleStep, |
GLint | _turns | ||
) |
Start the rotation of the whole CubeStringList (woo-woo-wao).
_angleStep | is the angle that will be summed to every letter on each frame. |
_turns | is an integer that states how many 90 degrees turns you want each letter to do. |
GLvoid CubeStringList::startStringRotation | ( | GLuint | _stringName, |
GLint | _angleStep, | ||
GLint | _turns | ||
) |
Start the rotation of a whole CubeString contained in the CubeStringList.
If you use this function when a CubeString is already rotating, the _turns will be summed to the current rotation but the new _angleStep will be used only if: (current angleStep) % _angleStep == 0 This is the only sure way to keep the validity.
_stringName | is the string you want to start the rotation. |
_angleStep | is the angle that will be summed to every letter on each frame. |
_turns | is an integer that states how many 90 degrees turns you want each letter to do. |
|
private |
It is the list of CubeStrings.
|
private |
It is the height of the first string of the list.
|
private |
It is the interline from one line to the following one.
|
private |
It is the OpenGL name of the CubeStringList.
|
private |
It is the delta from the centers of two strings in the list.