Package com.gaia3d.basic.geometry
Class GaiaRectangle
java.lang.Object
com.gaia3d.basic.geometry.GaiaRectangle
- All Implemented Interfaces:
Serializable
GaiaRectangle is a class to store the bounding rectangle of a geometry.
It can be used to calculate the center and volume of the geometry.
It can also be used to convert the local bounding rectangle to lonlat bounding rectangle.
It can also be used to calculate the longest distance of the geometry.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionGaiaRectangle
(GaiaRectangle rect) GaiaRectangle
(org.joml.Vector2d minPoint, org.joml.Vector2d maxPoint) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addBoundingRectangle
(GaiaRectangle boundingRectangle) void
addPoint
(double x, double y) void
addPoint
(org.joml.Vector2d vector2d) clone()
void
copyFrom
(GaiaRectangle rectangle) double
getArea()
double
org.joml.Vector2d
org.joml.Vector2d
double
int
org.joml.Vector2d
double
org.joml.Vector2d
getRange()
org.joml.Vector2d
org.joml.Vector2d
double
getWidth()
int
boolean
intersects
(GaiaRectangle compare, double error) boolean
intersectsInSomeAxis
(GaiaRectangle compare) boolean
intersectsInXAxis
(GaiaRectangle compare) boolean
intersectsInYAxis
(GaiaRectangle compare) void
setInit
(org.joml.Vector2d vector2d) void
setSize
(double minX, double minY, double maxX, double maxY) void
translate
(org.joml.Vector2d vector2d)
-
Constructor Details
-
GaiaRectangle
public GaiaRectangle(org.joml.Vector2d minPoint, org.joml.Vector2d maxPoint) -
GaiaRectangle
-
-
Method Details
-
getCenter
public org.joml.Vector2d getCenter() -
getVolume
public org.joml.Vector2d getVolume() -
getCenterCorrected
public org.joml.Vector2d getCenterCorrected() -
getRange
public org.joml.Vector2d getRange() -
getLeftBottomPoint
public org.joml.Vector2d getLeftBottomPoint() -
getRightTopPoint
public org.joml.Vector2d getRightTopPoint() -
getBoundingArea
public double getBoundingArea() -
getArea
public double getArea() -
getPerimeter
public double getPerimeter() -
setInit
public void setInit(org.joml.Vector2d vector2d) -
addPoint
public void addPoint(org.joml.Vector2d vector2d) -
addPoint
public void addPoint(double x, double y) -
translate
public void translate(org.joml.Vector2d vector2d) -
addBoundingRectangle
-
getWidth
public double getWidth() -
getHeight
public double getHeight() -
getWidthInt
public int getWidthInt() -
getHeightInt
public int getHeightInt() -
copyFrom
-
intersects
-
intersectsInXAxis
-
intersectsInYAxis
-
intersectsInSomeAxis
-
clone
-
setSize
public void setSize(double minX, double minY, double maxX, double maxY)
-