MAK RTIspy API Documentation for HLA 1516
List of all members | Public Slots | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
DtNetworkMapWidget Class Reference
+ Inheritance diagram for DtNetworkMapWidget:
+ Collaboration diagram for DtNetworkMapWidget:

Public Slots

void selectAndHoverText ()
 SLOT: called when we need to select the hovered object.
void showContextMenu (const QPoint &pos)
 Called when the user requests a context menu in the network map.

Signals

void federateSelected (const MAKRti::DtString &federationName, int federateHandle)
 Emitted when a federate node is selected.
void rtiexecSelected ()
 Emitted when the rtiexec node is selected.
void forwarderSelected (const MAKRti::DtString &forwarderName)
 Emitted when the central forwarder node is selected.
void peerForwarderSelected (const MAKRti::DtString &forwarderName)
 Emitted when a peer forwarder node is selected.
void lightweightSelected ()
 Emitted when the lightweight center node is selected.
void nothingSelected ()
 Emitted when selection is cleared.

Public Member Functions

 DtNetworkMapWidget (QWidget *parent)
 Constructor.
virtual ~DtNetworkMapWidget ()
 Destructor.
virtual QSize sizeHint () const
 Returns the recommended size for the widget.
void addPeerForwarderNode (const MAKRti::DtString &forwarderName)
 Adds a particular node.
void removeForwarderNode (const MAKRti::DtString &forwarderName)
void addExecNode ()
void removeExecNode ()
void addFederateNode (int fedHandle, const MAKRti::DtString &federationName, const MAKRti::DtString &processName, const MAKRti::DtString &fedType, const MAKRti::DtString &fedName, bool notJoined=false, bool isDropped=false)
void removeFederateNode (int fedHandle, const MAKRti::DtString &federationName)
void checkAndAddMainForwarder (const MAKRti::DtString &forwarderName)
void checkAndAddLightweight (const MAKRti::DtString &connName)
void updateFederateInfo (int fedHandle, const MAKRti::DtString &federationName, int queueStatus, bool disconnected, bool reconnecting, bool inErrorState=false)
void refreshPositions ()
bool doesFederateExist (int fedHandle, const MAKRti::DtString &federationName)
 Does this federate exist?
bool doesRtiexecExist ()
 Does the rtiexec exist?
void clearFederateFlags (int fedHandle, const MAKRti::DtString &federationName)
 clear this federates flags
void forceFederateSelection (int fedHandle, const MAKRti::DtString &federationName)
 For the widget to select the specified federate.
void forceRtiexecSelection ()
 For the widget to select the rtiexec.
void forceForwarderSelection (const MAKRti::DtString &forwarderName)
 For the widget to select the central forwarder.
void forceClearSelection ()
 For the widget to clear the current selection.
virtual void tick (float delta)
 Update.
virtual void selection (int x, int y, bool onHover=false)
 checks for selection
virtual void clearList ()
 Clears the nodes.
virtual bool hasSelection ()
 Checks for a selected node.
virtual int getSelectedHandle ()
 Returns the selected index.
virtual void getSelectedNodeInfo (MAKRti::DtString &federationName, int &federateHandle, bool &isForwarder, bool &isExec, bool &isLightweightCenter)
 Gets the selected node information.
virtual QColor getFederationColor (const MAKRti::DtString &federationName)
 Gets the federation color.
virtual void changeFederationColor (const MAKRti::DtString &federationName, const QColor &newColor)
 Changes the federation names color mapping.
virtual void enableFederationColors (bool enable)
 Enable or disable display of federation colors.
virtual void setFederateIdentifierType (DtFederateIdentifierType fedIdType)
 Choose type of text to be used to identify federates.
virtual void setContextMenu (QMenu *contextMenu)
 Set the context menu to use when activated.

Protected Member Functions

virtual void resizeEvent (QResizeEvent *evt)
 Resize event.
virtual void closeEvent (QCloseEvent *evt)
 close event
virtual void wheelEvent (QWheelEvent *evt)
 Wheel Event for zooming.
virtual void mouseMoveEvent (QMouseEvent *evt)
 Mouse Movement for Panning.
virtual void keyPressEvent (QKeyEvent *evt)
 Key Press for resetting Pan.
virtual void mousePressEvent (QMouseEvent *evt)
 Mouse press event.
virtual void mouseDoubleClickEvent (QMouseEvent *evt)
 Mouse double click.
virtual void initializeGL ()
 Initializes the OpenGL data.
virtual void paintGL ()
 Paint's the OpenGL Scene.
virtual void drawLines ()
 Draws the lines.
virtual void drawNodes ()
 Draws the nodes.
virtual void drawForwarderNodes ()
 Draws the forwarder nodes.
virtual void drawForwarderNodeLines ()
 Draws the forwarder node lines.
