MAK RTIspy API Documentation for HLA 1516
networkMapCentralNode.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #ifndef _networkMapCentralNode_H_
7 #define _networkMapCentralNode_H_
8 
10 #include "networkMapNode.h"
11 #include <vector>
12 #include <iterator>
13 #include <vlutil/vlString.h>
14 
16 {
17 public:
20 
22  virtual ~DtNetworkMapCentralNode();
23 
25  DtNetworkMapNode * addNode( int fedId,
26  const MAKRti::DtString & federationName,
27  const MAKRti::DtString &processName, const MAKRti::DtString &fedType,
28  const MAKRti::DtString &fedName, float rad );
29 
31  DtNetworkMapNode * addForwarderNode( int id, const MAKRti::DtString & name,
32  float rad );
33 
35  void update( float delta );
36 
38  void shutdown();
39 
41  bool searchNodes( int fedId, const MAKRti::DtString & federationName,
42  int & resultIndex );
43 
46 
49 
51  void setCentralNode( const MAKRti::DtString& name,
52  const MAKRti::DtString& displayName,
53  int id, float radius, bool isLightweight );
54 
55 private:
56 
59  void updatePositions( std::vector<DtNetworkMapNode *> & myNodes,
60  bool areForwarders = false );
61 
62 public:
63 
65  DtNetworkMapNode * getNode(unsigned int index);
66 
68  DtNetworkMapNode * getNodeByFederateHandle( unsigned int fedHandle,
69  const MAKRti::DtString & federationName );
70 
72  DtNetworkMapNode * getNodeByFederateName( const MAKRti::DtString & fedName,
73  const MAKRti::DtString & federationName );
74 
76  DtNetworkMapNode * getForwarderNode( unsigned int index );
77 
79  DtNetworkMapNode * getForwarderNodeByName( const MAKRti::DtString& forwarderName );
80 
83  int removeNode( unsigned int fedHandle, const MAKRti::DtString & federationName );
84 
86  void clearList();
87 
89  void clearTouchedNodes();
90 
92  void searchForDeadNodes();
93 
95  inline bool drawLines() { return myShouldDrawLines; }
96 
98  inline bool drawText() { return myShouldDrawText; }
99 
101  inline unsigned int getSize() { return myNodes.size(); }
102  inline unsigned int getFwdSize() { return myForwarderNodes.size(); }
103 
105  inline const std::vector<DtNetworkMapNode*> getNodes() { return myNodes; }
106 
108  inline MAKRti::DtString getCentralNodeName() { return myName; }
109 
111  inline bool isLightweight() { return myIsLightweight; }
112 
114  inline bool hasRtiExec() { return myHasExec; }
115 
117  inline void setHasExec( bool hasAnExec ) { myHasExec = hasAnExec; }
118 
119 protected:
120 
122  DtNetworkMapNode* insertCentralNode( int id, const MAKRti::DtString& displayName,
123  float rad, bool isLightweight );
124 
127  const MAKRti::DtString & name, float rad );
128 
130  inline void setIsLightweight( bool isLw ) { myIsLightweight = isLw; }
131 
133  void setCentralNodeName( const MAKRti::DtString & string ) { myName = string; }
134 
136  _vec2 calcFederateDestination(int max_federates, int federate_no );
137 
138 protected:
139  bool myHasExec; // has an rtiExec
140  bool myIsLightweight; // this is a lightweight connection
141  bool myShouldDrawLines; // should we draw the lines?
142  bool myShouldDrawText; // should we draw the id text?
143  bool myHasDoneShutdown; // has done a shutdown on ourselves
144  float myRadius; // the radius of this node and its children
145  MAKRti::DtString myName; // our central node name
146  std::vector<DtNetworkMapNode *> myNodes; // our nodes
147  std::vector<DtNetworkMapNode *> myForwarderNodes; // Peer forwarders
148 };
149 
150 #endif

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)