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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates and returns a copy of this object, by delegating toObject.clone().booleancontains2D(ILcdPoint aPoint) Checks whether thisALcdShapecontains the given point in the 2D cartesian plane.booleancontains3D(ILcdPoint aPoint) Checks whether thisALcdShapecontains the given point in the 3D space.booleanAn object is considered equal to this shape if it has the same class.static ILcdShapefromDomainObject(Object aObject) Returns a shape for the given object.inthashCode()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, waitMethods inherited from interface com.luciad.shape.ILcdBounded
getBoundsMethods inherited from interface com.luciad.shape.ILcdShape
contains2D, contains3D, getFocusPoint
-
Constructor Details
-
ALcdShape
public ALcdShape()
-
-
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
Objectis anILcdShape. - The
Objectis anILcdDataObjectwhose type contains aTLcdHasGeometryAnnotationwith anILcdShapeproperty.
In other cases, this method returns
null.One should never check if an
Objectis 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 thisALcdShapecontains the given point in the 2D cartesian plane.- Specified by:
contains2Din interfaceILcdShape- Parameters:
aPoint- the point to test.- Returns:
- the boolean result of the containment test.
- See Also:
-
contains3D
Checks whether thisALcdShapecontains the given point in the 3D space.- Specified by:
contains3Din 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:
clonein interfaceILcdCloneable- Overrides:
clonein 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.
-