VR-Forces 4.2 Class Documentation
List of all members | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions
DtBaseSymbolMapper Class Reference

Base class for all the symbol mappers override with your own mapper functions that know about DIS or HLA or otherwise. More...

Inheritance diagram for DtBaseSymbolMapper:
Inheritance graph
[legend]

Public Slots

virtual void setLabelColor (const QColor &color)
virtual void setUsingAnimation (bool b)
virtual void removeChainedMapper (QObject *)

Signals

void labelColorChanged (const QColor &color)

Public Member Functions

 DtBaseSymbolMapper ()
 DtBaseSymbolMapper (DtBaseSymbolMapper *)
 Calls chainSymbolMapper to add this symbol mapper into a chain to call down to create a symbol if this mapper does not create it.
virtual ~DtBaseSymbolMapper ()
virtual DtSymbolcreateSymbol (const DtModelData &d)
 Creates a symbol based on the specified type.
virtual void setDrawerColl (DtDrawerColl *dc)
virtual DtDrawerColldrawerColl () const
virtual bool init ()
 Initialize system to add creator functions.
virtual bool load (const char *filename, bool replace=false)
 Loads a file, or multiple files if the file buffer has file separated by a ; (semi-colon).
virtual bool save (const char *filename)
 Writes out contents to specified file.
virtual bool addSymbolToList (DtDescriptor *sd, bool replace=false)
virtual bool addSymbolToList (DtSymbolDescriptor *sd, bool replace=false)
virtual DtSymbolDescriptorgetStringKeyedSymbolDesc (const QString &key) const
 Uses straight string key rather than an entity identifier.
virtual void addStringKeyedSymbolToList (DtSymbolDescriptor *desc)
virtual void getSymbolDescriptors (DtSDList *list) const
 Fills the list will all the symbol descriptors in the entity keyed and string keyed lists.
virtual DtSymbolDescriptorfullLookup (const QString &key) const
 Returns a descriptor by looking in both trees.
virtual DtSymbolDrawerlookupDrawer (const DtDrawerKey &key, DtSymbolDescriptor *symDesc)
virtual DtSymbolDrawerlookupDrawer (DtSymbolDescriptor *symDesc)
virtual DtTTSDrawerlabelDrawer ()
virtual QColor labelColor () const
virtual void removeEntries (const DtBaseSymbolMapper &mapper)
 Removes symbols from entity list found in supplied mapper.
virtual void removeAllEntries (const DtSDList &mapper)
virtual void removeEntry (DtSymbolDescriptor *sd)
 Removes entry from all lists without deleting. To free memory, free descriptor.
virtual const DtSDListentities () const
virtual int defaultTransparencyFor (const DtEntityMapperKey &key) const
virtual void postLoadCleanup ()
 Does any post load cleanup of a new symbol map file.
virtual QPixmap getIcon (const DtModelData *d)
 Will return appropriate icon for supplied model.
virtual void setIconSize (const QSize size)
virtual QSize iconSize () const
virtual QPixmap finalizeSymbolPixmap (const DtSymbol *) const
const QString & filename () const
virtual void clear ()
virtual void addSymbolCreateCallback (int type, DtSymbolCreatorCallback fcn, void *usr=NULL)
 Accessors to add/remove callbacks for model data types.
virtual void removeSymbolCreateCallback (int type)
virtual DtSymbolDescriptorgetSymbolDesc (const DtEntityMapperKey &key) const
virtual DtSymbolDescriptorgetSymbolDesc (const DtModelData &data) const
virtual DtCompositeSymbolcreateSymbolOfType (const DtEntityMapperKey &type, int force, DtSymbolCreatorFcn fcn)
virtual void addPostCreateCallback (int iType, DtPostSymbolCreateCallbackFcn fcn, void *usr)
 Adds a callback to be invoked any time a symbol is created.
virtual void removePostCreateCallback (int iType, DtPostSymbolCreateCallbackFcn fcn, void *usr)
 Removes the post create callback if all three items match.
virtual void removeAllPostCreateCallbacks ()
 Removes all post update callbacks.
virtual DtSymbolcreateMainSymbol (const DtEntityMapperKey &emk, int force)
 Given the information, creates what would be the main symbol of the particular type.
virtual DtMapReadercreateReader (QString extension)
virtual QColor defaultColorFor (const DtEntityMapperKey &key) const
 Returns default color based on type of object.
