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

This class is intended for drawing military map marking symbols. More...

Inheritance diagram for DtTTFUnitSymbol:
Inheritance graph
[legend]

Public Member Functions

 DtTTFUnitSymbol (DtSymbolDrawer &drawer, unsigned short echelonUnicodeChar=0, unsigned short outlineUnicodeChar=0, unsigned short fillUnicodeChar=0)
 DtTTFUnitSymbol (DtNullDrawer &drawer, unsigned short echelonUnicodeChar=0, unsigned short outlineUnicodeChar=0, unsigned short fillUnicodeChar=0)
 DtTTFUnitSymbol (const DtTTFUnitSymbol &orig)
DtTTFUnitSymboloperator= (const DtTTFUnitSymbol &orig)
virtual ~DtTTFUnitSymbol ()
virtual DtSymbolclone () const
 Create a clone of this symbol.
virtual void setFont (const QFont &font)
virtual void setPointSize (const unsigned ptSize)
virtual void setScaleBy (double)
 Scaling factors.
virtual const QRect & fontBoundingRect () const
virtual const int width () const
virtual const int height () const
virtual void initializeSymbol (unsigned short echelonUnicodeChar=0, unsigned short outlineUnicodeChar=0, unsigned short fillUnicodeChar=0)
 mutators / accessors
virtual const unsigned short & echelonUnicodeChar () const
virtual void setEchelonUnicodeChar (const unsigned short &unicodeChar)
virtual const unsigned short & outlineUnicodeChar () const
virtual void setOutlineUnicodeChar (const unsigned short &unicodeChar)
virtual const unsigned short & fillUnicodeChar () const
virtual void setFillUnicodeChar (const unsigned short &unicodeChar)
virtual const unsigned short & deadUnicodeChar () const
virtual void setDeadUnicodeChar (const unsigned short &unicodeChar)
virtual const QString & echelonStr () const
virtual void setEchelonStr (const QString &string)
virtual const QString & outlineStr () const
virtual void setOutlineStr (const QString &string)
virtual const QString & fillStr () const
virtual void setFillStr (const QString &string)
virtual const QString & deadStr () const
virtual void setDeadStr (const QString &string)
virtual bool isDead () const
virtual void setIsDead (bool isDead)
- Public Member Functions inherited from DtMMMSymbol
 DtMMMSymbol (DtSymbolDrawer &drawer, const QString &string=QString(), const QString &altString=QString())
 Constructor.
 DtMMMSymbol (DtNullDrawer &drawer, const QString &string=QString(), const QString &altString=QString())
 Constructor.
 DtMMMSymbol (const DtMMMSymbol &orig)
 Copy Constructor.
DtMMMSymboloperator= (const DtMMMSymbol &orig)
 Assignment Operatior.
virtual ~DtMMMSymbol ()
 Destructor.
virtual Qt::BrushStyle fillStyle () const
virtual void setFillStyle (const Qt::BrushStyle style)
virtual const QColor & fillColor () const
virtual void setFillColor (const QColor &color)
virtual void setBackgroundChar (const QChar &)
 This is the character that will be drawn with the background color before the real drawing.
virtual const QChar & backgroundChar () const
- Public Member Functions inherited from DtTTSSymbol
 DtTTSSymbol (DtSymbolDrawer &drawer, const QString &string=QString(), const QString &altString=QString())
 Constructors / assignment operator / destructor.
 DtTTSSymbol (DtNullDrawer &drawer, const QString &string=QString(), const QString &altString=QString())
 DtTTSSymbol (const DtTTSSymbol &orig)
DtTTSSymboloperator= (const DtTTSSymbol &orig)
virtual ~DtTTSSymbol ()
virtual const QString & string () const
 member data i/o
virtual void setString (const QString &string)
virtual const QString & altString () const
virtual void setAltString (const QString &name)
virtual void setUseAltString (bool value)
 Use the alt name if it exists.
virtual bool useAltString () const
virtual Qt::PenStyle penStyle () const
virtual void setPenStyle (const Qt::PenStyle style)
virtual const QColor & penColor () const
virtual void setPenColor (const QColor &color)
virtual unsigned pointSize () const
 Size can be set by point size or a conversion scale.
