Package cn.mapway.geo.shared.vector
Class Rect
java.lang.Object
cn.mapway.geo.shared.vector.Rect
Rect
- Author:
- zhangjianshe <zhangjianshe@gmail.com>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()booleancontains(double x, double y) 矩形是否包含(x,y)extend(double x, double y) 扩展矩形范围intintintintboolean两个矩形是否相交boolean判断两个矩形是否交叉voidmoveTo(double x, double y) void正交化对象offset(double x, double y) setValue(double x, double y, double width, double height) shrink(double left, double top, double right, double bottom) toString()output json format
-
Field Details
-
x
public double x -
y
public double y -
width
public double width -
height
public double height
-
-
Constructor Details
-
Rect
public Rect() -
Rect
public Rect(double x, double y, double width, double height)
-
-
Method Details
-
getXAsInt
public int getXAsInt() -
getYAsInt
public int getYAsInt() -
getWidthAsInt
public int getWidthAsInt() -
getHeightAsInt
public int getHeightAsInt() -
setValue
-
moveTo
public void moveTo(double x, double y) -
offset
-
contains
public boolean contains(double x, double y) 矩形是否包含(x,y)- Parameters:
x-y-- Returns:
-
toString
output json format -
clone
-
shrink
-
normalize
public void normalize()正交化对象 -
extend
-
getCenter
-