virtual void drawText ()
 Draws node text.
virtual QColor addFederationColor (const MAKRti::DtString &federationName)
 Adds a federation name -> color mapping.
virtual void drawWarning (int textIndex)
 Draws the warning/error/disconnect texture.

Protected Attributes

int myWidth
int myHeight
unsigned mySelectedIndex
unsigned myHoverIndex
float myCameraDelta
QPoint myOldMouse
QPoint myNewMouse
QPoint myDeltaMouse
DtNetworkMapCentralNodemyCentralNode
DtNetworkMapCameramyCamera
DtFederateIdentifierType myFedIdType
 The identifying text to be used to identify federates.
std::vector< QColor > myDefaultColors
 Available default colors.
bool myDisplayFederationColors
 Whether the federation colors are displayed.
bool myNodesAreMoving
 Whether nodes are currently moving.
unsigned myNextDefaultColor
 Index of next color to use.
std::set< QRgb > myInUseColors
 Colors currently in use.
QTimer * myHoverTimer
std::map< MAKRti::DtString,
QColor > 
myFederationColors
 map that holds federation names to colors
QMenu * myCurrentContextMenu
 The context menu to display for the current selected node, if requested.

Static Protected Attributes

static const int theStandardNodeRadius = 2
 The standard radius for all nodes.
static const unsigned theInvalidMapNodeIndex = 0xFFFFFFFF
 Represents an invalid map node index.
static const unsigned theInitialFwIndex = 0x80000000
 The first forwarder node index.
static const int theRtiexecId = 999999
 Standard IDs to use for non-federate nodes.
static const int theForwarderId = 999998
 Standard IDs to use for non-federate nodes.
static const int theLigthweightCenterId = 999997
 Standard IDs to use for non-federate nodes.
static const MAKRti::DtString theRtiexecName = "rtiexec"
 Standard names to use for non-federate nodes.
static const MAKRti::DtString theForwarderName = "RTI Forwarder"
 Standard names to use for non-federate nodes.
static const MAKRti::DtString theLigthweightCenterName = "Lightweight Connection"
 Standard names to use for non-federate nodes.

Detailed Description

Constructor & Destructor Documentation

DtNetworkMapWidget::DtNetworkMapWidget ( QWidget parent)
DtNetworkMapWidget::~DtNetworkMapWidget ( )
virtual

Member Function Documentation

void DtNetworkMapWidget::addExecNode ( )
void DtNetworkMapWidget::addFederateNode ( int  fedHandle,
const MAKRti::DtString &  federationName,
const MAKRti::DtString &  processName,
const MAKRti::DtString &  fedType,
const MAKRti::DtString &  fedName,
bool  notJoined = false,
bool  isDropped = false 
)
QColor DtNetworkMapWidget::addFederationColor ( const MAKRti::DtString &  federationName)
protectedvirtual

Adds a federation name -> color mapping.

References federationName(), myDefaultColors, myFederationColors, myInUseColors, and myNextDefaultColor.

Referenced by addFederateNode(), and getFederationColor().

void DtNetworkMapWidget::addPeerForwarderNode ( const MAKRti::DtString &  forwarderName)
void DtNetworkMapWidget::changeFederationColor ( const MAKRti::DtString &  federationName,
const QColor &  newColor 
)
virtual

Changes the federation names color mapping.

References myFederationColors.

Referenced by DtFederationsViewDialog::changeFederationColor().

void DtNetworkMapWidget::checkAndAddLightweight ( const MAKRti::DtString &  connName)
void DtNetworkMapWidget::checkAndAddMainForwarder ( const MAKRti::DtString &  forwarderName)
void DtNetworkMapWidget::clearFederateFlags ( int  fedHandle,
const MAKRti::DtString &  federationName 
)
void DtNetworkMapWidget::clearList ( )
virtual
void DtNetworkMapWidget::closeEvent ( QCloseEvent *  evt)
protectedvirtual

close event

bool DtNetworkMapWidget::doesFederateExist ( int  fedHandle,
const MAKRti::DtString &  federationName 
)

Does this federate exist?

References DtNetworkMapCentralNode::getNodeByFederateHandle(), myCentralNode, and NULL.

bool DtNetworkMapWidget::doesRtiexecExist ( )
void DtNetworkMapWidget::drawForwarderNodeLines ( )
protectedvirtual
void DtNetworkMapWidget::drawForwarderNodes ( )
protectedvirtual
void DtNetworkMapWidget::drawLines ( )
protectedvirtual
void DtNetworkMapWidget::drawNodes ( )
protectedvirtual
void DtNetworkMapWidget::drawText ( )
protectedvirtual
void DtNetworkMapWidget::drawWarning ( int  textIndex)
protectedvirtual