virtual QColor defaultColorFor (const DtModelData &data) const
virtual DtTTSSymbolcreateLabelSymbol ()
virtual void setMediaMapper (DtBaseMapper *map)
virtual void addColor (const DtEntityMapperKey &, const QColor &)
 Adds default colors for object types.
virtual void addNameLabel (DtNameLabelSymbol *symbol)
virtual void addLabelLabel (DtNameLabelSymbol *symbol)
virtual void chainSymbolMapper (DtBaseSymbolMapper *)
virtual void clearCache ()
virtual void setDeleteChainedMappers (bool)
 If true, delete chained symbol mappers when destroying this object. Default is false.
virtual bool deleteChainedMappers () const
virtual void setCacheSymbolOptions (int)
 Sets the options for how to signal to cache text objects as bitmap.
int cacheSymbolOptions () const
virtual DtSymbolcreateSymbolFromDescription (DtSymbolDescriptor *symDesc, const DtEntityMapperKey &key)
virtual DtEnvironmentalModelDatacreateObject (const QString &object, QVector< DtPoint > &points, const QString &name=QString::null)
 If a symbol descriptor has the given name, then, create an object based on that mapper key.
- Public Member Functions inherited from DtBaseMapper
 DtBaseMapper ()
virtual ~DtBaseMapper ()
- Public Member Functions inherited from DtArchivableObject
 DtArchivableObject (QString name, DtArchivableObjectCreator fcn)
 This constructor will add this object to the archivable object factory.
 DtArchivableObject (QString name)
 DtArchivableObject ()
virtual ~DtArchivableObject ()
virtual QString name () const
DtArchiverarchiver ()
 Returns the archiver of this object.
virtual void read (QTextStream &s)
 Reads/writes archiver.
virtual void write (QTextStream &s)
virtual void setLevel (int i)
virtual int level () const
virtual DtArchivableObjectclone ()
 Allows for cloning of this object.

Static Public Member Functions

static DtBaseSymbolMappercreate ()
 Returns a newly created instance of a DtBaseSymbolMapper.
static void addReader (QString extension, DtMapReaderCreatorFcn fcn)
 Static functions to add instances of map readers.
static void cleanupReaders ()
 Call to cleanup memory owned by myMapReaders member.

Protected Member Functions

virtual void modifySymbol (DtSymbol *symbol, DtSymbolDescriptor *symDesc, int force, const DtEntityMapperKey &emk)
 Called after symbol is created, used to apply additional modifications to symbol.
virtual void removeEntry (DtSymbolDescriptor *sd, DtSDList &list)
virtual void invokePostCreateCallbacks (DtSymbol *, const DtModelData &)
virtual bool addEntry (DtSymbolDescriptor *sd, DtSDList &list, bool replace)

Protected Attributes

DtSymbolCreators myCreators
DtDrawerCollmyDrawerCollection
DtSDList myEntitySDList
DtSDList myOrderedList
QHash< QString,
DtSymbolDescriptor * > 
myStringKeyedSDList
DtNullDrawer myNullDrawer
DtTTSDrawer myLabelDrawer
DtBaseMappermyMediaMapper
DtOrderedKeyList< DtObjectColor * > myColors
QColor myLabelColor
bool myUsingAnimation
QSize myIconSize
QHash< QString, QPixmap * > myIconCache
QList< DtPostCreateCallbackInfomyPostCreateCallbacks
QString myFilename
DtPtrQList< DtBaseSymbolMapper * > myChainedMappers
bool myDeleteChainedMappers
QString myComment
int myCacheSymbolOptions
DtBaseSymbolMappermyParent
 If a parent exists, and, this symbol mapper does not have the symbol descriptor, check the parent.

Static Protected Attributes

static DtMapReadersmyMapReaders
static const QSize theDefaultIconSize

Private Member Functions

 DtBaseSymbolMapper (const DtBaseSymbolMapper &orig)
DtBaseSymbolMapperoperator= (const DtBaseSymbolMapper orig)

Detailed Description

Base class for all the symbol mappers override with your own mapper functions that know about DIS or HLA or otherwise.

This base class also doubles up as a null symbol mapper. - it always returns the null symbol on a create Symbol call

This class does not implement any default creators. Subclass from this class if you want to chain in your symbol mapper without dragging in other creators.

