javafx.geometry.BoundingBox
来源:互联网 发布:微信群一键加人软件 编辑:程序博客网 时间:2024/05/14 12:40
public class BoundingBoxextends Bounds
A rectangular bounding(边界) box which is used to describe the bounds of a node or other scene graph object.
BoundingBox
public BoundingBox(double minX,double minY,
double width,
double height)
Creates a new instance of 2D BoundingBox.
Parameters:
minX - the X coordinate of the upper-left cornerminY - the Y coordinate of the upper-left corner
width - the width of the BoundingBox
height - the height of the BoundingBox
BoundingBox
public BoundingBox(double minX,double minY,
double minZ,
double width,
double height,
double depth)
Creates a new instance of 3D BoundingBox.
Parameters:
minX - the X coordinate of the upper-left cornerminY - the Y coordinate of the upper-left corner
minZ - the minimum(最低限度) z coordinate of the BoundingBox
width - the width of the BoundingBox
height - the height of the BoundingBox
depth - the depth of the BoundingBox
contains
public boolean contains(double x, double y)Tests if the specified (x, y) coordinates are inside the boundary of Bounds. The points on the boundary(边界) are considered to lie inside the BoundingBox.
Specified by:
contains in class BoundsParameters:
x - the specified x coordinate to be tested
y - the specified y coordinate to be tested
Returns:
true if the specified (x, y) coordinates are inside the boundary of this Bounds; false otherwise.isEmpty
public boolean isEmpty()Indicates whether any of the dimensions(尺寸)(width, height or depth) of this bounds is less than zero.
Specified by:
isEmpty in class Bounds
Returns:
true if any of the dimensions(width, height or depth) of this bounds is less than zero.
intersects(相交)
public boolean intersects(Bounds b)
Tests if the interior(内部) of this Bounds intersects the interior(内部) of a specified Bounds, b.
Parameters:
b - The specified Bounds
Returns:
true if the interior of this Bounds and the interior of the specified Bounds, b, intersect.
Tests if the interior(内部) of this Bounds intersects the interior(内部) of a specified Bounds, b.
Specified by:
intersects in class BoundsParameters:
b - The specified Bounds
Returns:
true if the interior of this Bounds and the interior of the specified Bounds, b, intersect.
java代码:
package geometry;import javafx.geometry.BoundingBox;public class TestBoundingBox{public static void main(String[] args) {BoundingBox boundingBox = new BoundingBox(0,0,18.2,28.9);BoundingBox boundingBox2 = new BoundingBox(0,0,0,18.2,28.9,8);System.out.println(boundingBox.contains(3, 5)); //某个点是否在这个界限内 trueSystem.out.println(boundingBox.contains(30, 5));//falseBoundingBox boundingBox3 = new BoundingBox(0,0,0,-9);//一定要小于0才返回true,等于0都不返回,难道此方法是用来检测现在的状态是否正确//如果一个节点的边界之间相见都小于0了,那这是什么边界?根本就不可能的事情System.out.println(boundingBox3.isEmpty());System.out.println(boundingBox.intersects(boundingBox2));//相交System.out.println(boundingBox.intersects(boundingBox3));//不相交}}
- javafx.geometry.BoundingBox
- javafx.geometry.Point2D
- boundingbox回归
- geometry
- geometry
- geometry
- Geometry
- JavaFx
- JavaFX
- JavaFX
- javaFX
- JavaFx
- JAVAFX
- javafx
- JavaFX
- JavaFX
- javaFX
- javaFX
- 如何构建一套数据计算与报表相结合的系统?
- hive存储格式sequencefile和rcfile的对比
- linux tar命令使用详解
- Perfect Shuffle整理(又称洗牌问题,旧地置换算法)
- UVa 10130 - SuperSale 背包
- javafx.geometry.BoundingBox
- hive优化
- NYOJ 685 查找字符串 字典树
- SI使用技巧
- HDU 2444 The Accomodation of Students (二分图的最大匹配)
- 栈的经典应用
- C++ STL MAP 使用方法与应用介绍(三)
- HDU 2602
- 取石子——解题报告