Main Page | Modules | Class Hierarchy | Class List | File List | Class Members | Related Pages

QPainterZoom Class Reference
[Painter and Devices]

#include <QPainterZoom.h>

Inheritance diagram for QPainterZoom:

Painter List of all members.

Public Member Functions

void setFont (QFont)
void setFontSize (double)
void setFontFamily (int)
void setTextAlign (int)
void setFTFont (int)
 QPainterZoom (QPaintDevice *)
void drawFTSymbol (int nglyph, float xpos, float ypos)
void drawFTSymbolEnc (unsigned long code, float xpos, float ypos, int enc)
void drawText (double, double, QString)
void drawNoteLine (float xpos, float ypos, int height)
void drawLine (double, double, double, double)
void drawRect (QCoordsRect)
QCoordsRect getBoundingBox (int nglyph)
void setFTSize (int)
void drawRect (double, double, double, double)
void drawRect (int, int, int, int)
void drawStemBar (double, double, double, double)
void drawSlur (double, double, double, double, int)
void drawBrace (double, double, double)
void drawEllipse (float, float, float, float)
void drawEllipse (int, int, int, int)
void end ()
void setZoom (ZoomFactor)
void begin ()
void setRes (int, int)
void setPenColor (const QColor &)
void setPen (const QColor &)
void setPen (Qt::PenStyle)
void setBrush (const QColor &)
void setBrush (Qt::BrushStyle)
void drawLine (int, int, int, int)

Detailed Description

Tis class is a painter that can draw in a coordinate system. Coordinates are given in millimeter.


Constructor & Destructor Documentation

QPainterZoom::QPainterZoom (  QPaintDevice *  w  ) 
 

Constructor of the painter zoom by default the resolution is initialized to 50x50 The text alignment is defaulted to Align Left


Member Function Documentation

void QPainterZoom::begin (   )  [virtual]
 

Before we start drawing we have to call the begin instruction

Implements Painter.

void QPainterZoom::drawBrace (  double  ,
double  ,
double 
)  [virtual]
 

draws the brace at pos (x,y) of height h

Implements Painter.

void QPainterZoom::drawEllipse (  int  xsrc,
int  ysrc,
int  w,
int  h
) 
 

draws an ellipse

void QPainterZoom::drawEllipse (  float  ,
float  ,
float  ,
float 
)  [virtual]
 

draws an ellipse {(x1,y1),(x2,y2)}

Implements Painter.

void QPainterZoom::drawFTSymbol (  int  nglyph,
float  xpos,
float  ypos
)  [virtual]
 

This draw a musical font symbol But there is a little shift in the use of the bitmap I'd better use the bearing of the font.

Parameters:
nglyph the number of the glyph
xpos 

Implements Painter.

void QPainterZoom::drawFTSymbolEnc (  unsigned long  nglyph,
float  xpos,
float  ypos,
int  enc
)  [virtual]
 

This method draw a music symbol

Parameters:
nglyph is the glyph number
xpos is the x position
ypos is the y position
int enc is the encoding used (Home assignement of encodings) *

Ugly patch because stem does not start at the right position

Implements Painter.

void QPainterZoom::drawLine (  double  ,
double  ,
double  ,
double 
)  [virtual]
 

draws the line {(x1,y1),(x2,y2)}

Implements Painter.

void QPainterZoom::drawNoteLine (  float  xpos,
float  ypos,
int  height
)  [virtual]
 

Deprecated:

Implements Painter.

void QPainterZoom::drawRect (  double  xsrc,
double  ysrc,
double  x2,
double  y2
)  [virtual]
 

There we set the size of the pen for the zoom factor we shall not do that if the size of the pen is 0 So there should be a conditionnal statement.

Parameters:
x1 upper left corner x
y1 upper left corner y
x2 lower right corner x
y2 lower right corner y

The set Pen line is incorrect. It must take in account thet the X resolution can differ from the Y resolution so the pen maybe not a square we may remedy this by using the world transformation.

Implements Painter.

void QPainterZoom::drawRect (  QCoordsRect  r  ) 
 

this is an override function

void QPainterZoom::drawSlur (  double  ,
double  ,
double  ,
double  ,
int 
)  [virtual]
 

draws the brace tying {(x1,y1),(x2,y2)} of direction d

Implements Painter.

void QPainterZoom::drawStemBar (  double  ,
double  ,
double  ,
double 
)  [virtual]
 

draws the stem bar {(x1,y1),(x2,y2)}

Implements Painter.

void QPainterZoom::drawText (  double  x,
double  y,
QString  label
)  [virtual]
 

Draws text at (x,y) with the text label

Parameters:
x 
y 
label 

Implements Painter.

void QPainterZoom::end (   )  [virtual]
 

Some painter require a end paint instruction

Implements Painter.

QCoordsRect QPainterZoom::getBoundingBox (  int  nglyph  )  [virtual]
 

Returns:
The bounding box of the glyph (Its a simple glyph)

Implements Painter.

void QPainterZoom::setBrush (  Qt::BrushStyle  bs  )  [virtual]
 

Sets the brush to the param style

Implements Painter.

void QPainterZoom::setBrush (  const QColor &  col  )  [virtual]
 

Set the brush - The brush is the fill of the rectangle or ellipse that we draw

Implements Painter.

void QPainterZoom::setFont (  QFont   )  [virtual]
 

Function related to the main font

Implements Painter.

void QPainterZoom::setFontFamily (  int  ffam  )  [virtual]
 

This sets the font family

Implements Painter.

void QPainterZoom::setFontSize (  double  fs  )  [virtual]
 

This set the font size

Implements Painter.

void QPainterZoom::setFTFont (  int  ftindex  )  [virtual]
 

This method set the current font

Implements Painter.

void QPainterZoom::setFTSize (  int  s  )  [virtual]
 

Set the musical font size

Implements Painter.

void QPainterZoom::setPen (  Qt::PenStyle   )  [virtual]
 

sets the pen

Implements Painter.

void QPainterZoom::setPen (  const QColor &   )  [virtual]
 

sets the pen color

Implements Painter.

void QPainterZoom::setPenColor (  const QColor &  c  )  [virtual]
 

Set the pen Color

Implements Painter.

void QPainterZoom::setRes (  int  rx,
int  ry
) 
 

This sets the resolution of the painter

Parameters:
rx number of pixel per inch
ry number of pixel per inch

void QPainterZoom::setTextAlign (  int  i  )  [virtual]
 

Set the text alignmenent

Parameters:
i can be ALIGN_LEFT, ALIGN_CENTER ALIGN_RIGHT

Implements Painter.

void QPainterZoom::setZoom (  ZoomFactor  z  ) 
 

We assume that 65 is the default resolution for a screen But it is based on experience to match the resolution of the font and the resoltion of the painter


The documentation for this class was generated from the following files:
Generated on Tue Jun 1 21:13:35 2004 for Alternate Take by doxygen 1.3.6