Draws the warning/error/disconnect texture.

References DtWarningTexture, and DtIconAndTextureManager::getInstance().

Referenced by drawNodes().

void DtNetworkMapWidget::enableFederationColors ( bool  enable)
virtual

Enable or disable display of federation colors.

References myDisplayFederationColors.

Referenced by DtFederationsViewDialog::enableFederationColors().

void DtNetworkMapWidget::federateSelected ( const MAKRti::DtString &  federationName,
int  federateHandle 
)
signal

Emitted when a federate node is selected.

Referenced by selection().

void DtNetworkMapWidget::forceClearSelection ( )
void DtNetworkMapWidget::forceFederateSelection ( int  fedHandle,
const MAKRti::DtString &  federationName 
)
void DtNetworkMapWidget::forceForwarderSelection ( const MAKRti::DtString &  forwarderName)
void DtNetworkMapWidget::forceRtiexecSelection ( )
void DtNetworkMapWidget::forwarderSelected ( const MAKRti::DtString &  forwarderName)
signal

Emitted when the central forwarder node is selected.

Referenced by selection().

QColor DtNetworkMapWidget::getFederationColor ( const MAKRti::DtString &  federationName)
virtual
virtual int DtNetworkMapWidget::getSelectedHandle ( )
inlinevirtual

Returns the selected index.

void DtNetworkMapWidget::getSelectedNodeInfo ( MAKRti::DtString &  federationName,
int &  federateHandle,
bool &  isForwarder,
bool &  isExec,
bool &  isLightweightCenter 
)
virtual
bool DtNetworkMapWidget::hasSelection ( )
virtual

Checks for a selected node.

References mySelectedIndex, and theInvalidMapNodeIndex.

void DtNetworkMapWidget::initializeGL ( )
protectedvirtual

Initializes the OpenGL data.

References myHeight, and myWidth.

void DtNetworkMapWidget::keyPressEvent ( QKeyEvent *  evt)
protectedvirtual

Key Press for resetting Pan.

For resetting the panning.

References DtNetworkMapCentralNode::getSize(), myCamera, myCentralNode, NULL, and DtNetworkMapCamera::resetToDefault().

void DtNetworkMapWidget::lightweightSelected ( )
signal

Emitted when the lightweight center node is selected.

Referenced by selection().

void DtNetworkMapWidget::mouseDoubleClickEvent ( QMouseEvent *  evt)
protectedvirtual
void DtNetworkMapWidget::mouseMoveEvent ( QMouseEvent *  evt)
protectedvirtual

Mouse Movement for Panning.

For Panning.

References myCamera, myHoverIndex, myHoverTimer, NULL, DtNetworkMapCamera::pan(), and DtNetworkMapCamera::updateMouse().

void DtNetworkMapWidget::mousePressEvent ( QMouseEvent *  evt)
protectedvirtual

Mouse press event.

References myCentralNode, NULL, and selection().

void DtNetworkMapWidget::nothingSelected ( )
signal

Emitted when selection is cleared.

Referenced by removeFederateNode(), and selection().

void DtNetworkMapWidget::paintGL ( )
protectedvirtual
void DtNetworkMapWidget::peerForwarderSelected ( const MAKRti::DtString &  forwarderName)
signal

Emitted when a peer forwarder node is selected.

Referenced by selection().

void DtNetworkMapWidget::refreshPositions ( )
void DtNetworkMapWidget::removeExecNode ( )
void DtNetworkMapWidget::removeFederateNode ( int  fedHandle,
const MAKRti::DtString &  federationName 
)
void DtNetworkMapWidget::removeForwarderNode ( const MAKRti::DtString &  forwarderName)
void DtNetworkMapWidget::resizeEvent ( QResizeEvent *  evt)
protectedvirtual

Resize event.

References myHeight, and myWidth.

void DtNetworkMapWidget::rtiexecSelected ( )
signal

Emitted when the rtiexec node is selected.

Referenced by selection().

void DtNetworkMapWidget::selectAndHoverText ( )
slot

SLOT: called when we need to select the hovered object.

References DtNetworkMapCentralNode::drawLines(), myCentralNode, myHoverTimer, NULL, selection(), and true.

Referenced by DtNetworkMapWidget().

void DtNetworkMapWidget::selection ( int  x,
int  y,
bool  onHover = false 
)
virtual
void DtNetworkMapWidget::setContextMenu ( QMenu *  contextMenu)
virtual
void DtNetworkMapWidget::setFederateIdentifierType ( DtFederateIdentifierType  fedIdType)
virtual

Choose type of text to be used to identify federates.

References myFedIdType.

Referenced by DtFederationsViewDialog::setFederateIdentifierType().

void DtNetworkMapWidget::showContextMenu ( const QPoint &  pos)
slot

