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 TypeMethodDescriptionvoidaddBoundingRectangle(GaiaRectangle boundingRectangle) voidaddPoint(double x, double y) voidaddPoint(org.joml.Vector2d vector2d) clone()voidcopyFrom(GaiaRectangle rectangle) doublegetArea()doubleorg.joml.Vector2dorg.joml.Vector2ddoubleintorg.joml.Vector2ddoubleorg.joml.Vector2dgetRange()org.joml.Vector2dorg.joml.Vector2ddoublegetWidth()intbooleanintersects(GaiaRectangle compare, double error) booleanintersectsInSomeAxis(GaiaRectangle compare) booleanintersectsInXAxis(GaiaRectangle compare) booleanintersectsInYAxis(GaiaRectangle compare) voidsetInit(org.joml.Vector2d vector2d) voidsetSize(double minX, double minY, double maxX, double maxY) voidtranslate(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)
-