Package globus.glmap
Class GLMapBBox
java.lang.Object
globus.glmap.GLMapBBox
- All Implemented Interfaces:
Serializable
GLMapBBox
defines some rectangular area of map- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Join this bbox with givenvoid
addPoint
(double x, double y) Add point to bboxvoid
Add point to bboxvoid
assign
(double origin_x, double origin_y, double size_x, double size_y) Initialize bbox with datacenter()
Center of bboxdouble
Returns distance from bbox to pointboolean
int
hashCode()
boolean
Checks if bbox intersects with other bboxvoid
rotate
(double angle) Rotates bbox
-
Field Details
-
origin_x
public double origin_xX coordinate of the origin of the bounding box -
origin_y
public double origin_yY coordinate of the origin of the bounding box -
size_x
public double size_xX size of the bounding box -
size_y
public double size_yY size of the bounding box
-
-
Constructor Details
-
GLMapBBox
public GLMapBBox()Default constructor. Initialize empty bounding box -
GLMapBBox
public GLMapBBox(double origin_x, double origin_y, double size_x, double size_y) Initialize bbox with given data- Parameters:
origin_x
- X coordinate of the origin of the bounding boxorigin_y
- Y coordinate of the origin of the bounding boxsize_x
- X size of the bounding boxsize_y
- Y size of the bounding box
-
GLMapBBox
Copy constructor- Parameters:
bbox
- bbox to copy
-
-
Method Details
-
assign
public void assign(double origin_x, double origin_y, double size_x, double size_y) Initialize bbox with data- Parameters:
origin_x
- X coordinate of the origin of the bounding boxorigin_y
- Y coordinate of the origin of the bounding boxsize_x
- X size of the bounding boxsize_y
- Y size of the bounding box
-
center
Center of bbox- Returns:
- center of bbox
-
addBBox
Join this bbox with given- Parameters:
bbox
- bbox to add
-
addPoint
public void addPoint(double x, double y) Add point to bbox- Parameters:
x
- x coordinate of pointy
- y coordinate of point
-
addPoint
Add point to bbox- Parameters:
pt
- point to add
-
equals
-
hashCode
public int hashCode() -
rotate
public void rotate(double angle) Rotates bbox- Parameters:
angle
- angle to rotate
-
intersects
Checks if bbox intersects with other bbox- Parameters:
b
- other bbox- Returns:
- true if intersects
-
distance
Returns distance from bbox to point- Parameters:
pt
- point- Returns:
- distance to point
-