Canvas Class Reference
Draws the Tournament tree, Team names, icons, and Picks.
More...
#include <canvas.h>
List of all members.
Public Member Functions |
| Canvas (QWidget *parent) |
| ~Canvas () |
void | setAnimationEndPoint (int end, int offset, int color) |
void | init (void) |
| Sets up the canvas for the first time.
|
Public Attributes |
Tournament * | tournament |
int | round |
bool | picks |
| picks visible
|
int | x0 |
int | y0 |
int | dx |
int | dy |
QTimer * | timer |
Game * | animatedGame |
int | step |
bool | animated |
Static Public Attributes |
static int | STEP_UP = -3 |
| animation step
|
static int | STEP_DOWN = 3 |
Protected Member Functions |
void | mousePressEvent (QMouseEvent *mevent) |
Private Slots |
void | animate () |
Private Member Functions |
void | paintEvent (QPaintEvent *pevent) |
| Draws the Canvas. Always called when something has changed in the data.
|
void | resizeEvent (QResizeEvent *revent) |
void | initBracketPositions (int id, int num, int y0, int dy, int level) |
QPainterPath | drawBracket (int x0, int y0, int ylink, int dx, int dy, int dashOffset) |
void | drawBrackets (void) |
void | drawTeamInfo (void) |
| draws Team names and icons
|
void | drawPicks (int round) |
| draw Picks
|
void | updateParentBracket (int ID) |
bool | isDrawn (Game *game) |
QPen | getPenForTeam (Team *team) |
Team * | findTeamFromCoordinates (int x, int y) |
Private Attributes |
int | HMARGIN |
| Horizontal margin of the Canvas.
|
int | brcktVmargin |
| Vertical margin between two brackets.
|
int | animEnd |
| Animation endpoint.
|
int | dashOffset |
int | colorStep |
| Color interpolation step.
|
QPainter * | painter |
QPen | pen |
QPen | undecided |
| Pen for undecided games.
|
QPen | decided |
| Pen for decided games.
|
int | fontheight |
Static Private Attributes |
static const int | LEFT = 1 |
| Left side.
|
static const int | RIGHT = -1 |
| Right side.
|
static const int | VMARGIN = 50 |
| Vertical margin of the Canvas.
|
static const int | brcktHmargin = 10 |
| Horizontal margin (space between Bracket and Team names).
|
static const int | pickHeight = 12 |
static const int | normalLen = 20 |
Detailed Description
Draws the Tournament tree, Team names, icons, and Picks.
Definition at line 23 of file canvas.h.
Constructor & Destructor Documentation
Canvas::Canvas |
( |
QWidget * |
parent |
) |
|
- Parameters:
-
| parent | is the parent widget of Canvas |
Definition at line 6 of file canvas.cpp.
Member Function Documentation
void Canvas::animate |
( |
|
) |
[private, slot] |
QPainterPath Canvas::drawBracket |
( |
int |
x0, |
|
|
int |
y0, |
|
|
int |
ylink, |
|
|
int |
dx, |
|
|
int |
dy, |
|
|
int |
dashOffset | |
|
) |
| | [private] |
void Canvas::drawBrackets |
( |
void |
|
) |
[private] |
void Canvas::drawPicks |
( |
int |
round |
) |
[private] |
void Canvas::drawTeamInfo |
( |
void |
|
) |
[private] |
Team * Canvas::findTeamFromCoordinates |
( |
int |
x, |
|
|
int |
y | |
|
) |
| | [private] |
QPen Canvas::getPenForTeam |
( |
Team * |
team |
) |
[private] |
void Canvas::init |
( |
void |
|
) |
|
Sets up the canvas for the first time.
Initialises all important coordinates (x0,y0,dx,dy).
Definition at line 24 of file canvas.cpp.
void Canvas::initBracketPositions |
( |
int |
id, |
|
|
int |
num, |
|
|
int |
y0, |
|
|
int |
dy, |
|
|
int |
level | |
|
) |
| | [private] |
Recursively initializes Bracket positions
- Parameters:
-
| id | ID of the brackets |
| num | Number brackets per level |
| y0 | Top left corner of the Bracket |
| dy | Height of the Bracket |
| level | Depth level in the Tournament tree |
Definition at line 41 of file canvas.cpp.
bool Canvas::isDrawn |
( |
Game * |
game |
) |
[private] |
Indicates if an decided Game is already drawn
Definition at line 460 of file canvas.cpp.
void Canvas::mousePressEvent |
( |
QMouseEvent * |
mevent |
) |
[protected] |
void Canvas::paintEvent |
( |
QPaintEvent * |
pevent |
) |
[private] |
Draws the Canvas. Always called when something has changed in the data.
Definition at line 91 of file canvas.cpp.
void Canvas::resizeEvent |
( |
QResizeEvent * |
revent |
) |
[private] |
void Canvas::setAnimationEndPoint |
( |
int |
end, |
|
|
int |
offset, |
|
|
int |
color | |
|
) |
| | |
void Canvas::updateParentBracket |
( |
int |
ID |
) |
[private] |
Updates parent brackets during animation
- Parameters:
-
Definition at line 448 of file canvas.cpp.
Member Data Documentation
Animation endpoint.
Definition at line 92 of file canvas.h.
Horizontal margin (space between Bracket and Team names).
Definition at line 81 of file canvas.h.
Vertical margin between two brackets.
Definition at line 88 of file canvas.h.
Color interpolation step.
Definition at line 95 of file canvas.h.
Pen for decided games.
Definition at line 102 of file canvas.h.
Left side.
Definition at line 75 of file canvas.h.
picks visible
Definition at line 47 of file canvas.h.
Right side.
Definition at line 77 of file canvas.h.
The position of the slider
Definition at line 45 of file canvas.h.
animation step
Definition at line 35 of file canvas.h.
Animation variables
Definition at line 57 of file canvas.h.
Pen for undecided games.
Definition at line 100 of file canvas.h.
Top left corner of the Bracket P(x0,y0), width = dx and heigth = dy
Definition at line 52 of file canvas.h.
The documentation for this class was generated from the following files:
- C:/Users/admin/Documents/Visual Studio 2008/Projects/AdaptiviTree/AdaptiviTree/canvas.h
- C:/Users/admin/Documents/Visual Studio 2008/Projects/AdaptiviTree/AdaptiviTree/canvas.cpp