virtual void setScale (const unsigned scale)
virtual void setScaleToSize (DtTTSScaleToSize *scale)
 Set function that converts scale to point size.
virtual DtTTSScaleToSizescaleToSize () const
virtual void setDegreesRotated (double)
virtual double degreesRotated () const
virtual void setRotationOption (DtRotationOption)
virtual DtRotationOption rotationOption () const
virtual void setRotationPointOffset (const QPoint &)
 Set custom rotation point relative to origin.
virtual const QPoint rotationCenter () const
 Returned value is calculated based on rotation option etc.
virtual const QFont * font () const
 Gets/sets font.
virtual void setFontname (const QString &name)
virtual const QString & fontname () const
virtual void setConstrainToSize (const QSize &size)
virtual void clearConstrainToSize ()
virtual bool constrainToSize () const
virtual const QSize & constrainedSize () const
virtual bool isScalable () const
 Return true/false if this is a scalable symbol. By default returns false.
bool operator== (const DtTTSSymbol &orig) const
bool operator!= (const DtTTSSymbol &orig) const
virtual bool transparentCacheChanged () const
virtual void setShadowText (bool)
virtual bool shadowText () const
virtual void setFontScalingFactor (double scale)
 Scale is between 0 and 1, and is multiplied against the current font size to get a new font size.
virtual double fontScalingFactor () const
virtual const QString & bitmapSymbolCacheKey () const
 Returns a cache key that can be used to lookup in a bitmap cache.
virtual void setHighlight (const bool highlight)
 Set/get the highlight flag (whether the symbol should be drawn highlighted).
- Public Member Functions inherited from DtColorizedSymbol
 DtColorizedSymbol (DtSymbolDrawer &d)
 Constructor.
virtual ~DtColorizedSymbol ()
 Destructor.
 DtColorizedSymbol (const DtColorizedSymbol &orig)
 Copy Constructor.
DtColorizedSymboloperator= (const DtColorizedSymbol &rhs)
 Assignment Operator.
virtual QColor * color () const
virtual void setColor (const QColor &col)
 Noop function to allow subclasses to override.
virtual void clearColor ()
 Noop function to allow subclasses to clear out any color information.
bool operator== (const DtColorizedSymbol &orig) const
bool operator!= (const DtColorizedSymbol &orig) const
virtual int lineWidth () const
 Width of line. Set to -1 to use drawer default.
virtual void setLineWidth (int i)
- Public Member Functions inherited from DtSymbol
virtual ~DtSymbol ()
 destructor
 DtSymbol (const DtSymbol &orig)
 copy constructor
DtSymboloperator= (const DtSymbol &orig)
 assignment operator Note that the copy constructor, by default, make the symbol non editable even if the source is editable
 DtSymbol (DtSymbolDrawer &drawer)
 Drawer is non-const since it does memory management.
virtual void copyDataFrom (const DtSymbol *symbol)
 Differs from the equal operator in that this method could copy a different set of data than the = operator.
virtual void setName (const QString &name)
 The specific name of this symbol.
virtual const QString & name () const
virtual bool highlight () const
virtual bool selected () const
virtual const DtDisplayPoint centerPoint () const
 The real visual center of the symbol in display coordinates.
virtual const DtDisplayPoint topLeftPoint () const
 The real visual top left corner of the symbol in display coordinates.
virtual bool setLocationData (const QPolygon *)
 This function is used so that multipoint symbols have the same interface as single point symbols In the single point case, it takes the first value and sets the origin from that.
virtual const QPolygon * getLocationData () const
 Provided for a simpler interface to subclasses.
virtual void setOrigin (const QPoint &center)
 Set the display coordinate that will become the 0,0 point for drawing this symbol.
virtual void setOrigin (int x, int y)
 Same as above.
virtual const QPoint origin () const
 returns the display origin for the symbol.
virtual void shift (QPoint p)
 Move the center of this object by p amount.
