My Project
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
Line Class Reference

#include <line.h>

Inheritance diagram for Line:

Public Member Functions

 Line (QWidget *parent=0)
 Constructor sets coordinates to 0, pen color to black and pen width to 1.
 
 Line (int fromX, int fromY, int toX, int toY, int w, QColor c, QWidget *parent=0)
 Constructor for a line, specifying the (fromX,fromY) and (toX,toY) More...
 
 Line (int fromX, int fromY, int length, double angle, int w, QColor c, QWidget *parent=0)
 Constructor for a line, specifying (fromX, fromY) and the length and angle. More...
 
void setCoords (int fromX, int fromY, int toX, int toY)
 Setter for the line coordinates. More...
 
void setpenColor (QColor c)
 Setter for the pen color. More...
 
void setPenWidth (int w)
 Setter for the pen width. More...
 
int getX0 ()
 Getter for the starting coordinate x. More...
 
int getY0 ()
 Getter for the starting coordinate y. More...
 
int getX1 ()
 Getter for the ending coordinate x. More...
 
int getY1 ()
 Getter for the ending coordinate y. More...
 

Protected Member Functions

void paintEvent (QPaintEvent *)
 The paint event function is automatically invoked whenever a resize or repaint happens.
 

Private Attributes

int x0
 
int y0
 
int x1
 
int y1
 
int penWidth
 
QColor penColor
 

Detailed Description

A class to describe lines.

Constructor & Destructor Documentation

Line::Line ( int  fromX,
int  fromY,
int  toX,
int  toY,
int  w,
QColor  c,
QWidget *  parent = 0 
)

Constructor for a line, specifying the (fromX,fromY) and (toX,toY)

Parameters
fromXstarting x coordinate
fromYstarting y coordinate
toXend x coordinate
toYend y coordinate
wpen width
cline color
parentparent of this line
Line::Line ( int  fromX,
int  fromY,
int  length,
double  angle,
int  w,
QColor  c,
QWidget *  parent = 0 
)

Constructor for a line, specifying (fromX, fromY) and the length and angle.

Parameters
fromXstarting x coordinate
fromYstarting y coordinate
lengthlength of the line
angleangle
wpen width
cline color
parentparent of this line

Member Function Documentation

int Line::getX0 ( )

Getter for the starting coordinate x.

Returns
starting coordinate x.
int Line::getX1 ( )

Getter for the ending coordinate x.

Returns
ending coordinate x.
int Line::getY0 ( )

Getter for the starting coordinate y.

Returns
starting coordinate y.
int Line::getY1 ( )

Getter for the ending coordinate y.

Returns
ending coordinate y.
void Line::setCoords ( int  fromX,
int  fromY,
int  toX,
int  toY 
)

Setter for the line coordinates.

Parameters
fromXstarting x coordinate
fromYstarting y coordinate
toXend x coordinate
toYend y coordinate
void Line::setpenColor ( QColor  c)

Setter for the pen color.

Parameters
cline color
void Line::setPenWidth ( int  w)

Setter for the pen width.

Parameters
wpen width

Member Data Documentation

QColor Line::penColor
private

pen color / color del boligrafo

int Line::penWidth
private

pen width / ancho del boligrafo

int Line::x0
private

initial coord x / coordenada inicial x

int Line::x1
private

ending coord x / coordenada final x

int Line::y0
private

initial coord y / coordenada inicial y

int Line::y1
private

ending coord y / coordenada final y


The documentation for this class was generated from the following files: