VR-Forces 4.1 Class Documentation
List of all members | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions
makVrv::DtSymbolDecorationVisualizer Class Reference

Symbol decoration visualizer. More...

Inheritance diagram for makVrv::DtSymbolDecorationVisualizer:
Inheritance graph
[legend]

Public Member Functions

 DtSymbolDecorationVisualizer (DtBaseConnection &simulation, DtStateListener &listener, int modelSet, const std::string &decorationTag)
 CTOR.
virtual ~DtSymbolDecorationVisualizer ()
 DTOR Cleans up the model agents associated with this visualizer.
virtual void createModelAgents ()
virtual void destroyModelAgents ()
virtual void setModelDefinitionForAgents ()
virtual void setVisualizerDefinition (const DtVisualizerDefinition &visDef)
 Set any other additional visualizer information from the visual record.
virtual void setSelected (bool isSelected)
 Sets whether the this visualizer's entity is selected or not.
virtual
DtAttributeGroupWidgetAgent * 
widget ()
 get the attribute group widget
virtual
DtSymbolDecorationUpdaterAgent * 
widgetUpdater ()
 get the updater
virtual unsigned int nextLabelIndex ()
 Get the next index for decoration labels.
virtual DtSceneObjectAgent * sceneObject ()
 Get the scene object.
virtual void setDecorationsVisible (bool)
 Sets all decorations hidden/shown regardless of symbol decoration record status.
virtual void slot_decorationEnabled (const std::string &decoration)
 Called when a decoration is enabled.
virtual void slot_decorationDisabled (const std::string &decoration)
 Called when a decoration is disabled.
virtual void slot_foregroundColorChanged (float r, float g, float b)
 Called when the symbol decoration foreground color is changed.
virtual void slot_backgroundColorChanged (float r, float g, float b)
 Called when the symbol decoration background color is changed.
virtual void slot_backgroundOpacityChanged (float a)
 Called when the symbol decoration background opacity is changed.
virtual void slot_shadowTextChanged (bool enabled)
 Called when shadow text is enabled or disabled.
virtual void slot_setScale (float scale)
 Set size in points; this corresponds to scale * 32.0.
virtual void slot_setEnabled (bool enabled)
 Set the decoration visualizer enabled or disabled.
virtual void setScale (float scale)
 Set scale as a percentage of default size.
void setShowBorder (bool b)
 Set whether or not border is shown.
virtual DtSymbolDecorationfindSymbolDecoration (const std::string &decorationId)
 Return the symbol decoration for the specific id, else NULL.
virtual void setOffset (double x, double y)
 Sets the offset to use for all symbol decorations.
const DtVectoroffset () const
 Returns the current offset.
- Public Member Functions inherited from makVrv::DtStateVisualizer
 DtStateVisualizer (DtBaseConnection &connection, DtStateListener &listener, int modelSet)
 CTOR.
virtual ~DtStateVisualizer ()
 DTOR.
virtual const TypeInfotypeInfo () const =0
 Get the type info.
virtual void setParent (DtStateVisualizer *)
 Override to set the parent of this visualizer.
void setModelDefinition (const std::string &definition)
 Sets the model definition and creates agent(s) based on that definition.
const std::string & modelDefinition () const
 Gets the current model definition.
virtual bool setVisible (bool visible, int context)
 Returns true if this context wants to show or hide the item.
virtual void initialize ()
 Initialize the visualizer.
virtual bool isVisible () const
 Returns true if visible.
virtual bool selected () const
void setName (const std::string &)
 Internal name of state visualizer.
const std::string & name () const
virtual void setPickable (bool)
 Sets pickable state.
virtual bool pickable () const
virtual void setUniqueID (DtUniqueID id)
DtUniqueID uniqueID () const
int visualizerType () const
void setShowHideContext (const std::vector< int > &s)
 Set show/hide context without changing visibility of item.
DtStateListenerlistener ()
DtBaseConnectionsimulation ()
 Get the connection for this visualizer.
void setDistribute (bool b)
 Whether or not to distribute over the network.
bool distribute () const

Protected Types

typedef boost::unordered_map
< std::string,
DtSymbolDecoration * > 
DecorationIdMap
 Map type from symbol decoration name to symbol decoration.

Protected Member Functions

virtual void setBorderState ()
 Creates or destroys the border based on the current border state.
- Protected Member Functions inherited from makVrv::DtStateVisualizer
virtual void slot_mouseDown (DtMouseState &mouseState, const std::string &displayEngineName, const std::string &windowName, const std::string &channelName)
 Called when the mouse is clicked in this visualizer.
virtual void slot_mouseUp (DtMouseState &mouseState, const std::string &displayEngineName, const std::string &windowName, const std::string &channelName)
virtual void slot_mouseDblClick (DtMouseState &mouseState, const std::string &displayEngineName, const std::string &windowName, const std::string &channelName)
virtual bool hide (int context)
 Will call destroyModelAgents(), if, when the context is added, it is the first context in the list.
virtual bool show (int context)
 Will call createModelAgents(), if, when context is removed from myShowHideContexts, the list size is zero.
virtual bool supportsShowHideContext (int) const
 Default returns true.
template<typename T , typename C >
void connectAndUpdate (boost::signal< void(T)> &sig, void(C::*fp)(T), T val)
 Connect a signal and update the entity.

Protected Attributes

DtSignalConnectionManager mySignalConns
 Manager for boost connections.
DecorationIdMap myDecorationIdMap
 Map from creator names to decoration instances.
DtSymbolDecorationSettings::DecorationSet myDecorationSet
 Decoration set used to create decorations.
DtAttributeGroupWidgetAgent * myWidget
 Widget to show a layout of labels.
DtProjectedWidgetModelAgent * myWidgetModel
 Projecting widget to place the label widget at the 2d projection of the scene object's location.
DtSymbolDecorationUpdaterAgent * myWidgetUpdater
 Updater to keep the labels and heading indicator updated with distributed side state.
float myForegroundColor [3]
 Foreground color for the symbol decorations.
float myBackgroundColor [4]
 Background color for the symbol decorations.
float myScale
 Scale as a percentage of initial size.
DtVector myWidgetOffsetUnscaled
 Unscaled 2d offset of decorations from scene object origin z value is ignored.
float myFontSizeUnscaled
 Font size in points.
float myHeadingLineLengthUnscaled
 Length of heading line in pixels.
float myWidgetColumnPadding
 Padding between label columns, in pixels.
float myWidgetRowPadding
 Padding between label rows, in pixels.
std::string myFontFile
 Font file for creating labels.
std::string myDecorationSetName
 Name of decoration set to use.
std::string myDecorationTag
 Tag used when finding decoration creators specific to a subclass of this visualizer; this variable should be set by derived classes, for instance to DIS in a DIS specific subclassed visualizer.
float myTextR
 Text color red value.
float myTextG
 Text color green value.
float myTextB
 Text color blue value.
float myTextA
 Text color alpha value.
unsigned int myNextLabelIndex
 Next free index for a label.
bool myEnabled
 Whether or not the decoration visualizer is enabled.
bool myShowBorder
 Whether or not borders are shown.
unsigned int mySelectedGroupId
 Overlay group id for the symbol decoration shadow/background when selected.
unsigned int mySelectedTextGroupId
 Overlay group id for the symbol decoration text (foreground) when selected.
unsigned int mySymbolDecorationGroupId
 Overlay group id for the symbol decoration shadow/background when not selected.
unsigned int mySymbolDecorationTextGroupId
 Overlay group id for the symbol decoration text (foreground) when not selected.
- Protected Attributes inherited from makVrv::DtStateVisualizer
DtBaseConnectionmySimulation
DtStateListenermyListener
bool myDistributeFlag
DtUniqueID myUniqueID
std::string myName
std::string myModelDefinition
DtSignalConnectionManager myConnections
int myModelSet
int myVisualizerType
std::vector< int > myShowHideContexts
bool mySelected
bool myPickable
bool myVisible
DtStateVisualizermyParent
DtSceneObjectAgent * mySceneObjectAgent

Private Member Functions

void cleanup ()

Additional Inherited Members

- Public Types inherited from makVrv::DtStateVisualizer
enum  Type {
  AllVisualizerTypes = 0, EntityVisualizerType = 1, EnvironmentalVisualizerType, InteractionVisualizerType,
  AggregateVisualizerType, IntervisibilityVisualizerType, TacticalSmokeVisualizerType, UserType = 10000
}
 Visualizer class types that are supportable via visualizers. More...
- Public Attributes inherited from makVrv::DtStateVisualizer
boost::signal< void(DtStateVisualizer
*, DtStateVisualizer
*, DtStateVisualizer *)> 
signal_reparented
 Signaled when the parent of this item changes, called before destroying any model agents.
boost::signal< void(DtMouseState
&, const DtUniqueID &, const
std::string &, const
std::string &, const
std::string
&, DtStateVisualizer *)> 
signal_mouseDown
 Emitted when the entity's indicator is clicked.
