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 v3.3.4, written by Chris.McDonald@uwa.edu.au
Last modified: Tue Mar 1 7:43AM 2016