virtual void draw (QPainter &paint) const
virtual void drawHidden (QPainter &paint) const
virtual const DtSymbolDrawerdrawer () const
virtual QSize bbox () const
 the bounding box - this queries the drawer
virtual QRect brect () const
virtual QRect selBbox () const
 the selection box (area where you can select an item)
virtual void clearOffsetToParent ()
 Set/get the offset to the parent.
virtual void setOffsetToParent (const QPoint &offsetToParent)
virtual const QPoint * offsetToParent () const
 if the offsetToParent blit has been cleared, this returns null
virtual bool show (DtShowHideContext module)
 Shows/hides the symbol.
virtual bool hide (DtShowHideContext module)
virtual void show ()
 Use this method to show the symbol regardless of how many contexts have hidden it.
virtual void hide ()
 Use this method to hide a symbol without context. Same as hide(DtDefaultShowHideContext)
virtual void addIgnoreContext (DtShowHideContext)
 Add/remove contexts for hide() to ignore.
virtual void removeIgnoreContext (DtShowHideContext)
const QVector
< DtShowHideContext > & 
ignoreContexts () const
virtual void wasHidden (DtSymbol *)
 The following two methods are only called if the parent is hidden Called when a child symbol of this symbol is hidden.
virtual void wasShown (DtSymbol *)
 Called when a child symbol of this symbol is shown.
virtual bool isShown () const
virtual DtSymbolparent () const
virtual void setParent (DtSymbol *dad)
virtual bool isComposite ()
 -— Type information
virtual DtSymbolGeometry geometry () const
virtual void setGeometry (DtSymbolGeometry geom)
virtual void setCategoryTag (const QString &name)
 A tag is the name of this type of symbol such as velocity vector name or force or whatever.
virtual const QString & categoryTag () const
virtual bool select (const QPoint &aPoint)
 -— Mouse selecting options
virtual bool select (const QPoint &aPoint, const QSize &rectangleSize)
 Returns true if the rectangle intersects the symbol, if the symbol is selectable.
virtual void setSelectable (bool value)
 Set/get the ability to select with this symbol.
virtual bool isSelectable () const
virtual void setEditable (bool b)
 Accessors for whether or not this line can be edited.
virtual bool editable () const
virtual void setAllowEditOnSelection (bool b)
 Sets the fact that even if this symbol is not marked editable, it can become editable upon selection (myHighlight is true)
virtual bool allowEditOnSelection () const
virtual void setInternalSelectable (bool value)
 The following two functions are internal values kept in order to make sure that if an object has been filter modified and not shown, that it will not be selectable.
virtual bool isInternalSelectable () const
virtual void setAddToDrawOrder (bool b)
 Add this item to the draw order regardless of whether or not it is visible on the screen.
virtual bool addToDrawOrder () const
virtual bool overlapsSymbol (const DtSymbol &aSymbol, const DtSymbol_OverlapTest aTest=DtSymbol_BoxPieces, const float aTolerance=0) const
 Returns true if the two symbols overlap Different intersection tests are available.
virtual bool overlapsAreaSymbol (const DtSymbol &aSymbol, const DtSymbol_OverlapTest aTest=DtSymbol_BoxPieces, const float aTolerance=0) const
 handles the case when aSymbol spans an area, such as a bitmap or a text symbol.
virtual bool overlapsLineSymbol (DtSymbol &aSymbol, const float aTolerance=0) const
 handles the case when aSymbol is composed of line segments, such as a line, polygon, or route.
virtual bool isOriginal () const
 Returns true if this symbol is an original symbol, otherwise return false.
virtual DtStaticAnimDatastaticAnimData () const
virtual void setDrawOnComposite (DtSymbolCompositeDrawOptions opt)
 If true, will not draw this symbol if it is part of a composite symbol.
virtual bool drawOnComposite () const
virtual
DtSymbolCompositeDrawOptions 
drawOnCompositeValue () const
virtual bool drawFirst () const
 If true, this symbol will always be drawn first.
virtual void setDrawFirst (bool b)
virtual bool drawLast () const
 If true, this symbol will always be drawn last.
