File: wnetmodel.h

package info (click to toggle)
nam 1.15-5
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 29,240 kB
  • sloc: cpp: 17,338; tcl: 10,655; sh: 2,997; ansic: 1,252; makefile: 139; perl: 66
file content (51 lines) | stat: -rw-r--r-- 1,038 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
 * Network model with wireless net layout
 *
 */

#ifndef nam_wnetmodel_h
#define nam_wnetmodel_h

#include "netmodel.h"

// The ratio of node radius and mean edge length in the topology

class WirelessNetModel : public NetModel {
public:
	WirelessNetModel(const char *animator);
	virtual ~WirelessNetModel();

	void handle(const TraceEvent& e, double now, int direction);
	void removeLink(const TraceEvent& e);
	void removeLink(int src, int dst );
	void BoundingBox(BBox&);
	virtual void moveNode(Node *n);
	inline WirelessNetModel* wobj() { return wobj_; }
	virtual void update(double);
	       
	void addToEdgePool(Edge*);
	Edge* removeFromEdgePool();

protected:
	void layout();
	virtual void placeEdge(Edge* e, Node* src) const;
	WirelessNetModel *wobj_;

	// we need our own 'cmd layout'
	int command(int argc, const char*const* argv); 

struct WEdgeList {
       Edge* wEdge;
       WEdgeList* next;
};      
		 

private:
	int nNodes_;
	double	pxmax_;
	double  pymax_;
        WEdgeList* edges_;
};


#endif // nam_wnetmodel_h