Called when the user requests a context menu in the network map.

References myCentralNode, myCurrentContextMenu, NULL, and selection().

Referenced by DtNetworkMapWidget().

QSize DtNetworkMapWidget::sizeHint ( ) const
virtual

Returns the recommended size for the widget.

void DtNetworkMapWidget::tick ( float  delta)
virtual
void DtNetworkMapWidget::updateFederateInfo ( int  fedHandle,
const MAKRti::DtString &  federationName,
int  queueStatus,
bool  disconnected,
bool  reconnecting,
bool  inErrorState = false 
)
void DtNetworkMapWidget::wheelEvent ( QWheelEvent *  evt)
protectedvirtual

Wheel Event for zooming.

References myCamera, and DtNetworkMapCamera::zoom().

Member Data Documentation

DtNetworkMapCamera* DtNetworkMapWidget::myCamera
protected
float DtNetworkMapWidget::myCameraDelta
protected
DtNetworkMapCentralNode* DtNetworkMapWidget::myCentralNode
protected
QMenu* DtNetworkMapWidget::myCurrentContextMenu
protected

The context menu to display for the current selected node, if requested.

Referenced by setContextMenu(), and showContextMenu().

std::vector<QColor> DtNetworkMapWidget::myDefaultColors
protected

Available default colors.

Referenced by addFederationColor(), and DtNetworkMapWidget().

QPoint DtNetworkMapWidget::myDeltaMouse
protected
bool DtNetworkMapWidget::myDisplayFederationColors
protected

Whether the federation colors are displayed.

Referenced by drawNodes(), and enableFederationColors().

std::map< MAKRti::DtString, QColor > DtNetworkMapWidget::myFederationColors
protected

map that holds federation names to colors

Referenced by addFederationColor(), changeFederationColor(), DtNetworkMapWidget(), and getFederationColor().

DtFederateIdentifierType DtNetworkMapWidget::myFedIdType
protected

The identifying text to be used to identify federates.

Referenced by drawText(), and setFederateIdentifierType().

int DtNetworkMapWidget::myHeight
protected

Referenced by initializeGL(), and resizeEvent().

unsigned DtNetworkMapWidget::myHoverIndex
protected

Referenced by drawText(), mouseMoveEvent(), and selection().

QTimer* DtNetworkMapWidget::myHoverTimer
protected
std::set<QRgb> DtNetworkMapWidget::myInUseColors
protected

Colors currently in use.

Referenced by addFederationColor().

QPoint DtNetworkMapWidget::myNewMouse
protected
unsigned DtNetworkMapWidget::myNextDefaultColor
protected

Index of next color to use.

Referenced by addFederationColor().

bool DtNetworkMapWidget::myNodesAreMoving
protected

Whether nodes are currently moving.

Referenced by drawNodes().

QPoint DtNetworkMapWidget::myOldMouse
protected
unsigned DtNetworkMapWidget::mySelectedIndex
protected
int DtNetworkMapWidget::myWidth
protected

Referenced by initializeGL(), and resizeEvent().

const int DtNetworkMapWidget::theForwarderId = 999998
staticprotected

Standard IDs to use for non-federate nodes.

Includes.

Referenced by addPeerForwarderNode(), and checkAndAddMainForwarder().

const MAKRti::DtString DtNetworkMapWidget::theForwarderName = "RTI Forwarder"
staticprotected

Standard names to use for non-federate nodes.

Referenced by checkAndAddMainForwarder().

const unsigned DtNetworkMapWidget::theInitialFwIndex = 0x80000000
staticprotected
const unsigned DtNetworkMapWidget::theInvalidMapNodeIndex = 0xFFFFFFFF
staticprotected
const int DtNetworkMapWidget::theLigthweightCenterId = 999997
staticprotected

Standard IDs to use for non-federate nodes.

Includes.

Referenced by checkAndAddLightweight().

const MAKRti::DtString DtNetworkMapWidget::theLigthweightCenterName = "Lightweight Connection"
staticprotected

Standard names to use for non-federate nodes.

Referenced by checkAndAddLightweight().

const int DtNetworkMapWidget::theRtiexecId = 999999
staticprotected

Standard IDs to use for non-federate nodes.

Includes.

Referenced by addExecNode(), doesRtiexecExist(), forceRtiexecSelection(), and removeExecNode().

const MAKRti::DtString DtNetworkMapWidget::theRtiexecName = "rtiexec"
staticprotected

Standard names to use for non-federate nodes.

Referenced by addExecNode().

const int DtNetworkMapWidget::theStandardNodeRadius = 2
staticprotected

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

Document ID: Generated on Fri Mar 14 19:08:55 EDT 2014 from SVN revision 137085
Copyright © 2005-2014 VT MÄK Inc. All Rights Reserved (www.mak.com)