virtual void setDrawLast (bool b)
virtual bool selectAdditionalSymbols (QList< DtSymbol * > &additionalSymbols)
 This routine is called during symbol selection time to see if the selection of this symbol requires other symbols to be selected as well.
virtual bool forceUpdate () const
 Override this function and return true if this symbol wants to update every tick regardless of performance enhancements.
virtual bool adjustPoints (QPolygon &pnts, bool constrain)
 Opportunity to adjust the point array to some desired other points.
virtual void setDragClone (DtSymbol *clone)
 Contains the symbol that is being dragged that represents this symbol.
virtual DtSymboldragClone () const
virtual double scaleBy () const
virtual void enableVisibilityChange (bool b)
virtual void scheduleDisplayComplete (int)
 Sets a QTimer for the specified amount of time to fire off and then call the displayComplete() slot.
virtual void setShouldSelect (bool)
virtual bool shouldSelect () const
virtual void setTransparencyLevel (int)
 Transparency information.
virtual int transparencyLevel () const
virtual bool needsTransparentRedraw () const
 Will return true if there is no cached image or internal variables have changed such that the cached image needs a redraw.
virtual QPixmap * transparentImage () const
virtual QPixmap * cacheTransparentImage (const QPixmap &pixmap)
virtual QPixmap * cacheTransparentImage (const QImage &image)
virtual void cacheTransparentVariables ()
virtual bool wantsTransparentDraw () const
 Will return true if transparent percent is not 0 or 100.
bool operator== (const DtSymbol &orig) const
bool operator!= (const DtSymbol &orig) const
virtual DtSymbolDrawersymbolDrawer ()
 Sets the new drawer to be the supplied drawer.
virtual DtSymbolDrawersetDrawer (const DtSymbolDrawer &)
virtual DtSymbolDrawerbackupDrawer () const
 Returns the drawer that was set as a backup.
virtual void setBackupDrawer (DtSymbolDrawer *)
virtual bool removeIfOffScreen () const
 Return true/false if this symbol should be removed if it is off screen By default is true.
void setRemoveIfOffScreen (bool b)
 Default is true.
virtual void setSymbolDisplayOptions (DtSymbolDisplayOptions *)
virtual const
DtSymbolDisplayOptions
symbolDisplayOptions () const
virtual DtSymbolDisplayOptionssymbolDisplayOptions ()
virtual int displayOptionsCache () const
void setAdjustPoints (bool)
bool adjustPoints () const
const QVector
< DtShowHideContext > & 
hiddenByModules () const
 Routines to access which modules this symbol is hidden by.
bool hiddenByModule (DtShowHideContext module) const
virtual void blockSignals (bool)
 Blocks signals from being emitted from this symbol.
virtual bool originIsCenterOfMass () const
 Returns true if the origin is the center of mass (center of all points) in the symbol.
virtual void setCacheSymbolAsBitmap (bool)
 Get/set whether or not the drawer should cache this symbol as a bitmap.
bool cacheSymbolAsBitmap () const
virtual void reset ()
 Resets any relevant information associated with this symbol.
virtual bool editMode ()
 Set/get the edit mode option to enable update properties when hidden because of edition.
virtual void setEditMode (bool onOff)

Protected Member Functions

virtual QString internalBitmapSymbolCacheKey () const

Protected Attributes

unsigned short myEchelonUnicodeChar
 member data
unsigned short myOutlineUnicodeChar
unsigned short myFillUnicodeChar
unsigned short myDeadUnicodeChar
QString myEchelonStr
QString myOutlineStr
QString myFillStr
QString myDeadStr
bool myIsDead
bool myFontChanged
QRect myFontBoundingRect
- Protected Attributes inherited from DtMMMSymbol
Qt::BrushStyle myFillStyle
 data members
QColor myFillColor
QChar myBackgroundChar
- Protected Attributes inherited from DtTTSSymbol
QString myString
 data members
