public class NodeMapper
extends java.lang.Object
Example: If node distance is 5, the distance between two nodes in a grid that are adjacent to each other would be 1, whereas the real world distance would be 5.
| Constructor and Description |
|---|
NodeMapper(double nodeDistance,
double floorHeight)
Constructor that accepts the node distance of the grid and
the floor height of the grid.
|
| Modifier and Type | Method and Description |
|---|---|
double |
getFloorHeight()
Access method to get the floor height.
|
RectCoordinates |
getGridLocation(RectCoordinates realLoc)
Gets the index of the grid according to the given real world
rectangular coordinates.
|
double |
getNodeDistance()
Access method to get the node distance.
|
RectCoordinates |
getRealLocation(RectCoordinates gridLocation)
Gets the real world coordinates from the given grid index location
by using the node distance and floor height member variables.
|
public NodeMapper(double nodeDistance,
double floorHeight)
nodeDistance - distance between adjacent nodes along horizontal axesfloorHeight - distance between adjacent nodes along vertical axispublic RectCoordinates getGridLocation(RectCoordinates realLoc)
realLoc - real world coordinatespublic RectCoordinates getRealLocation(RectCoordinates gridLocation)
gridLocation - specific indices within the gridpublic double getNodeDistance()
public double getFloorHeight()