Class ALcdShape

java.lang.Object
com.luciad.shape.ALcdShape
All Implemented Interfaces:
ILcdBounded, ILcdShape, ILcdCloneable, Serializable, Cloneable
Direct Known Subclasses:
ALcd2DEditableShape, ALcdBounds, ALcdPoint, ALcdShapeList, TLcdComplexPolygon, TLcdCompositeCurve, TLcdLonLatHeightDome, TLcdLonLatHeightSphere, TLcdSurface

public abstract class ALcdShape extends Object implements ILcdShape

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 Details

    • ALcdShape

      public ALcdShape()
  • Method Details

    • fromDomainObject

      public static ILcdShape fromDomainObject(Object aObject)

      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 an ILcdShape.
      • The Object is an ILcdDataObject whose type contains a TLcdHasGeometryAnnotation with an ILcdShape property.

      In other cases, this method returns null.

      One should never check if an Object is a shape using instanceof, but use this method instead and perform a null-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.
    • contains2D

      public boolean contains2D(ILcdPoint aPoint)
      Checks whether this ALcdShape contains the given point in the 2D cartesian plane.
      Specified by:
      contains2D in interface ILcdShape
      Parameters:
      aPoint - the point to test.
      Returns:
      the boolean result of the containment test.
      See Also:
    • contains3D

      public boolean contains3D(ILcdPoint aPoint)
      Checks whether this ALcdShape contains the given point in the 3D space.
      Specified by:
      contains3D in interface ILcdShape
      Parameters:
      aPoint - the point to test.
      Returns:
      the boolean result of the containment test.
      See Also:
    • clone

      public Object clone()
      Creates and returns a copy of this object, by delegating to Object.clone(). Extensions should delegate to this implementation with super.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 interface ILcdCloneable
      Overrides:
      clone in class Object
      See Also:
    • equals

      public boolean equals(Object aObject)
      An object is considered equal to this shape if it has the same class. Extensions should refine this comparison, based on their properties.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      The hash code of this shape is the hash code of its class, in order to be consistent with the equals(Object) method. Extensions should refine this implementation, based on their properties.
      Overrides:
      hashCode in class Object