VR-Forces 4.1.1 Class Documentation
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions
DtTTFUnitSymbolDrawer Class Reference

! Concrete class which interprets a string as Military Map Marking symbol, and draws it using a true type font. More...

Inheritance diagram for DtTTFUnitSymbolDrawer:
Inheritance graph
[legend]

Public Member Functions

 DtTTFUnitSymbolDrawer ()
 DtTTFUnitSymbolDrawer (const QString &family, int pointSize=24, const QColor &fillColor=QColor(128, 224, 225))
 ! Default to 24 point, force friendly blue.
virtual ~DtTTFUnitSymbolDrawer ()
virtual QSize calcBBox (const DtSymbol *const symbol) const
 Calculate the drawn size of this symbol.
virtual QRect calcBRect (const DtSymbol *const symbol) const
virtual unsigned int pixelSize (const DtMMMSymbol &) const
virtual void setPixelSize (unsigned int size)
virtual unsigned int pointSize () const
virtual void setPointSize (unsigned int size)
- Public Member Functions inherited from DtMMMDrawer
 DtMMMDrawer ()
 DtMMMDrawer (const QString &family, int pointSize=24, const QColor &fillColor=QColor(128, 224, 225))
 Default to 24 point, force friendly blue.
virtual ~DtMMMDrawer ()
- Public Member Functions inherited from DtTTSDrawer
 DtTTSDrawer ()
 DtTTSDrawer (const QString &family, int pointSize=24)
virtual ~DtTTSDrawer ()
virtual bool draw (QPainter &paint, const DtSymbol *const symbol) const
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 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 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 ()
 calcBBox intentionally not reimplemented. Same as parent.

Protected Member Functions

virtual void paintFont (QPainter &painter, int left, int base, const DtTTSSymbol &symbol) const
 ! Paint the font symbol on the device, so that its left, bottom corner is at the specified location.
virtual void paintFontOnPix (QPixmap *pix, const DtMMMSymbol *pSymbol) const
 Paint the string on a pixmap.
virtual void paintFontOnPix (QImage *pix, const DtMMMSymbol *pSymbol) const
virtual void drawHighlightForPattern (QPainter &paint, const DtMMMSymbol *pSymbol) const
virtual QSize fontSize (const DtMMMSymbol *) const
virtual QPoint calcOrigin (const DtTTSSymbol *pSymbol, 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.
- Protected Member Functions inherited from DtMMMDrawer
virtual void drawSolid (QPainter &paint, const QPoint &, const DtMMMSymbol *pSymbol) const
 Paint the font symbol on the device, centered at the specified location, with a solid pattern.
virtual bool drawPattern (QPainter &paint, const QPoint &, const DtMMMSymbol *pSymbol) const
virtual void paintPix (QPainter &paint, const QPixmap *pix, const DtMMMSymbol *pSymbol) const
 paint pixmap on our device.
virtual bool drawFont (QPainter &paint, const QPoint &origin, const DtTTSSymbol &t) const
virtual bool drawSymbolAsBitmap (QPainter &painter, const QPoint &origin, const DtTTSSymbol &t) const
virtual const QPixmap * createPix (const DtTTSSymbol *s) const
 "create" means the caller is responsible for deleting the allocated memory.
virtual QImage * createBGMask (const DtMMMSymbol *pSymbol) const
 "create" means the caller is responsible for deleting the allocated memory.
virtual QImage * createDitherMask (const DtMMMSymbol *pSymbol) const
 "create" means the caller is responsible for deleting the allocated memory.
virtual QImage * createPercentDither (const DtMMMSymbol *pSymbol) const
 "create" means the caller is responsible for deleting the allocated memory.
virtual QImage * createPatternDither (const DtMMMSymbol *pSymbol) const
 "create" means the caller is responsible for deleting the allocated memory.
- Protected Member Functions inherited from DtTTSDrawer
virtual void setAppearance (const DtTTSSymbol &s) const
 Use symbol to set attributes.
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.
- 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.

Private Member Functions

 DtTTFUnitSymbolDrawer (const DtTTFUnitSymbolDrawer &orig)
DtTTFUnitSymbolDraweroperator= (const DtTTFUnitSymbolDrawer &orig)

Additional Inherited Members

- Protected Attributes inherited from DtTTSDrawer
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
- Static Protected Attributes inherited from DtSymbolDrawer
static double gDrawScalingFactor
static QColor theHighlightColor

Detailed Description

! Concrete class which interprets a string as Military Map Marking symbol, and draws it using a true type font.

Constructor & Destructor Documentation

DtTTFUnitSymbolDrawer::DtTTFUnitSymbolDrawer ( )
DtTTFUnitSymbolDrawer::DtTTFUnitSymbolDrawer ( const QString &  family,
int  pointSize = 24,
const QColor &  fillColor = QColor(128, 224, 225) 
)

! Default to 24 point, force friendly blue.

virtual DtTTFUnitSymbolDrawer::~DtTTFUnitSymbolDrawer ( )
virtual
DtTTFUnitSymbolDrawer::DtTTFUnitSymbolDrawer ( const DtTTFUnitSymbolDrawer orig)
private

Member Function Documentation

virtual QSize DtTTFUnitSymbolDrawer::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.

Reimplemented from DtTTSDrawer.

virtual QRect DtTTFUnitSymbolDrawer::calcBRect ( const DtSymbol *const  symbol) const
virtual

Reimplemented from DtSymbolDrawer.

virtual unsigned int DtTTFUnitSymbolDrawer::pixelSize ( const DtMMMSymbol ) const
virtual
virtual void DtTTFUnitSymbolDrawer::setPixelSize ( unsigned int  size)
virtual
virtual unsigned int DtTTFUnitSymbolDrawer::pointSize ( ) const
virtual
virtual void DtTTFUnitSymbolDrawer::setPointSize ( unsigned int  size)
virtual
static DtSymbolDrawer* DtTTFUnitSymbolDrawer::create ( )
static

calcBBox intentionally not reimplemented. Same as parent.

Reimplemented from DtMMMDrawer.

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

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

Reimplemented from DtMMMDrawer.

virtual void DtTTFUnitSymbolDrawer::paintFontOnPix ( QPixmap *  pix,
const DtMMMSymbol pSymbol 
) const
protectedvirtual

Paint the string on a pixmap.

Reimplemented from DtMMMDrawer.

virtual void DtTTFUnitSymbolDrawer::paintFontOnPix ( QImage *  pix,
const DtMMMSymbol pSymbol 
) const
protectedvirtual

Reimplemented from DtMMMDrawer.

virtual void DtTTFUnitSymbolDrawer::drawHighlightForPattern ( QPainter &  paint,
const DtMMMSymbol pSymbol 
) const
protectedvirtual

Reimplemented from DtMMMDrawer.

virtual QSize DtTTFUnitSymbolDrawer::fontSize ( const DtMMMSymbol ) const
protectedvirtual

Reimplemented from DtMMMDrawer.

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

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 from DtMMMDrawer.

DtTTFUnitSymbolDrawer& DtTTFUnitSymbolDrawer::operator= ( const DtTTFUnitSymbolDrawer orig)
private

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

Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)