[krubik Index] [krubik Heirarchy]
3D Model of the Rubik's Cube More...
#include <cube.h>
Inherits: QWidget
This is the class Cube. It's a 3D model of the Rubik's Cube. It allows twising and turning of the model and also provides functions for saving and loading a cube, showing statistics, cleaning and srambling the cube etc.
The constructor method for class Cube
name | Name for QWidget |
parent | Parent widget, used for QWidget |
The destrucor method for class KFortune
Starts with a new cube. This means resetting the viewpoint and then calling clean
Cleans the cube.
Scrambles the cube.
Used for debugging
Save the cube to a file
Load a cube from a file
Sets the colors from the cube.
slot | The part of the cube of which the color must be set |
redraw | repaints the cube if true |
color | The color to be set |
Sets the shading level
level | Use values between 0 and 10, -1 means no shading |
Restore the cube-colors to some default value
redraw | repaints the cube if true |
Get's a color item from the color-list.
...
Only calls the function resizeEvent()
Handels all the resizing of the main window of KRubik
Handles a mousePressEvent from the user.
Handels mouseReleaseEvent.
Repaints the cube.
Used internally to set up some data.
Recreate the specified color. Used by @see #setShading and @see #setColor
Turns one side of the cube
redraw | repaints the cube if true |
sideNum | Number of the side to turn |
quads | Number of turns |
Splits the cube into 2 parts for twising. The data for the two sub-cubes are stored in topBlocks/botBlocks and topCorners/botCorners
Used by paintEvent to draw subcubes.
This signal is emitted whenever the state of the cube is changed. To be more specific :
The singal is emitted when :- the number of moves is changed - the cube is cleaned or a new cube is created - the cube is scrambled
The signal is not emitted when :
- the time has changed
| Kdoc |