QString myAltString
bool myUseAltString
Qt::PenStyle myPenStyle
unsigned myPointSize
DtTTSScaleToSizemyScaleToSize
double myDegreesRotated
QPoint myRotationPointOffset
DtRotationOption myRotationOption
QString myFontname
QFont * myFont
bool myConstrainToSize
QSize myConstrainedSize
bool myShadowText
double myFontScalingFactor
bool myRecreateSymbolCacheKey
- Protected Attributes inherited from DtColorizedSymbol
QColor * myColor
int myLineWidth
- Protected Attributes inherited from DtSymbol
DtSymbolDrawermySymbolDrawer
DtSymbolDrawermyBackupDrawer
QPoint myOrigin
bool myActiveOffsetToParent
QPoint myOffsetToParent
bool myHighlight
bool myIsShown
bool myIsSelectable
bool myEditable
bool myInternalSelectable
QString myName
QString myCategoryTag
DtSymbolGeometry myGeometry
DtSymbolmyParent
DtSymbolmyDragClone
 If this symbol is being dragged, then this will point to the symbol that was cloned for the drag.
bool myIsOriginal
bool myAllowEditOnSelection
bool myAddToDrawOrder
double myScaleFactor
DtStaticAnimDatamyStaticAnimData
bool myEmitVisibilityChange
DtSymbol_DrawOrder myDrawOrder
QTimer * myTimer
DtSymbolCompositeDrawOptions myDrawOnComposite
bool myShouldSelect
 Set to true if part of a composite and a user has selected a part of the composite that should be selected.
int myTransparencyLevel
 Information for symbol transparency and transparent drawing.
QPixmap * myTransparentImage
DtSymbolmyTransparentCachedSymbol
DtSymbolDisplayOptionsmySymbolDisplayOptions
bool myAdjustPoints
QVector< DtShowHideContextmyHiddenByModules
QVector< DtShowHideContextmyIgnoreContexts
bool myRemoveIfOffscreen
bool myCacheSymbolAsBitmap
bool myEditMode
QString mySymbolBitmapCacheKey

Additional Inherited Members

- Public Types inherited from DtTTSSymbol
enum  DtRotationOption { DtOrigin = 0, DtBottomLeft, DtCustom }
- Public Slots inherited from DtSymbol
virtual void invalidateStaticAnimData ()
 This gets called when modified symbols exist and the original symbol has been destroyed.
virtual void displayComplete ()
 Call when the display of this symbol is complete.
virtual void clearDragClone (QObject *)
 Called when the drag clone is destroyed outside of this context, we will be notified in that case to clear out this symbols internal pointer.
- Signals inherited from DtSymbol
void originalSymbolDestroyed ()
 Sent when an original symbol has been destroyed - (so that the drawer can remove that cache)
void destroyed (const DtSymbol *)
 Called when we are destroyed, this will give our drawers a chance to update any cached information.
void originChanged (const DtSymbol *)
 Sent when setOrigin is called with a different origin.
void visibilityChanged (const DtSymbol *)
 Sent when visibility change sending is enabled and a symbol is shown or hidden when it wasn't before.
void displayComplete (const DtSymbol *)
 Called from displayComplete()
- Static Public Member Functions inherited from DtTTSSymbol
static void setDefaultPenColor (const QColor &c)
static const QColor & defaultPenColor ()
- Static Protected Attributes inherited from DtTTSSymbol
static QColor gDefaultPenColor

Detailed Description

This class is intended for drawing military map marking symbols.

It can draw just the echelon or echelon with a fill fill pattern. In addition it can draw the outline size decoration.

Constructor & Destructor Documentation

DtTTFUnitSymbol::DtTTFUnitSymbol ( DtSymbolDrawer drawer,
unsigned short  echelonUnicodeChar = 0,
unsigned short  outlineUnicodeChar = 0,
unsigned short  fillUnicodeChar = 0 
)
DtTTFUnitSymbol::DtTTFUnitSymbol ( DtNullDrawer drawer,
unsigned short  echelonUnicodeChar = 0,
unsigned short  outlineUnicodeChar = 0,
unsigned short  fillUnicodeChar = 0 
)
DtTTFUnitSymbol::DtTTFUnitSymbol ( const DtTTFUnitSymbol orig)
virtual DtTTFUnitSymbol::~DtTTFUnitSymbol ( )
virtual

Member Function Documentation

