Package com.luciad.shape.shape3D
Class TLcdXYZBounds
java.lang.Object
com.luciad.shape.ALcdShape
com.luciad.shape.ALcdBounds
com.luciad.shape.shape2D.ALcd2DEditableBounds
com.luciad.shape.shape3D.ALcd3DEditableBounds
com.luciad.shape.shape3D.TLcdXYZBounds
- All Implemented Interfaces:
ILcdBounded,ILcdBounds,ILcdShape,ILcd2DEditableBounds,ILcd2DEditableShape,ILcd3DEditableBounds,ILcd3DEditableShape,ILcdCloneable,Serializable,Cloneable
This class provides an implementation of
ILcd3DEditableBounds in
the cartesian space.
This class is thread-safe for concurrent read-only access of its contents. For read-write access, external locking must be used. Such locking is typically done at the model level.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new box, initialized to location (0, 0, 0) and size (0, 0, 0).TLcdXYZBounds(double aX, double aY, double aZ, double aWidth, double aHeight, double aDepth) Constructs and initializes a box with the specified parameters.TLcdXYZBounds(ILcdBounds aBounds) Constructs a new box, initialized to match the values of the specified box.TLcdXYZBounds(ILcdBounds aBounds, double aZ, double aDepth) Constructs a new box, initialized to match the values of the specified box.TLcdXYZBounds(ILcdPoint aPoint) Constructs a box with zero width and height at the specified point.TLcdXYZBounds(ILcdPoint aPoint, double aWidth, double aHeight, double aDepth) Constructs a box and initializes it to the specified point. -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates and returns a copy of this object.Returns a copy of thisILcdBoundsobject that is also anILcd2DEditableBounds.Returns a copy of thisILcdBoundsobject that is also anILcd3DEditableBounds.booleancontains2D(double aX, double aY, double aWidth, double aHeight) Checks whether thisALcdBoundsobject contains the given rectangle in the cartesian plane.booleancontains3D(double aX, double aY, double aZ, double aWidth, double aHeight, double aDepth) Checks whether thisALcdBoundsobject contains the given box in the 3D cartesian space.final doublegetDepth()Returns the depth of the bounding box.final doubleReturns the height of the bounding box.final ILcdPointReturns the location of the bounding box (smallest x and y coordinates).doublegetMaxX()Returns the maximum X value (right boundary) of this bounds.doublegetMaxY()Returns the maximum Y value (upper boundary) of this bounds.doublegetMaxZ()Returns the maximum Z value (top boundary) of this bounds.doublegetMinX()Returns the minimum X value (left boundary) of this bounds.doublegetMinY()Returns the minimum Y value (lower boundary) of this bounds.doublegetMinZ()Returns the minimum Z value (bottom boundary) of this bounds.final doublegetWidth()Returns the width of the bounding box.booleaninteracts2D(double aX, double aY, double aWidth, double aHeight) Checks whether thisALcdBoundsobject interacts with the given rectangle in the cartesian plane.booleaninteracts3D(double aX, double aY, double aZ, double aWidth, double aHeight, double aDepth) Checks whether thisALcdBoundsobject interacts with the given box in the 3D cartesian space.voidmove3D(double aX, double aY, double aZ) Moves thisILcd3DEditableShapeto the given point in the 3D space.voidsetDepth(double aDepth) Sets the depth of the bounds (the extent along the z-axis).voidsetHeight(double aHeight) Sets the height of the bounds (the extent along the y-axis).voidsetTo2DIntersection(double aX, double aY, double aWidth, double aHeight) Calculates the 2D intersection of thisALcd2DEditableBoundsand a given rectangle in the cartesian plane.voidsetTo2DUnion(double aX, double aY, double aWidth, double aHeight) Calculates the 2D union of thisALcd2DEditableBoundsand a given rectangle in the cartesian plane.voidsetTo3DIntersection(double aX, double aY, double aZ, double aWidth, double aHeight, double aDepth) Calculates the 3D intersection of thisALcd3DEditableBoundsand a given rectangle in the cartesian plane.voidsetTo3DUnion(double aX, double aY, double aZ, double aWidth, double aHeight, double aDepth) Calculates the 3D union of thisALcd3DEditableBoundsand a given rectangle in the cartesian plane.voidsetWidth(double aWidth) Sets the width of the bounds (the extent along the x-axis).Methods inherited from class com.luciad.shape.shape3D.ALcd3DEditableBounds
move2D, move3D, setTo3DIntersection, setTo3DUnion, setToIncludePoint3D, setToIncludePoint3D, toString, translate3DMethods inherited from class com.luciad.shape.shape2D.ALcd2DEditableBounds
isDefined, move2D, setDefined, setTo2DIntersection, setTo2DUnion, setToIncludePoint2D, setToIncludePoint2D, translate2DMethods inherited from class com.luciad.shape.ALcdBounds
contains2D, contains2D, contains3D, contains3D, equals, fromDomainObject, getBounds, getFocusPoint, hashCode, interacts2D, interacts3D, isDefined, isDefinedMethods inherited from class com.luciad.shape.ALcdShape
contains2D, contains3DMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.luciad.shape.shape2D.ILcd2DEditableBounds
move2D, move2D, setTo2DIntersection, setTo2DUnion, setToIncludePoint2D, setToIncludePoint2D, translate2DMethods inherited from interface com.luciad.shape.shape3D.ILcd3DEditableBounds
move3D, setTo3DIntersection, setTo3DUnion, setToIncludePoint3D, setToIncludePoint3D, translate3DMethods inherited from interface com.luciad.shape.ILcdBounded
getBoundsMethods inherited from interface com.luciad.shape.ILcdBounds
contains2D, contains3D, getCenter, interacts2D, interacts3D, isDefinedMethods inherited from interface com.luciad.shape.ILcdShape
contains2D, contains2D, contains3D, contains3D, getFocusPoint
-
Constructor Details
-
TLcdXYZBounds
public TLcdXYZBounds(double aX, double aY, double aZ, double aWidth, double aHeight, double aDepth) Constructs and initializes a box with the specified parameters.- Parameters:
aX- the x coordinate of the lower left point (smallest x coordinate).aY- the y coordinate of the lower left point (smallest y coordinate).aZ- the z coordinate of the lower left point (smallest z coordinate).aWidth- the width of the box.aHeight- the height of the box.aDepth- the depth of the box.
-
TLcdXYZBounds
public TLcdXYZBounds()Constructs a new box, initialized to location (0, 0, 0) and size (0, 0, 0).The
definedstatus of the instance isfalse. -
TLcdXYZBounds
Constructs a new box, initialized to match the values of the specified box.The
definedstatus of the instance is also copied from the specified bounds.- Parameters:
aBounds- a box from which to copy initial values.
-
TLcdXYZBounds
Constructs a new box, initialized to match the values of the specified box.- Parameters:
aBounds- 2D or 3D bounds from which to copy the 2D coordinates.aZ- the new z coordinate of the location.aDepth- the new depth of the box.
-
TLcdXYZBounds
Constructs a box and initializes it to the specified point.- Parameters:
aPoint- the lower left point of the box (smallest x and y coordinates).aWidth- the width of the box.aHeight- the height of the box.
-
TLcdXYZBounds
Constructs a box with zero width and height at the specified point.- Parameters:
aPoint- the lower left point of the box (smallest x and y coordinates) .
-
-
Method Details
-
getLocation
Description copied from interface:ILcdBoundsReturns the location of the bounding box (smallest x and y coordinates).- Specified by:
getLocationin interfaceILcdBounds- Returns:
- the location of the bounding box.
-
getMinX
public double getMinX()Description copied from interface:ILcdBoundsReturns the minimum X value (left boundary) of this bounds. By default, this doesgetLocation.getX(), but can be overridden for performance.- Specified by:
getMinXin interfaceILcdBounds- Returns:
- the minimum X boundary
- See Also:
-
getMinY
public double getMinY()Description copied from interface:ILcdBoundsReturns the minimum Y value (lower boundary) of this bounds. By default, this doesgetLocation.getY(), but can be overridden for performance.- Specified by:
getMinYin interfaceILcdBounds- Returns:
- the minimum Y boundary
- See Also:
-
getMinZ
public double getMinZ()Description copied from interface:ILcdBoundsReturns the minimum Z value (bottom boundary) of this bounds. By default, this doesgetLocation.getZ(), but can be overridden for performance.- Specified by:
getMinZin interfaceILcdBounds- Returns:
- the minimum Z boundary
- See Also:
-
getMaxX
public double getMaxX()Description copied from interface:ILcdBoundsReturns the maximum X value (right boundary) of this bounds. By default, this doesgetLocation.getX() + getWidth(), but can be overridden for performance. Note that this is a derived property, the bounds are defined by their lower-left corner and width/height. Forgeodetic bounds, the returned value is not necessarily normalized to [-180, 180].- Specified by:
getMaxXin interfaceILcdBounds- Returns:
- the maximum X boundary
- See Also:
-
getMaxY
public double getMaxY()Description copied from interface:ILcdBoundsReturns the maximum Y value (upper boundary) of this bounds. By default, this doesgetLocation.getY() + getHeight(), but can be overridden for performance. Note that this is a derived property, the bounds are defined by their lower-left corner and width/height.- Specified by:
getMaxYin interfaceILcdBounds- Returns:
- the maximum Y boundary
- See Also:
-
getMaxZ
public double getMaxZ()Description copied from interface:ILcdBoundsReturns the maximum Z value (top boundary) of this bounds. By default, this doesgetLocation.getZ() + getDepth(), but can be overridden for performance. Note that this is a derived property, the bounds are defined by their lower-left corner and width/height.- Specified by:
getMaxZin interfaceILcdBounds- Returns:
- the maximum Z boundary
- See Also:
-
getWidth
public final double getWidth()Description copied from interface:ILcdBoundsReturns the width of the bounding box. The width has to be larger than or equal to 0.- Specified by:
getWidthin interfaceILcdBounds- Returns:
- the width of the bounding box.
-
setWidth
public void setWidth(double aWidth) Description copied from interface:ILcd2DEditableBoundsSets the width of the bounds (the extent along the x-axis).If this bounds was
undefined, it becomes defined.- Specified by:
setWidthin interfaceILcd2DEditableBounds- Parameters:
aWidth- the new width.
-
getHeight
public final double getHeight()Description copied from interface:ILcdBoundsReturns the height of the bounding box. The height has to be larger than or equal to 0.- Specified by:
getHeightin interfaceILcdBounds- Returns:
- the height of the bounding box.
-
setHeight
public void setHeight(double aHeight) Description copied from interface:ILcd2DEditableBoundsSets the height of the bounds (the extent along the y-axis).If this bounds was
undefined, it becomes defined.- Specified by:
setHeightin interfaceILcd2DEditableBounds- Parameters:
aHeight- the new height.
-
getDepth
public final double getDepth()Description copied from interface:ILcdBoundsReturns the depth of the bounding box. The depth has to be larger than or equal to 0.- Specified by:
getDepthin interfaceILcdBounds- Overrides:
getDepthin classALcd2DEditableBounds- Returns:
- 0.
-
setDepth
public void setDepth(double aDepth) Description copied from interface:ILcd3DEditableBoundsSets the depth of the bounds (the extent along the z-axis).If this bounds is
undefined, it becomes defined.- Specified by:
setDepthin interfaceILcd3DEditableBounds- Parameters:
aDepth- the new depth.
-
move3D
public void move3D(double aX, double aY, double aZ) Description copied from interface:ILcd3DEditableBoundsMoves thisILcd3DEditableShapeto the given point in the 3D space. The focus point is used as the handle by which the shape is moved.If this bounds was
undefined, it becomes defined after the move.- Specified by:
move3Din interfaceILcd3DEditableBounds- Specified by:
move3Din interfaceILcd3DEditableShape- Parameters:
aX- the x coordinate of the point.aY- the y coordinate of the point.aZ- the z coordinate of the point.
-
cloneAs2DEditableBounds
Description copied from interface:ILcdBoundsReturns a copy of thisILcdBoundsobject that is also anILcd2DEditableBounds. This makes sure that the first two dimensions of the copy are writable, even if the originalILcdBoundsobject may be read-only.- Specified by:
cloneAs2DEditableBoundsin interfaceILcdBounds- Returns:
- a copy of this
ILcdBoundsobject that is also anILcd2DEditableBounds. This makes sure that the first two dimensions of the copy are writable, even if the originalILcdBoundsobject may be read-only. - See Also:
-
cloneAs3DEditableBounds
Description copied from interface:ILcdBoundsReturns a copy of thisILcdBoundsobject that is also anILcd3DEditableBounds. This makes sure that all three dimensions of the copy are writable, even if the originalILcdBoundsobject may be read-only.- Specified by:
cloneAs3DEditableBoundsin interfaceILcdBounds- Returns:
- a copy of this
ILcdBoundsobject that is also anILcd3DEditableBounds. This makes sure that all three dimensions of the copy are writable, even if the originalILcdBoundsobject may be read-only. - See Also:
-
clone
Creates and returns a copy of this object. The contained editable point representing the lower left point of the box is cloned.- Specified by:
clonein interfaceILcdCloneable- Overrides:
clonein classALcdShape- See Also:
-
setTo2DIntersection
public void setTo2DIntersection(double aX, double aY, double aWidth, double aHeight) Description copied from class:ALcd2DEditableBoundsCalculates the 2D intersection of thisALcd2DEditableBoundsand a given rectangle in the cartesian plane.- Specified by:
setTo2DIntersectionin interfaceILcd2DEditableBounds- Overrides:
setTo2DIntersectionin classALcd2DEditableBounds- Parameters:
aX- the x coordinate of the rectangle.aY- the y coordinate of the rectangle.aWidth- the width of the rectangle.aHeight- the height of the rectangle.
-
setTo2DUnion
public void setTo2DUnion(double aX, double aY, double aWidth, double aHeight) Description copied from class:ALcd2DEditableBoundsCalculates the 2D union of thisALcd2DEditableBoundsand a given rectangle in the cartesian plane.- Specified by:
setTo2DUnionin interfaceILcd2DEditableBounds- Overrides:
setTo2DUnionin classALcd2DEditableBounds- Parameters:
aX- the x coordinate of the rectangle.aY- the y coordinate of the rectangle.aWidth- the width of the rectangle.aHeight- the height of the rectangle.
-
setTo3DUnion
public void setTo3DUnion(double aX, double aY, double aZ, double aWidth, double aHeight, double aDepth) Description copied from class:ALcd3DEditableBoundsCalculates the 3D union of thisALcd3DEditableBoundsand a given rectangle in the cartesian plane.- Specified by:
setTo3DUnionin interfaceILcd3DEditableBounds- Overrides:
setTo3DUnionin classALcd3DEditableBounds- Parameters:
aX- the x coordinate of the box.aY- the y coordinate of the box.aZ- the z coordinate of the box.aWidth- the width of the box.aHeight- the height of the box.aDepth- the depth of the box.
-
setTo3DIntersection
public void setTo3DIntersection(double aX, double aY, double aZ, double aWidth, double aHeight, double aDepth) Description copied from class:ALcd3DEditableBoundsCalculates the 3D intersection of thisALcd3DEditableBoundsand a given rectangle in the cartesian plane.- Specified by:
setTo3DIntersectionin interfaceILcd3DEditableBounds- Overrides:
setTo3DIntersectionin classALcd3DEditableBounds- Parameters:
aX- the x coordinate of the box.aY- the y coordinate of the box.aZ- the z coordinate of the box.aWidth- the width of the box.aHeight- the height of the box.aDepth- the depth of the box.
-
contains2D
public boolean contains2D(double aX, double aY, double aWidth, double aHeight) Description copied from class:ALcdBoundsChecks whether thisALcdBoundsobject contains the given rectangle in the cartesian plane. Only the first two dimensions of theILcdBoundsobject are considered, that is, the x coordinate and y coordinate of its location, its width, and its height.- Specified by:
contains2Din interfaceILcdBounds- Overrides:
contains2Din classALcdBounds- Parameters:
aX- the x coordinate of the rectangle.aY- the y coordinate of the rectangle.aWidth- the width of the rectangle.aHeight- the height of the rectangle.- Returns:
- the boolean result of the containment test.
-
interacts2D
public boolean interacts2D(double aX, double aY, double aWidth, double aHeight) Description copied from class:ALcdBoundsChecks whether thisALcdBoundsobject interacts with the given rectangle in the cartesian plane. Only the first two dimensions of theILcdBoundsobject are considered, that is, the x coordinate and y coordinate of its location, its width, and its height.- Specified by:
interacts2Din interfaceILcdBounds- Overrides:
interacts2Din classALcdBounds- Parameters:
aX- the x coordinate of the rectangle.aY- the y coordinate of the rectangle.aWidth- the width of the rectangle.aHeight- the height of the rectangle.- Returns:
trueif thisALcdBoundsobject touches or overlaps to any extent with the given rectangle,falseotherwise.
-
interacts3D
public boolean interacts3D(double aX, double aY, double aZ, double aWidth, double aHeight, double aDepth) Description copied from class:ALcdBoundsChecks whether thisALcdBoundsobject interacts with the given box in the 3D cartesian space.- Specified by:
interacts3Din interfaceILcdBounds- Overrides:
interacts3Din classALcdBounds- Parameters:
aX- the x coordinate of the box.aY- the y coordinate of the box.aZ- the z coordinate of the box.aWidth- the width of the box.aHeight- the height of the box.aDepth- the depth of the box.- Returns:
trueif thisALcdBoundsobject touches or overlaps to any extent with the given box,falseotherwise.
-
contains3D
public boolean contains3D(double aX, double aY, double aZ, double aWidth, double aHeight, double aDepth) Description copied from class:ALcdBoundsChecks whether thisALcdBoundsobject contains the given box in the 3D cartesian space. All three spatial dimensions of theILcdBoundsare considered, as a combination ofcontains2Dand a test in the third dimension.- Specified by:
contains3Din interfaceILcdBounds- Overrides:
contains3Din classALcdBounds- Parameters:
aX- the x coordinate of the point.aY- the y coordinate of the point.aZ- the z coordinate of the point.aWidth- the width of the box.aHeight- the height of the box.aDepth- the depth of the box.- Returns:
- the boolean result of the containment test.
- See Also:
-