boost::signal< void(DtMouseState
&, const DtUniqueID &, const
std::string &, const
std::string &, const
std::string
&, DtStateVisualizer *)> 
signal_mouseUp
boost::signal< void(DtMouseState
&, const DtUniqueID &, const
std::string &, const
std::string &, const
std::string
&, DtStateVisualizer *)> 
signal_mouseDblClick

Detailed Description

Symbol decoration visualizer.

Member Typedef Documentation

typedef boost::unordered_map<std::string, DtSymbolDecoration*> makVrv::DtSymbolDecorationVisualizer::DecorationIdMap
protected

Map type from symbol decoration name to symbol decoration.

Constructor & Destructor Documentation

makVrv::DtSymbolDecorationVisualizer::DtSymbolDecorationVisualizer ( DtBaseConnection simulation,
DtStateListener listener,
int  modelSet,
const std::string &  decorationTag 
)

CTOR.

Parameters
simulationthe DtBaseConnection this visualizer will use
listenerthe DtEntityStateListener for this visualizer's entity
modelSetthe model set this visualizer belongs to
virtual makVrv::DtSymbolDecorationVisualizer::~DtSymbolDecorationVisualizer ( )
virtual

DTOR Cleans up the model agents associated with this visualizer.

Member Function Documentation

virtual void makVrv::DtSymbolDecorationVisualizer::createModelAgents ( )
virtual
virtual void makVrv::DtSymbolDecorationVisualizer::destroyModelAgents ( )
virtual
virtual void makVrv::DtSymbolDecorationVisualizer::setModelDefinitionForAgents ( )
virtual
virtual void makVrv::DtSymbolDecorationVisualizer::setVisualizerDefinition ( const DtVisualizerDefinition visDef)
virtual

Set any other additional visualizer information from the visual record.

Reimplemented from makVrv::DtStateVisualizer.

virtual void makVrv::DtSymbolDecorationVisualizer::setSelected ( bool  isSelected)
virtual

Sets whether the this visualizer's entity is selected or not.

Overridden to update the symbol decoration's overlay group.

Reimplemented from makVrv::DtStateVisualizer.

virtual DtAttributeGroupWidgetAgent* makVrv::DtSymbolDecorationVisualizer::widget ( )
virtual

get the attribute group widget

virtual DtSymbolDecorationUpdaterAgent* makVrv::DtSymbolDecorationVisualizer::widgetUpdater ( )
virtual

get the updater

virtual unsigned int makVrv::DtSymbolDecorationVisualizer::nextLabelIndex ( )
virtual

Get the next index for decoration labels.

Referenced by makVrf::DtVrfNameSymbolDecorationCreator::create().

virtual DtSceneObjectAgent* makVrv::DtSymbolDecorationVisualizer::sceneObject ( )
virtual

Get the scene object.

virtual void makVrv::DtSymbolDecorationVisualizer::setDecorationsVisible ( bool  )
virtual

Sets all decorations hidden/shown regardless of symbol decoration record status.

Will only work on decorations that are currently visualized and created

virtual void makVrv::DtSymbolDecorationVisualizer::slot_decorationEnabled ( const std::string &  decoration)
virtual

Called when a decoration is enabled.

virtual void makVrv::DtSymbolDecorationVisualizer::slot_decorationDisabled ( const std::string &  decoration)
virtual

Called when a decoration is disabled.

virtual void makVrv::DtSymbolDecorationVisualizer::slot_foregroundColorChanged ( float  r,
float  g,
float  b 
)
virtual

Called when the symbol decoration foreground color is changed.

virtual void makVrv::DtSymbolDecorationVisualizer::slot_backgroundColorChanged ( float  r,
float  g,
float  b 
)
virtual

Called when the symbol decoration background color is changed.

virtual void makVrv::DtSymbolDecorationVisualizer::slot_backgroundOpacityChanged ( float  a)
virtual

Called when the symbol decoration background opacity is changed.

virtual void makVrv::DtSymbolDecorationVisualizer::slot_shadowTextChanged ( bool  enabled)
virtual

Called when shadow text is enabled or disabled.

virtual void makVrv::DtSymbolDecorationVisualizer::slot_setScale ( float  scale)
virtual

Set size in points; this corresponds to scale * 32.0.

virtual void makVrv::DtSymbolDecorationVisualizer::slot_setEnabled ( bool  enabled)
virtual

Set the decoration visualizer enabled or disabled.

virtual void makVrv::DtSymbolDecorationVisualizer::setScale ( float  scale)
virtual

Set scale as a percentage of default size.

void makVrv::DtSymbolDecorationVisualizer::setShowBorder ( bool  b)

Set whether or not border is shown.