Subclass from one of the other symbol mappers to extend functionalit of that class and set the creator in the factory for the symbol mapper if you wish to replace that functionality (or add to it).

If you are creating the mapper as a plugin, subclass from this class, using the constructor that takes another symbol mapper (or call chainSymbolMapper() after you create yours)

Constructor & Destructor Documentation

DtBaseSymbolMapper::DtBaseSymbolMapper ( )
DtBaseSymbolMapper::DtBaseSymbolMapper ( DtBaseSymbolMapper )

Calls chainSymbolMapper to add this symbol mapper into a chain to call down to create a symbol if this mapper does not create it.

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

Member Function Documentation

virtual DtSymbol* DtBaseSymbolMapper::createSymbol ( const DtModelData d)
virtual

Creates a symbol based on the specified type.

If a mapping does not exist, a NULL symbol is returned

Reimplemented in DtOverlaySymbolMapper.

virtual void DtBaseSymbolMapper::setDrawerColl ( DtDrawerColl dc)
virtual
virtual DtDrawerColl* DtBaseSymbolMapper::drawerColl ( ) const
virtual
virtual bool DtBaseSymbolMapper::init ( )
virtual

Initialize system to add creator functions.

Reimplemented in DtOverlaySymbolMapper, and DtSymbolMapper.

virtual bool DtBaseSymbolMapper::load ( const char *  filename,
bool  replace = false 
)
virtual

Loads a file, or multiple files if the file buffer has file separated by a ; (semi-colon).

The result of the file load will be the creation of symbol descriptors. The load will look at the file extension ad try to match to a known reader. If the reader exists, an instance of that reader will be created and that reader will be told to load the file and populate this mapper with the results.

If replace is true, it will remove any current instance and replace with the new one found

virtual bool DtBaseSymbolMapper::save ( const char *  filename)
virtual

Writes out contents to specified file.

Written out in order of keys in internal lists, so file that is stored might be in a different order than read in. Calls down to map reader to do saving

virtual bool DtBaseSymbolMapper::addSymbolToList ( DtDescriptor sd,
bool  replace = false 
)
virtual

Implements DtBaseMapper.

virtual bool DtBaseSymbolMapper::addSymbolToList ( DtSymbolDescriptor sd,
bool  replace = false 
)
virtual
virtual DtSymbolDescriptor* DtBaseSymbolMapper::getStringKeyedSymbolDesc ( const QString &  key) const
virtual

Uses straight string key rather than an entity identifier.

virtual void DtBaseSymbolMapper::addStringKeyedSymbolToList ( DtSymbolDescriptor desc)
virtual
virtual void DtBaseSymbolMapper::getSymbolDescriptors ( DtSDList list) const
virtual

Fills the list will all the symbol descriptors in the entity keyed and string keyed lists.

This will return the contents of the ordered list

Implements DtBaseMapper.

virtual DtSymbolDescriptor* DtBaseSymbolMapper::fullLookup ( const QString &  key) const
virtual

Returns a descriptor by looking in both trees.

It will look in the string dictionary before the entity dictionary

virtual DtSymbolDrawer* DtBaseSymbolMapper::lookupDrawer ( const DtDrawerKey key,
DtSymbolDescriptor symDesc 
)
virtual
virtual DtSymbolDrawer* DtBaseSymbolMapper::lookupDrawer ( DtSymbolDescriptor symDesc)
virtual
virtual DtTTSDrawer& DtBaseSymbolMapper::labelDrawer ( )
virtual
virtual QColor DtBaseSymbolMapper::labelColor ( ) const
virtual
virtual void DtBaseSymbolMapper::removeEntries ( const DtBaseSymbolMapper mapper)
virtual

Removes symbols from entity list found in supplied mapper.

virtual void DtBaseSymbolMapper::removeAllEntries ( const DtSDList mapper)
virtual
virtual void DtBaseSymbolMapper::removeEntry ( DtSymbolDescriptor sd)
virtual

Removes entry from all lists without deleting. To free memory, free descriptor.

virtual const DtSDList& DtBaseSymbolMapper::entities ( ) const
virtual
virtual int DtBaseSymbolMapper::defaultTransparencyFor ( const DtEntityMapperKey key) const
virtual
virtual void DtBaseSymbolMapper::postLoadCleanup ( )
virtual

