VR-Forces 4.1 Class Documentation
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
DtTTSDrawer Class Reference

class DtTTSDrawer: More...

Inheritance diagram for DtTTSDrawer:
Inheritance graph
[legend]

Public Member Functions

 DtTTSDrawer ()
 DtTTSDrawer (const QString &family, int pointSize=24)
virtual ~DtTTSDrawer ()
virtual bool draw (QPainter &paint, const DtSymbol *const symbol) const
virtual QSize calcBBox (const DtSymbol *const symbol) const
 Calculate the drawn size of this symbol.
virtual void setFont (const QString &family, unsigned pointSize)
virtual void setFont (const QFont &font)
const QFont & font () const
virtual bool compareFamily (const QString &desiredFamily, const QFont &font) const
 Compare the desired family to the one actually loaded.
virtual QPoint calcOrigin (const DtTTSSymbol *s, bool calcBitmapOrigin=false) const
 Calculates the upper left corner of the text and sets the appearance font for drawing, so, if you call this routine, you do not need to call setAppearance.
virtual void paintFont (QPainter &painter, int left, int base, const DtTTSSymbol &symbol, const QColor &) const
 Paint the font symbol on the device, so that its left, bottom corner is at the specified location.
virtual void paintFont (QPainter &painter, QRect &rect, const DtTTSSymbol &t, const QColor &, int flags=0) const
virtual void setCenter (bool b)
 Sets whether or not to center the text. By default left jusitfies.
- Public Member Functions inherited from DtBaseSymbolDrawer
 DtBaseSymbolDrawer ()
virtual ~DtBaseSymbolDrawer ()
virtual bool doDrawing (QPainter &paint, const DtSymbol *const symbol)
 ! Initializes any drawing information and then calls internal draw() method
- Public Member Functions inherited from DtSymbolDrawer
 DtSymbolDrawer ()
virtual ~DtSymbolDrawer ()
virtual QRect calcBRect (const DtSymbol *const symbol) const
virtual bool forceUpdate (const DtSymbol *const symbol) const
 Override if your class wants to force a redraw of this item regardless of performance enhancement state.
virtual bool endTransparentDraw (QPainter &paint, const DtSymbol *const symbol) const
 Called after transparent draw is finished if symbol wants to draw transparently.
virtual void processHiddenSymbolAction (QPainter &paint, const DtSymbol *const symbol)
 Routine to perform even when symbol is hidden.

Static Public Member Functions

static DtSymbolDrawercreate ()

Protected Member Functions

virtual void setAppearance (const DtTTSSymbol &s) const
 Use symbol to set attributes.
virtual bool drawSymbolAsBitmap (QPainter &painter, const QPoint &origin, const DtTTSSymbol &t) const
virtual bool drawFont (QPainter &painter, const QPoint &origin, const DtTTSSymbol &t) const
virtual QString calcKey (const DtTTSSymbol &symbol) const
virtual void createFontKey ()
virtual QHash< QString,
QPixmap >::const_iterator 
insertPix (const DtTTSSymbol &symbol, const QPixmap *pix) const
 Cache management functions.
virtual const QPixmap * lookupPix (const DtTTSSymbol &symbol) const
 Cache management functions.
virtual const QPixmap * createPix (const DtTTSSymbol *pSymbol) const
 Cache management functions.
- Protected Member Functions inherited from DtBaseSymbolDrawer
virtual QRgb opaqueColor () const
 ! Returns color that will be ignored during transparent draw
- Protected Member Functions inherited from DtSymbolDrawer
 DtSymbolDrawer (const DtSymbolDrawer &orig)
 Protected so not used. Conceptually class is a singleton.
DtSymbolDraweroperator= (const DtSymbolDrawer &orig)
 Protected so not used. Conceptually class is a singleton.

Protected Attributes

QFont myFont
 Mutable since we are just saving this information for performance reasons.
QFont myDefaultFont
QFontMetrics myFontMetrics
bool myCenter
QHash< QString, QPixmap > myCache
 mutable since we are just saving this information for performance reasons.
QString myFontKey

Private Member Functions

 DtTTSDrawer (const DtTTSDrawer &orig)
DtTTSDraweroperator= (const DtTTSDrawer &orig)

Additional Inherited Members

- Static Protected Attributes inherited from DtSymbolDrawer
static double gDrawScalingFactor
static QColor theHighlightColor

Detailed Description

class DtTTSDrawer:

Concrete class which draws scaled strings using a true type font. Subclassed from BMP Drawer to support caching of font drawing to bitmaps (QPixmap). This is a faster way to draw under windows than font drawing (as of Qt 4.4.1)

Constructor & Destructor Documentation

DtTTSDrawer::DtTTSDrawer ( )
DtTTSDrawer::DtTTSDrawer ( const QString &  family,
int  pointSize = 24 
)
virtual DtTTSDrawer::~DtTTSDrawer ( )
virtual
DtTTSDrawer::DtTTSDrawer ( const DtTTSDrawer orig)
private

Member Function Documentation

virtual bool DtTTSDrawer::draw ( QPainter &  paint,
const DtSymbol *const  symbol 
) const
virtual

Implements DtSymbolDrawer.

virtual QSize DtTTSDrawer::calcBBox ( const DtSymbol *const  symbol) const
virtual

Calculate the drawn size of this symbol.

The symbol must be of a type this drawer can recognize.

Implements DtSymbolDrawer.

Reimplemented in DtTTFUnitSymbolDrawer.

virtual void DtTTSDrawer::setFont ( const QString &  family,
unsigned  pointSize 
)
virtual
virtual void DtTTSDrawer::setFont ( const QFont &  font)
virtual
const QFont& DtTTSDrawer::font ( ) const
virtual bool DtTTSDrawer::compareFamily ( const QString &  desiredFamily,
const QFont &  font 
) const
virtual

Compare the desired family to the one actually loaded.

virtual QPoint DtTTSDrawer::calcOrigin ( const DtTTSSymbol s,
bool  calcBitmapOrigin = false 
) const
virtual

Calculates the upper left corner of the text and sets the appearance font for drawing, so, if you call this routine, you do not need to call setAppearance.

Reimplemented in DtMMMDrawer, and DtTTFUnitSymbolDrawer.

virtual void DtTTSDrawer::paintFont ( QPainter &  painter,
int  left,
int  base,
const DtTTSSymbol symbol,
const QColor &   
) const
virtual

Paint the font symbol on the device, so that its left, bottom corner is at the specified location.

virtual void DtTTSDrawer::paintFont ( QPainter &  painter,
QRect &  rect,
const DtTTSSymbol t,
const QColor &  ,
int  flags = 0 
) const
virtual
virtual void DtTTSDrawer::setCenter ( bool  b)
virtual

Sets whether or not to center the text. By default left jusitfies.

static DtSymbolDrawer* DtTTSDrawer::create ( )
static

Reimplemented in DtTTFUnitSymbolDrawer, and DtMMMDrawer.

virtual void DtTTSDrawer::setAppearance ( const DtTTSSymbol s) const
protectedvirtual

Use symbol to set attributes.

virtual bool DtTTSDrawer::drawSymbolAsBitmap ( QPainter &  painter,
const QPoint &  origin,
const DtTTSSymbol t 
) const
protectedvirtual

Reimplemented in DtMMMDrawer.

virtual bool DtTTSDrawer::drawFont ( QPainter &  painter,
const QPoint &  origin,
const DtTTSSymbol t 
) const
protectedvirtual

Reimplemented in DtMMMDrawer.

virtual QString DtTTSDrawer::calcKey ( const DtTTSSymbol symbol) const
protectedvirtual
virtual QHash<QString, QPixmap>::const_iterator DtTTSDrawer::insertPix ( const DtTTSSymbol symbol,
const QPixmap *  pix 
) const
protectedvirtual

Cache management functions.

virtual const QPixmap* DtTTSDrawer::lookupPix ( const DtTTSSymbol symbol) const
protectedvirtual

Cache management functions.

virtual const QPixmap* DtTTSDrawer::createPix ( const DtTTSSymbol pSymbol) const
protectedvirtual

Cache management functions.

Reimplemented in DtMMMDrawer.

virtual void DtTTSDrawer::createFontKey ( )
protectedvirtual
DtTTSDrawer& DtTTSDrawer::operator= ( const DtTTSDrawer orig)
private

Member Data Documentation

QFont DtTTSDrawer::myFont
mutableprotected

Mutable since we are just saving this information for performance reasons.

We reset it for every symbol.

QFont DtTTSDrawer::myDefaultFont
mutableprotected
QFontMetrics DtTTSDrawer::myFontMetrics
mutableprotected
bool DtTTSDrawer::myCenter
protected
QHash<QString, QPixmap> DtTTSDrawer::myCache
mutableprotected

mutable since we are just saving this information for performance reasons.

QString DtTTSDrawer::myFontKey
protected

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

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)