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

Tournamenttournament
int round
bool picks
 picks visible
int x0
int y0
int dx
int dy
QTimer * timer
GameanimatedGame
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)
TeamfindTeamFromCoordinates (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.

Canvas::~Canvas (  ) 

Definition at line 17 of file canvas.cpp.


Member Function Documentation

void Canvas::animate (  )  [private, slot]

Definition at line 477 of file canvas.cpp.

QPainterPath Canvas::drawBracket ( int  x0,
int  y0,
int  ylink,
int  dx,
int  dy,
int  dashOffset 
) [private]

Definition at line 105 of file canvas.cpp.

void Canvas::drawBrackets ( void   )  [private]

Definition at line 121 of file canvas.cpp.

void Canvas::drawPicks ( int  round  )  [private]

draw Picks

Definition at line 206 of file canvas.cpp.

void Canvas::drawTeamInfo ( void   )  [private]

draws Team names and icons

Definition at line 150 of file canvas.cpp.

Team * Canvas::findTeamFromCoordinates ( int  x,
int  y 
) [private]

Definition at line 403 of file canvas.cpp.

QPen Canvas::getPenForTeam ( Team team  )  [private]

Definition at line 197 of file canvas.cpp.

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]

Definition at line 367 of file canvas.cpp.

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]

Definition at line 62 of file canvas.cpp.

void Canvas::setAnimationEndPoint ( int  end,
int  offset,
int  color 
)

Definition at line 470 of file canvas.cpp.

void Canvas::updateParentBracket ( int  ID  )  [private]

Updates parent brackets during animation

Parameters:
ID ID of parent bracket

Definition at line 448 of file canvas.cpp.


Member Data Documentation

Definition at line 60 of file canvas.h.

Definition at line 58 of file canvas.h.

int Canvas::animEnd [private]

Animation endpoint.

Definition at line 92 of file canvas.h.

const int Canvas::brcktHmargin = 10 [static, private]

Horizontal margin (space between Bracket and Team names).

Definition at line 81 of file canvas.h.

int Canvas::brcktVmargin [private]

Vertical margin between two brackets.

Definition at line 88 of file canvas.h.

int Canvas::colorStep [private]

Color interpolation step.

Definition at line 95 of file canvas.h.

int Canvas::dashOffset [private]

Definition at line 93 of file canvas.h.

QPen Canvas::decided [private]

Pen for decided games.

Definition at line 102 of file canvas.h.

Definition at line 52 of file canvas.h.

Definition at line 52 of file canvas.h.

int Canvas::fontheight [private]

Definition at line 103 of file canvas.h.

int Canvas::HMARGIN [private]

Horizontal margin of the Canvas.

Definition at line 86 of file canvas.h.

const int Canvas::LEFT = 1 [static, private]

Left side.

Definition at line 75 of file canvas.h.

const int Canvas::normalLen = 20 [static, private]

Definition at line 83 of file canvas.h.

QPainter* Canvas::painter [private]

Definition at line 97 of file canvas.h.

QPen Canvas::pen [private]

Definition at line 98 of file canvas.h.

const int Canvas::pickHeight = 12 [static, private]

Definition at line 82 of file canvas.h.

picks visible

Definition at line 47 of file canvas.h.

const int Canvas::RIGHT = -1 [static, private]

Right side.

Definition at line 77 of file canvas.h.

The position of the slider

Definition at line 45 of file canvas.h.

Definition at line 59 of file canvas.h.

int Canvas::STEP_DOWN = 3 [static]

Definition at line 36 of file canvas.h.

int Canvas::STEP_UP = -3 [static]

animation step

Definition at line 35 of file canvas.h.

QTimer* Canvas::timer

Animation variables

Definition at line 57 of file canvas.h.

The Tournament which should be drawn

Definition at line 41 of file canvas.h.

QPen Canvas::undecided [private]

Pen for undecided games.

Definition at line 100 of file canvas.h.

const int Canvas::VMARGIN = 50 [static, private]

Vertical margin of the Canvas.

Definition at line 79 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.

Definition at line 52 of file canvas.h.


The documentation for this class was generated from the following files:
Generated on Tue Jun 29 01:48:11 2010 for AdaptiviTree by  doxygen 1.6.3