Does any post load cleanup of a new symbol map file.

virtual QPixmap DtBaseSymbolMapper::getIcon ( const DtModelData d)
virtual

Will return appropriate icon for supplied model.

Reimplemented in DtOverlaySymbolMapper.

virtual void DtBaseSymbolMapper::setIconSize ( const QSize  size)
virtual
virtual QSize DtBaseSymbolMapper::iconSize ( ) const
virtual
virtual QPixmap DtBaseSymbolMapper::finalizeSymbolPixmap ( const DtSymbol ) const
virtual
const QString & DtBaseSymbolMapper::filename ( ) const
inline

References myFilename.

virtual void DtBaseSymbolMapper::clear ( )
virtual
virtual void DtBaseSymbolMapper::addSymbolCreateCallback ( int  type,
DtSymbolCreatorCallback  fcn,
void *  usr = NULL 
)
virtual

Accessors to add/remove callbacks for model data types.

virtual void DtBaseSymbolMapper::removeSymbolCreateCallback ( int  type)
virtual
virtual DtSymbolDescriptor* DtBaseSymbolMapper::getSymbolDesc ( const DtEntityMapperKey key) const
virtual
virtual DtSymbolDescriptor* DtBaseSymbolMapper::getSymbolDesc ( const DtModelData data) const
virtual
virtual DtCompositeSymbol* DtBaseSymbolMapper::createSymbolOfType ( const DtEntityMapperKey type,
int  force,
DtSymbolCreatorFcn  fcn 
)
virtual
virtual void DtBaseSymbolMapper::addPostCreateCallback ( int  iType,
DtPostSymbolCreateCallbackFcn  fcn,
void *  usr 
)
virtual

Adds a callback to be invoked any time a symbol is created.

Use the type to specify the type that you want the callback for or -1 for all types

virtual void DtBaseSymbolMapper::removePostCreateCallback ( int  iType,
DtPostSymbolCreateCallbackFcn  fcn,
void *  usr 
)
virtual

Removes the post create callback if all three items match.

virtual void DtBaseSymbolMapper::removeAllPostCreateCallbacks ( )
virtual

Removes all post update callbacks.

Only call if you really want to disable these callbacks as they cannot be replaced without executing the code that originally added them

virtual DtSymbol* DtBaseSymbolMapper::createMainSymbol ( const DtEntityMapperKey emk,
int  force 
)
virtual

Given the information, creates what would be the main symbol of the particular type.

static DtBaseSymbolMapper* DtBaseSymbolMapper::create ( )
static

Returns a newly created instance of a DtBaseSymbolMapper.

Reimplemented in DtOverlaySymbolMapper, and DtSymbolMapper.

static void DtBaseSymbolMapper::addReader ( QString  extension,
DtMapReaderCreatorFcn  fcn 
)
static

Static functions to add instances of map readers.

static void DtBaseSymbolMapper::cleanupReaders ( )
static

Call to cleanup memory owned by myMapReaders member.

Current called as part of application cleanup

virtual DtMapReader* DtBaseSymbolMapper::createReader ( QString  extension)
virtual
virtual QColor DtBaseSymbolMapper::defaultColorFor ( const DtEntityMapperKey key) const
virtual

Returns default color based on type of object.

virtual QColor DtBaseSymbolMapper::defaultColorFor ( const DtModelData data) const
virtual
virtual DtTTSSymbol* DtBaseSymbolMapper::createLabelSymbol ( )
virtual
virtual void DtBaseSymbolMapper::setMediaMapper ( DtBaseMapper map)
virtual
virtual void DtBaseSymbolMapper::addColor ( const DtEntityMapperKey ,
const QColor &   
)
virtual

Adds default colors for object types.

virtual void DtBaseSymbolMapper::addNameLabel ( DtNameLabelSymbol symbol)
virtual
virtual void DtBaseSymbolMapper::addLabelLabel ( DtNameLabelSymbol symbol)
virtual
virtual void DtBaseSymbolMapper::chainSymbolMapper ( DtBaseSymbolMapper )
virtual
virtual void DtBaseSymbolMapper::clearCache ( )
virtual
virtual void DtBaseSymbolMapper::setDeleteChainedMappers ( bool  )
virtual

If true, delete chained symbol mappers when destroying this object. Default is false.