virtual DtSymbolDecoration* makVrv::DtSymbolDecorationVisualizer::findSymbolDecoration ( const std::string &  decorationId)
virtual

Return the symbol decoration for the specific id, else NULL.

virtual void makVrv::DtSymbolDecorationVisualizer::setOffset ( double  x,
double  y 
)
virtual

Sets the offset to use for all symbol decorations.

const DtVector& makVrv::DtSymbolDecorationVisualizer::offset ( ) const

Returns the current offset.

virtual void makVrv::DtSymbolDecorationVisualizer::setBorderState ( )
protectedvirtual

Creates or destroys the border based on the current border state.

void makVrv::DtSymbolDecorationVisualizer::cleanup ( )
private

Member Data Documentation

DtSignalConnectionManager makVrv::DtSymbolDecorationVisualizer::mySignalConns
protected

Manager for boost connections.

DecorationIdMap makVrv::DtSymbolDecorationVisualizer::myDecorationIdMap
protected

Map from creator names to decoration instances.

DtSymbolDecorationSettings::DecorationSet makVrv::DtSymbolDecorationVisualizer::myDecorationSet
protected

Decoration set used to create decorations.

DtAttributeGroupWidgetAgent* makVrv::DtSymbolDecorationVisualizer::myWidget
protected

Widget to show a layout of labels.

DtProjectedWidgetModelAgent* makVrv::DtSymbolDecorationVisualizer::myWidgetModel
protected

Projecting widget to place the label widget at the 2d projection of the scene object's location.

DtSymbolDecorationUpdaterAgent* makVrv::DtSymbolDecorationVisualizer::myWidgetUpdater
protected

Updater to keep the labels and heading indicator updated with distributed side state.

float makVrv::DtSymbolDecorationVisualizer::myForegroundColor[3]
protected

Foreground color for the symbol decorations.

float makVrv::DtSymbolDecorationVisualizer::myBackgroundColor[4]
protected

Background color for the symbol decorations.

float makVrv::DtSymbolDecorationVisualizer::myScale
protected

Scale as a percentage of initial size.

DtVector makVrv::DtSymbolDecorationVisualizer::myWidgetOffsetUnscaled
protected

Unscaled 2d offset of decorations from scene object origin z value is ignored.

float makVrv::DtSymbolDecorationVisualizer::myFontSizeUnscaled
protected

Font size in points.

float makVrv::DtSymbolDecorationVisualizer::myHeadingLineLengthUnscaled
protected

Length of heading line in pixels.

float makVrv::DtSymbolDecorationVisualizer::myWidgetColumnPadding
protected

Padding between label columns, in pixels.

float makVrv::DtSymbolDecorationVisualizer::myWidgetRowPadding
protected

Padding between label rows, in pixels.

std::string makVrv::DtSymbolDecorationVisualizer::myFontFile
protected

Font file for creating labels.

std::string makVrv::DtSymbolDecorationVisualizer::myDecorationSetName
protected

Name of decoration set to use.

std::string makVrv::DtSymbolDecorationVisualizer::myDecorationTag
protected

Tag used when finding decoration creators specific to a subclass of this visualizer; this variable should be set by derived classes, for instance to DIS in a DIS specific subclassed visualizer.

float makVrv::DtSymbolDecorationVisualizer::myTextR
protected

Text color red value.

float makVrv::DtSymbolDecorationVisualizer::myTextG
protected

Text color green value.

float makVrv::DtSymbolDecorationVisualizer::myTextB
protected

Text color blue value.

float makVrv::DtSymbolDecorationVisualizer::myTextA
protected

Text color alpha value.

unsigned int makVrv::DtSymbolDecorationVisualizer::myNextLabelIndex
protected

Next free index for a label.

bool makVrv::DtSymbolDecorationVisualizer::myEnabled
protected

Whether or not the decoration visualizer is enabled.

bool makVrv::DtSymbolDecorationVisualizer::myShowBorder
protected

Whether or not borders are shown.

unsigned int makVrv::DtSymbolDecorationVisualizer::mySelectedGroupId
protected

Overlay group id for the symbol decoration shadow/background when selected.

unsigned int makVrv::DtSymbolDecorationVisualizer::mySelectedTextGroupId
protected

Overlay group id for the symbol decoration text (foreground) when selected.

unsigned int makVrv::DtSymbolDecorationVisualizer::mySymbolDecorationGroupId
protected

Overlay group id for the symbol decoration shadow/background when not selected.

unsigned int makVrv::DtSymbolDecorationVisualizer::mySymbolDecorationTextGroupId
protected

Overlay group id for the symbol decoration text (foreground) when not selected.


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)