Class ALcdBounds
- All Implemented Interfaces:
ILcdBounded,ILcdBounds,ILcdShape,ILcdCloneable,Serializable,Cloneable
- Direct Known Subclasses:
ALcd2DEditableBounds
ILcdBounds interface.
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains2D(double aX, double aY) Checks whether thisALcdBoundsobject contains the given point in the cartesian plane.booleancontains2D(double aX, double aY, double aWidth, double aHeight) Checks whether thisALcdBoundsobject contains the given rectangle in the cartesian plane.booleancontains2D(ILcdBounds aBounds) Checks whether thisALcdBoundsobject contains the givenILcdBoundsobject in the cartesian plane.booleancontains3D(double aX, double aY, double aZ) Checks whether thisALcdBoundsobject contains the given point in the 3D cartesian space.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.booleancontains3D(ILcdBounds aBounds) Checks whether thisALcdBoundsobject contains the givenILcdBoundsobject in the 3D cartesian space.booleanReturns whether the given object has the same class, and the same coordinates, width, height, and depth.static ILcdBoundsfromDomainObject(Object aObject) Returns the bounds of the given object.Returns theILcdBoundsby which the geometry of thisILcdBoundedobject is bounded.Returns the focus point of thisILcdShape.inthashCode()The hash code of this shape is the hash code of its class, in order to be consistent with theALcdShape.equals(Object)method.booleaninteracts2D(double aX, double aY, double aWidth, double aHeight) Checks whether thisALcdBoundsobject interacts with the given rectangle in the cartesian plane.booleaninteracts2D(ILcdBounds aBounds) Checks whether thisALcdBoundsobject interacts with the givenILcdBoundsobject 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.booleaninteracts3D(ILcdBounds aBounds) Checks whether thisALcdBoundsobject interacts with the givenILcdBoundsobject in the 3D cartesian space.static booleanisDefined(ILcdBounded aBounded) Checks whether the bounds of the given object aredefined.static booleanisDefined(ILcdBounds aBounds) Checks whether the given bounds aredefined.Methods inherited from class com.luciad.shape.ALcdShape
clone, contains2D, contains3DMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.luciad.shape.ILcdBounds
cloneAs2DEditableBounds, cloneAs3DEditableBounds, getCenter, getDepth, getHeight, getLocation, getMaxX, getMaxY, getMaxZ, getMinX, getMinY, getMinZ, getWidth, isDefinedMethods inherited from interface com.luciad.util.ILcdCloneable
cloneMethods inherited from interface com.luciad.shape.ILcdShape
contains2D, contains3D
-
Constructor Details
-
ALcdBounds
public ALcdBounds()
-
-
Method Details
-
fromDomainObject
Returns the bounds of the given object. The given object is usually a domain object, i.e. an object retrieved from the model. It returns bounds in the following cases:
- The given
Objectis anILcdBounded. - The
Objectis anILcdDataObjectwhose type contains aTLcdHasGeometryAnnotationwith anILcdShapeorALcdImageproperty
In other cases, this method returns
null.One should never check if an
Objectis a bounds usinginstanceof, but use this method instead and perform anull-check on the result.- Parameters:
aObject- an object, usually the domain object in a model.- Returns:
- the bounds associated with the given object or
null.
- The given
-
isDefined
Checks whether the given bounds aredefined.You can pass
nullas argument, which will result infalse.This method is shorthand for:
(aBounds != null && aBounds.isDefined())- Parameters:
aBounds- The bounds to check, can benull.- Returns:
falseif the given bounds arenullorundefined,trueotherwise
-
isDefined
Checks whether the bounds of the given object aredefined.You can pass
nullas argument, which will result infalse.This method is shorthand for:
ALcdBounds.isDefined(aBounded == null ? null : aBounded.getBounds())- Parameters:
aBounded- The element whose bounds to check, can benull.- Returns:
falseif the element isnullor its bounds areundefined,trueotherwise
-
getBounds
Description copied from interface:ILcdBoundedReturns theILcdBoundsby which the geometry of thisILcdBoundedobject is bounded.If the geometry does not allow retrieving valid bounds (for example a polyline with 0 points) the return value is unspecified. It is highly recommended to return an
undefinedbounds. You can create undefined bounds using the default constructors ofTLcdLonLatBoundsorTLcdXYBounds.- Specified by:
getBoundsin interfaceILcdBounded- Returns:
- the
ALcdBoundsobject itself.
-
getFocusPoint
Description copied from interface:ILcdShapeReturns the focus point of thisILcdShape.- Specified by:
getFocusPointin interfaceILcdShape- Returns:
- the location of the
ILcdBounds.
-
contains2D
public boolean contains2D(double aX, double aY) Checks whether thisALcdBoundsobject contains the given point in the cartesian plane. Only the first two dimensions of theILcdBoundsare considered, that is, the x coordinate and y coordinate of its location, its width, and its height.- Specified by:
contains2Din interfaceILcdShape- Parameters:
aX- the x coordinate of the point.aY- the y coordinate of the point.- Returns:
- the boolean result of the containment test.
-
contains3D
public boolean contains3D(double aX, double aY, double aZ) Checks whether thisALcdBoundsobject contains the given point 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 interfaceILcdShape- Parameters:
aX- the x coordinate of the point.aY- the y coordinate of the point.aZ- the z coordinate of the point.- Returns:
- the boolean result of the containment test.
- See Also:
-
interacts2D
Checks whether thisALcdBoundsobject interacts with the givenILcdBoundsobject in the cartesian plane.- Specified by:
interacts2Din interfaceILcdBounds- Parameters:
aBounds- theILcdBoundsto compare with.- Returns:
- the boolean result of the interaction test.
- See Also:
-
interacts2D
public boolean interacts2D(double aX, double aY, double aWidth, double aHeight) Checks 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- 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.
-
contains2D
Checks whether thisALcdBoundsobject contains the givenILcdBoundsobject in the cartesian plane.- Specified by:
contains2Din interfaceILcdBounds- Parameters:
aBounds- theILcdBoundsto compare with.- Returns:
- the boolean result of the containment test.
- See Also:
-
contains2D
public boolean contains2D(double aX, double aY, double aWidth, double aHeight) Checks 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- 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.
-
interacts3D
Checks whether thisALcdBoundsobject interacts with the givenILcdBoundsobject in the 3D cartesian space.- Specified by:
interacts3Din interfaceILcdBounds- Parameters:
aBounds- theILcdBoundsto compare with.- Returns:
- the boolean result of the interaction test.
- See Also:
-
interacts3D
public boolean interacts3D(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.- Specified by:
interacts3Din interfaceILcdBounds- 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
Checks whether thisALcdBoundsobject contains the givenILcdBoundsobject in the 3D cartesian space.- Specified by:
contains3Din interfaceILcdBounds- Parameters:
aBounds- theILcdBoundsto compare with.- Returns:
- the boolean result of the containment test.
- See Also:
-
contains3D
public boolean contains3D(double aX, double aY, double aZ, double aWidth, double aHeight, double aDepth) Checks 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- 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:
-
equals
Returns whether the given object has the same class, and the same coordinates, width, height, and depth. -
hashCode
public int hashCode()Description copied from class:ALcdShapeThe hash code of this shape is the hash code of its class, in order to be consistent with theALcdShape.equals(Object)method. Extensions should refine this implementation, based on their properties.
-