virtual bool DtBaseSymbolMapper::deleteChainedMappers ( ) const
virtual
virtual void DtBaseSymbolMapper::setCacheSymbolOptions ( int  )
virtual

Sets the options for how to signal to cache text objects as bitmap.

Currently only supports main symbol (font), name and label

int DtBaseSymbolMapper::cacheSymbolOptions ( ) const
inline

References myCacheSymbolOptions.

virtual DtSymbol* DtBaseSymbolMapper::createSymbolFromDescription ( DtSymbolDescriptor symDesc,
const DtEntityMapperKey key 
)
virtual
virtual DtEnvironmentalModelData* DtBaseSymbolMapper::createObject ( const QString &  object,
QVector< DtPoint > &  points,
const QString &  name = QString::null 
)
virtual

If a symbol descriptor has the given name, then, create an object based on that mapper key.

Default implementation returns NULL

Reimplemented in DtOverlaySymbolMapper.

virtual void DtBaseSymbolMapper::setLabelColor ( const QColor &  color)
virtualslot
virtual void DtBaseSymbolMapper::setUsingAnimation ( bool  b)
virtualslot
virtual void DtBaseSymbolMapper::removeChainedMapper ( QObject )
virtualslot
void DtBaseSymbolMapper::labelColorChanged ( const QColor &  color)
signal
virtual void DtBaseSymbolMapper::modifySymbol ( DtSymbol symbol,
DtSymbolDescriptor symDesc,
int  force,
const DtEntityMapperKey emk 
)
protectedvirtual

Called after symbol is created, used to apply additional modifications to symbol.

Reimplemented in DtOverlaySymbolMapper, and DtSymbolMapper.

virtual void DtBaseSymbolMapper::removeEntry ( DtSymbolDescriptor sd,
DtSDList list 
)
protectedvirtual
virtual void DtBaseSymbolMapper::invokePostCreateCallbacks ( DtSymbol ,
const DtModelData  
)
protectedvirtual
virtual bool DtBaseSymbolMapper::addEntry ( DtSymbolDescriptor sd,
DtSDList list,
bool  replace 
)
protectedvirtual
DtBaseSymbolMapper& DtBaseSymbolMapper::operator= ( const DtBaseSymbolMapper  orig)
private

Member Data Documentation

DtSymbolCreators DtBaseSymbolMapper::myCreators
protected
DtDrawerColl* DtBaseSymbolMapper::myDrawerCollection
protected
DtSDList DtBaseSymbolMapper::myEntitySDList
protected
DtSDList DtBaseSymbolMapper::myOrderedList
protected
QHash<QString, DtSymbolDescriptor*> DtBaseSymbolMapper::myStringKeyedSDList
protected
DtNullDrawer DtBaseSymbolMapper::myNullDrawer
protected
DtTTSDrawer DtBaseSymbolMapper::myLabelDrawer
protected
DtBaseMapper* DtBaseSymbolMapper::myMediaMapper
protected
DtOrderedKeyList<DtObjectColor*> DtBaseSymbolMapper::myColors
protected
QColor DtBaseSymbolMapper::myLabelColor
protected
bool DtBaseSymbolMapper::myUsingAnimation
protected
DtMapReaders* DtBaseSymbolMapper::myMapReaders
staticprotected
QSize DtBaseSymbolMapper::myIconSize
protected
QHash<QString, QPixmap*> DtBaseSymbolMapper::myIconCache
protected
QList<DtPostCreateCallbackInfo> DtBaseSymbolMapper::myPostCreateCallbacks
protected
const QSize DtBaseSymbolMapper::theDefaultIconSize
staticprotected
QString DtBaseSymbolMapper::myFilename
protected

Referenced by filename().

DtPtrQList<DtBaseSymbolMapper*> DtBaseSymbolMapper::myChainedMappers
protected
bool DtBaseSymbolMapper::myDeleteChainedMappers
protected
QString DtBaseSymbolMapper::myComment
protected
int DtBaseSymbolMapper::myCacheSymbolOptions
protected

Referenced by cacheSymbolOptions().

DtBaseSymbolMapper* DtBaseSymbolMapper::myParent
protected

If a parent exists, and, this symbol mapper does not have the symbol descriptor, check the parent.

Will walk the chain of parents to find it


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

Document ID: Generated on Sun Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)