Class ALcdShape
- All Implemented Interfaces:
ILcdBounded
,ILcdShape
,ILcdCloneable
,Serializable
,Cloneable
- Direct Known Subclasses:
ALcd2DEditableShape
,ALcdBounds
,ALcdPoint
,ALcdShapeList
,TLcdComplexPolygon
,TLcdCompositeCurve
,TLcdLonLatHeightDome
,TLcdLonLatHeightSphere
,TLcdSurface
This abstract class provides a basis for implementing the ILcdShape
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.
Warning: when using extensions of this class directly as domain objects (=model elements),
make sure to override the equals(Object)
and hashCode()
methods so that two different domain objects
with the same geometry are not considered equal.
See the equals() and hashCode() requirements for domain objects article for more information.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Creates and returns a copy of this object, by delegating toObject.clone()
.boolean
contains2D
(ILcdPoint aPoint) Checks whether thisALcdShape
contains the given point in the 2D cartesian plane.boolean
contains3D
(ILcdPoint aPoint) Checks whether thisALcdShape
contains the given point in the 3D space.boolean
An object is considered equal to this shape if it has the same class.static ILcdShape
fromDomainObject
(Object aObject) Returns a shape for the given object.int
hashCode()
The hash code of this shape is the hash code of its class, in order to be consistent with theequals(Object)
method.Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.shape.ILcdBounded
getBounds
Methods inherited from interface com.luciad.shape.ILcdShape
contains2D, contains3D, getFocusPoint
-
Constructor Details
-
Method Details
-
fromDomainObject
Returns a shape for the given object. The given object is usually a domain object, i.e. an object retrieved from the model. It returns a shape in the following cases:
- The given
Object
is anILcdShape
. - The
Object
is anILcdDataObject
whose type contains aTLcdHasGeometryAnnotation
with anILcdShape
property.
In other cases, this method returns
null
.One should never check if an
Object
is a shape 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 shape associated with the given object or
null
.
- The given
-
contains2D
Checks whether thisALcdShape
contains the given point in the 2D cartesian plane.- Specified by:
contains2D
in interfaceILcdShape
- Parameters:
aPoint
- the point to test.- Returns:
- the boolean result of the containment test.
- See Also:
-
contains3D
Checks whether thisALcdShape
contains the given point in the 3D space.- Specified by:
contains3D
in interfaceILcdShape
- Parameters:
aPoint
- the point to test.- Returns:
- the boolean result of the containment test.
- See Also:
-
clone
Creates and returns a copy of this object, by delegating toObject.clone()
. Extensions should delegate to this implementation withsuper.clone()
, in order to create an object instance of the right type, with all fields copied. They then should explicitly clone any non-primitive fields for which a deeper clone is required.- Specified by:
clone
in interfaceILcdCloneable
- Overrides:
clone
in classObject
- See Also:
-
equals
An object is considered equal to this shape if it has the same class. Extensions should refine this comparison, based on their properties. -
hashCode
public int hashCode()The hash code of this shape is the hash code of its class, in order to be consistent with theequals(Object)
method. Extensions should refine this implementation, based on their properties.
-