VR-Forces 4.0.4 Class Documentation
include/vrvCore/DtMilStdIconVisualizer.h
Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Copyright (c) 2011 MAK Technologies, Inc.
00003  * All rights reserved.
00004  *****************************************************************************/
00005 
00009 
00010 #pragma once
00011 
00012 #include <vrvCore/DtStateVisualizer.h>
00013 #include <vrvUtil/DtUnicode.h>
00014 
00015 namespace makVrv
00016 {
00017 
00018    class DtProjectedWidgetModelAgent;
00019    class DtWidgetAgent;
00020    class DtWidgetLabelAgent;
00021    class DtWidgetInstanceSignaler;
00022 
00027    class DT_DLL_VRVCORE DtMilStdIconVisualizer : public DtStateVisualizer
00028    {
00029    public:
00030 
00031       enum DrawMethod
00032       {
00033          DrawMethod_Bitmap,
00034          DrawMethod_Font,
00035       };
00036 
00037    public:
00038 
00040       DtMilStdIconVisualizer( DtBaseConnection& connection,
00041          DtStateListener& listener, int modelSet );
00042 
00044       virtual ~DtMilStdIconVisualizer();
00045 
00047       virtual void setVisualizerDefinition( const DtVisualizerDefinition& visDef );
00048 
00050       virtual void setModelDefinitionForAgents();
00051 
00053       virtual void setSelected( bool selected );
00054 
00056       void setDrawMethod( DrawMethod dt );
00057       DrawMethod drawMethod() const;
00058 
00060       void setOutlineEnabled( bool enabled );
00062       bool outlineEnabled() const;
00063 
00065       void setFillEnabled( bool enabled );
00067       bool fillEnabled() const;
00068 
00070       void setDamageEnabled( bool enabled );
00072       bool damageEnabled() const;
00073 
00075       void setIconEnabled( bool enabled );
00077       bool iconEnabled() const;
00078 
00079       void setIconScale( float scale );
00080 
00082       void setColorByAffiliationEnabled( bool enabled );
00084       bool colorByAffiliationEnabled() const;
00085 
00088       virtual void setForceId( int );
00089 
00090       int forceId() const
00091       {
00092          return myForceId;
00093       }
00094 
00097       virtual void setDamaged( bool );
00098       bool damaged() const
00099       {
00100          return myDamaged;
00101       }
00102 
00104       virtual void setForceColor( float r, float g, float b, float a );
00105       void getForceColor( double& r, double& g, double& b, double& a );
00106 
00111 
00112       virtual unsigned short outlineCharacterForUnitSymbolFont(
00113          unsigned short outlineBase, int force ) const;
00114 
00115       virtual unsigned short fillCharacterForUnitSymbolFont(
00116          unsigned short outlineBase, int force ) const;
00117 
00119       virtual DtUnicode generateSymbolString( float fillColor[4],
00120          float outlineColor[4], unsigned int fillGlyph,
00121          unsigned int outlineGlyph, bool damaged ) const;
00122 
00124       unsigned short outlineGlyph() const;
00125       unsigned short fillGlyph() const;
00126       unsigned short damageGlyph() const;
00127 
00128       virtual void setPickable( bool b );
00129 
00130    protected:
00131 
00132       virtual bool fillCharacterByOutline( unsigned short outline,
00133          unsigned short lower, unsigned short upper, unsigned short start,
00134          bool equipment, unsigned short& fill ) const;
00135 
00136       virtual unsigned short forceOffset( int force ) const;
00137 
00138       virtual void setHasMouse( bool hasMouse );
00139 
00142       virtual void stateChanged();
00143 
00147       virtual void displayChanged();
00148 
00149       virtual void createModelAgents();
00150       virtual void destroyModelAgents();
00151 
00152       virtual void update();
00153       virtual void updateSymbol();
00154       virtual void updateSelectedIcon();
00155 
00156    protected:
00157 
00159       DrawMethod myDrawMethod;
00160 
00162       bool myOutlineFlag;
00163       DtUnicodeChar myOutlineGlyph;
00164 
00166       bool myFillEnabledFlag;
00167       DtUnicodeChar myFillGlyph;
00168 
00170       bool myDamageEnabledFlag;
00171       DtUnicodeChar myDamageGlyph;
00172 
00174       bool myIconEnabledFlag;
00175 
00177       bool myColorByAffiliationFlag;
00178 
00179       DtProjectedWidgetModelAgent* myProjectIconPosition;
00180       DtWidgetAgent* myIcon;
00181       DtWidgetLabelAgent* myLabel;
00182       DtWidgetInstanceSignaler* myIconSignaler;
00183       DtWidgetAgent* mySelectedIcon;
00184       bool myHasMouse;
00185       DtUnicode mySymbolString;
00186       float myScale;
00187 
00188       int myForceId;
00189       bool myDamaged;
00190       bool myForceEffectsGlyphs;
00191       unsigned int myGlyphCenterPolicy;
00192       float myForceColor[4];
00193 
00194    };
00195 
00196 }

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)