DtTTFUnitSymbol& DtTTFUnitSymbol::operator= ( const DtTTFUnitSymbol orig)
virtual DtSymbol* DtTTFUnitSymbol::clone ( ) const
virtual

Create a clone of this symbol.

Reimplemented from DtMMMSymbol.

virtual void DtTTFUnitSymbol::setFont ( const QFont &  font)
virtual

Reimplemented from DtTTSSymbol.

virtual void DtTTFUnitSymbol::setPointSize ( const unsigned  ptSize)
virtual

Reimplemented from DtTTSSymbol.

virtual void DtTTFUnitSymbol::setScaleBy ( double  factor)
virtual

Scaling factors.

Reimplemented from DtSymbol.

virtual const QRect& DtTTFUnitSymbol::fontBoundingRect ( ) const
virtual
virtual const int DtTTFUnitSymbol::width ( ) const
virtual
virtual const int DtTTFUnitSymbol::height ( ) const
virtual
virtual void DtTTFUnitSymbol::initializeSymbol ( unsigned short  echelonUnicodeChar = 0,
unsigned short  outlineUnicodeChar = 0,
unsigned short  fillUnicodeChar = 0 
)
virtual

mutators / accessors

initializeSymbol() call this after construction, to cause the appropriate QString versions to be computed and stored.

virtual const unsigned short& DtTTFUnitSymbol::echelonUnicodeChar ( ) const
virtual
virtual void DtTTFUnitSymbol::setEchelonUnicodeChar ( const unsigned short &  unicodeChar)
virtual
virtual const unsigned short& DtTTFUnitSymbol::outlineUnicodeChar ( ) const
virtual
virtual void DtTTFUnitSymbol::setOutlineUnicodeChar ( const unsigned short &  unicodeChar)
virtual
virtual const unsigned short& DtTTFUnitSymbol::fillUnicodeChar ( ) const
virtual
virtual void DtTTFUnitSymbol::setFillUnicodeChar ( const unsigned short &  unicodeChar)
virtual
virtual const unsigned short& DtTTFUnitSymbol::deadUnicodeChar ( ) const
virtual
virtual void DtTTFUnitSymbol::setDeadUnicodeChar ( const unsigned short &  unicodeChar)
virtual
virtual const QString& DtTTFUnitSymbol::echelonStr ( ) const
virtual
virtual void DtTTFUnitSymbol::setEchelonStr ( const QString &  string)
virtual
virtual const QString& DtTTFUnitSymbol::outlineStr ( ) const
virtual
virtual void DtTTFUnitSymbol::setOutlineStr ( const QString &  string)
virtual
virtual const QString& DtTTFUnitSymbol::fillStr ( ) const
virtual
virtual void DtTTFUnitSymbol::setFillStr ( const QString &  string)
virtual
virtual const QString& DtTTFUnitSymbol::deadStr ( ) const
virtual
virtual void DtTTFUnitSymbol::setDeadStr ( const QString &  string)
virtual
virtual bool DtTTFUnitSymbol::isDead ( ) const
virtual
virtual void DtTTFUnitSymbol::setIsDead ( bool  isDead)
virtual
virtual QString DtTTFUnitSymbol::internalBitmapSymbolCacheKey ( ) const
protectedvirtual

Reimplemented from DtMMMSymbol.

Member Data Documentation

unsigned short DtTTFUnitSymbol::myEchelonUnicodeChar
protected

member data

unsigned short DtTTFUnitSymbol::myOutlineUnicodeChar
protected
unsigned short DtTTFUnitSymbol::myFillUnicodeChar
protected
unsigned short DtTTFUnitSymbol::myDeadUnicodeChar
protected
QString DtTTFUnitSymbol::myEchelonStr
protected
QString DtTTFUnitSymbol::myOutlineStr
protected
QString DtTTFUnitSymbol::myFillStr
protected
QString DtTTFUnitSymbol::myDeadStr
protected
bool DtTTFUnitSymbol::myIsDead
protected
bool DtTTFUnitSymbol::myFontChanged
mutableprotected
QRect DtTTFUnitSymbol::myFontBoundingRect
mutableprotected

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)