public class LineMap extends java.lang.Object implements RangeMap, Transmittable
Constructor and Description |
---|
LineMap()
Constructor to use when map will be loaded from a data stream
|
LineMap(Line[] lines,
Rectangle boundingRect)
Create a map from an array of line segments and a bounding rectangle
|
Modifier and Type | Method and Description |
---|---|
void |
createSVGFile(java.lang.String fileName)
Create an SVG map file
|
void |
dumpObject(java.io.DataOutputStream dos)
Dump the map to a DataOutputStream
|
LineMap |
flip()
Create a line map with the y axis flipped
|
Rectangle |
getBoundingRect()
Return the bounding rectangle of the mapped area
|
Line[] |
getLines()
Get the lines as an array
|
boolean |
inside(Point p)
Check if a point is within the mapped area
|
void |
loadObject(java.io.DataInputStream dis)
Load a map from a DataInputStream
|
float |
range(Pose pose)
Calculate the range of a robot to the nearest wall
|
public LineMap(Line[] lines, Rectangle boundingRect)
lines
- the line segmentsboundingRect
- the bounding rectanglepublic LineMap()
public float range(Pose pose)
public boolean inside(Point p)
public Rectangle getBoundingRect()
getBoundingRect
in interface RangeMap
public void dumpObject(java.io.DataOutputStream dos) throws java.io.IOException
dumpObject
in interface Transmittable
dos
- the streamjava.io.IOException
public void loadObject(java.io.DataInputStream dis) throws java.io.IOException
loadObject
in interface Transmittable
dis
- the streamjava.io.IOException
public Line[] getLines()
public void createSVGFile(java.lang.String fileName) throws java.io.IOException
fileName
- the name of the file to create or overwritejava.io.IOException
public LineMap flip()