cnet v3.1.4

home
FAQ

cmdline options
topology files
attributes

datatypes
data structures
core API
support API

download/install

cnet's Application Programming Interface

NAME
CNET_get_mapscale - get the scale of the simulation map

SYNOPSIS
#include <cnet.h>

double CNET_get_mapscale(void);

DESCRIPTION
Simulations run within a rectangular region, the map, whose dimensions are set in the toplology file with the attributes mapwidth and mapheight. In addition, items such as nodes and links that are drawn on the map are scaled by the global attribute mapscale, which indicates how many real-world metres are represented by one pixel on the simulation's map.

If your protocol code needs to draw any items on the map, using the TCLTK function, then the x and y coordinates should first be divided by the value of mapscale.

The map's scale will not change during a simulation, and so CNET_get_mapscale only needs to be called once.

RETURN VALUE
The scale of the simulation map is returned. The function cannot fail.

SEE ALSO
CNET_get_position and CNET_set_position.

cnet was written and is maintained by Chris McDonald (chris@csse.uwa.edu.au).

cnet development has been supported by an ACM-SIGCSE Special Project Grant, and an Australian Apple University Consortium Scholarship.