MAK RTIspy API Documentation for HLA 4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
networkMapCentralNode.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2016 VT MAK
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include "networkMapNode.h"
13 #include <vlutil/vlString.h>
14 #include <iterator>
15 #include <vector>
16 
18 {
19 public:
20 
23 
25  virtual ~DtNetworkMapCentralNode();
26 
28  DtNetworkMapNode* addNode( int fedId,
29  const MAKRti::DtString& federationName,
30  const MAKRti::DtString& processName, const MAKRti::DtString &fedType,
31  const MAKRti::DtString& fedName, float rad );
32 
34  DtNetworkMapNode* addExecNode( int id, const MAKRti::DtString & name, float rad );
35 
37  DtNetworkMapNode* addForwarderNode( int id, const MAKRti::DtString & name,
38  int port, float rad );
39 
41  void removeForwarderNode(const MAKRti::DtString & name, int port);
42 
44  void update( float delta );
45 
47  void shutdown();
48 
50  bool searchNodes( int fedId, const MAKRti::DtString & federationName,
51  int & resultIndex );
52 
55 
58 
60  void setCentraLightweightlNode( const MAKRti::DtString& name,
61  const MAKRti::DtString& displayName,
62  int id, float radius );
63 
65  void setCentralForwarderNode( const MAKRti::DtString& name,
66  int port,
67  const MAKRti::DtString& displayName,
68  int id, float radius );
69 
70 private:
71 
74  void updatePositions( std::vector<DtNetworkMapNode *> & myNodes,
75  bool areForwarders = false );
76 
77 public:
78 
80  DtNetworkMapNode * getNode(unsigned int index);
81 
83  DtNetworkMapNode * getNodeByFederateHandle( unsigned int fedHandle,
84  const MAKRti::DtString & federationName );
85 
87  DtNetworkMapNode * getNodeByFederateName( const MAKRti::DtString & fedName,
88  const MAKRti::DtString & federationName );
89 
91  DtNetworkMapNode * getForwarderNode( unsigned int index );
92 
94  DtNetworkMapNode * getForwarderNodeByName( const MAKRti::DtString& forwarderName, int port );
95 
98  int removeNode( unsigned int fedHandle, const MAKRti::DtString & federationName );
99 
101  void clearList();
102 
104  void clearTouchedNodes();
105 
107  void searchForDeadNodes();
108 
110  inline bool drawLines() { return myShouldDrawLines; }
111 
113  inline bool drawText() { return myShouldDrawText; }
114 
116  inline unsigned int getSize() { return myNodes.size(); }
117  inline unsigned int getFwdSize() { return myForwarderNodes.size(); }
118 
120  inline const std::vector<DtNetworkMapNode*> getNodes() { return myNodes; }
121 
123  inline MAKRti::DtString getCentralNodeName() { return myName; }
124 
126  inline int getPort() { return myPort; }
127 
129  inline bool isLightweight() { return myIsLightweight; }
130 
132  inline bool hasRtiExec() { return myHasExec; }
133 
135  inline void setHasExec( bool hasAnExec ) { myHasExec = hasAnExec; }
136 
138  bool hasCentralForwarder() const;
139 
140 protected:
141 
143  inline void setIsLightweight( bool isLw ) { myIsLightweight = isLw; }
144 
146  void setCentralNodeName( const MAKRti::DtString & string ) { myName = string; }
147 
149  void setCentralNodePort(int port) { myPort = port; }
150 
152  _vec2 calcFederateDestination(int max_federates, int federate_no );
153 
154 protected:
155 
156  bool myHasExec; // has an rtiExec
157  bool myIsLightweight; // this is a lightweight connection
158  bool myShouldDrawLines; // should we draw the lines?
159  bool myShouldDrawText; // should we draw the id text?
160  bool myHasDoneShutdown; // has done a shutdown on ourselves
161  float myRadius; // the radius of this node and its children
162  MAKRti::DtString myName; // our central node name
163  int myPort; // our central node port
164  std::vector<DtNetworkMapNode *> myNodes; // our nodes
165  std::vector<DtNetworkMapNode *> myForwarderNodes; // Peer forwarders
166 
167 };
void setCentralNodeName(const MAKRti::DtString &string)
Set the central node name.
Definition: networkMapCentralNode.h:146
std::vector< DtNetworkMapNode * > myNodes
Definition: networkMapCentralNode.h:164
void shutdown()
Does proper shutting down.
DtNetworkMapNode * getNodeByFederateName(const MAKRti::DtString &fedName, const MAKRti::DtString &federationName)
gets a node by its federate name
bool drawText()
Do we draw the id text?
Definition: networkMapCentralNode.h:113
void setHasExec(bool hasAnExec)
Sets whether we have an exec or not.
Definition: networkMapCentralNode.h:135
bool myHasExec
Definition: networkMapCentralNode.h:156
void updatePositions(std::vector< DtNetworkMapNode * > &myNodes, bool areForwarders=false)
private function that does the updating of a vector of nodes that are passed in
bool myIsLightweight
Definition: networkMapCentralNode.h:157
void searchForDeadNodes()
Searches for dead nodes.
void setCentralForwarderNode(const MAKRti::DtString &name, int port, const MAKRti::DtString &displayName, int id, float radius)
Set the central node.
DtNetworkMapNode * getNodeByFederateHandle(unsigned int fedHandle, const MAKRti::DtString &federationName)
gets a node by its federate handle
virtual ~DtNetworkMapCentralNode()
Destructor.
MAKRti::DtString getCentralNodeName()
Gets the central node name string.
Definition: networkMapCentralNode.h:123
void setCentraLightweightlNode(const MAKRti::DtString &name, const MAKRti::DtString &displayName, int id, float radius)
Set the central node.
float myRadius
Definition: networkMapCentralNode.h:161
int getPort()
Gets the central node port.
Definition: networkMapCentralNode.h:126
_vec2 calcFederateDestination(int max_federates, int federate_no)
Calculates the destination.
bool searchNodes(int fedId, const MAKRti::DtString &federationName, int &resultIndex)
search nodes
int removeNode(unsigned int fedHandle, const MAKRti::DtString &federationName)
Removes a node by its federate handle.
void removeForwarderNode(const MAKRti::DtString &name, int port)
Removes a forwarder node.
Includes –—.
Definition: networkMapNode.h:15
DtNetworkMapNode * addForwarderNode(int id, const MAKRti::DtString &name, int port, float rad)
Adds a forwarder node.
int myPort
Definition: networkMapCentralNode.h:163
bool drawLines()
Do we draw the lines?
Definition: networkMapCentralNode.h:110
bool myShouldDrawLines
Definition: networkMapCentralNode.h:158
DtNetworkMapNode * getNode(unsigned int index)
index into the nodes
void updateFederatePositions()
Calculates where the federates should be placed.
void setIsLightweight(bool isLw)
Sets whether we are viewing a lightweight connection.
Definition: networkMapCentralNode.h:143
DtNetworkMapNode * addExecNode(int id, const MAKRti::DtString &name, float rad)
Adds a forwarder node.
void clearTouchedNodes()
Clears nodes that have been touched.
Definition: networkMapCentralNode.h:17
DtNetworkMapNode * getForwarderNode(unsigned int index)
index into the nodes
const std::vector< DtNetworkMapNode * > getNodes()
get the nodes
Definition: networkMapCentralNode.h:120
void updateForwarderPositions()
Updates the forwarder positions.
Definition: networkMapNode.h:28
void clearList()
clear the nodes
unsigned int getFwdSize()
Definition: networkMapCentralNode.h:117
bool hasCentralForwarder() const
Gets whether central node is a forwarder.
bool isLightweight()
Gets whether we are viewing a lightweight connection.
Definition: networkMapCentralNode.h:129
DtNetworkMapCentralNode()
Constructor.
void update(float delta)
Updates all the nodes.
DtNetworkMapNode * getForwarderNodeByName(const MAKRti::DtString &forwarderName, int port)
get a forwarder by name
bool hasRtiExec()
Gets whether we have an rtiexec.
Definition: networkMapCentralNode.h:132
unsigned int getSize()
return the size
Definition: networkMapCentralNode.h:116
bool myHasDoneShutdown
Definition: networkMapCentralNode.h:160
void setCentralNodePort(int port)
Set the central node port.
Definition: networkMapCentralNode.h:149
MAKRti::DtString myName
Definition: networkMapCentralNode.h:162
bool myShouldDrawText
Definition: networkMapCentralNode.h:159
DtNetworkMapNode * addNode(int fedId, const MAKRti::DtString &federationName, const MAKRti::DtString &processName, const MAKRti::DtString &fedType, const MAKRti::DtString &fedName, float rad)
Adds a basic node.
std::vector< DtNetworkMapNode * > myForwarderNodes
Definition: networkMapCentralNode.h:165

Document ID: Generated on Wed Jul 8 16:20:32 EDT 2026 from SVN revision 291616
Copyright © 2005-2025 MAK Technologies Inc. All Rights Reserved (www.mak.com)