Package com.luciad.shape.shape2D
Class ALcd2DEditableFloatPolypoint
java.lang.Object
com.luciad.shape.ALcdShape
com.luciad.shape.shape2D.ALcd2DEditableShape
com.luciad.shape.shape2D.ALcd2DEditableFloatPolypoint
- All Implemented Interfaces:
ILcdBounded,ILcdPointList,ILcdPolypoint,ILcdShape,ILcd2DEditablePointList,ILcd2DEditablePolypoint,ILcd2DEditableShape,ILcdCloneable,Serializable,Cloneable
- Direct Known Subclasses:
TLcdLonLatFloatPolygon,TLcdLonLatFloatPolyline,TLcdLonLatFloatPolypoint,TLcdXYFloatPolygon,TLcdXYFloatPolyline,TLcdXYFloatPolypoint
public abstract class ALcd2DEditableFloatPolypoint
extends ALcd2DEditableShape
implements ILcd2DEditablePolypoint
This abstract class provides a basis for implementing the
ILcd2DEditablePolypoint
interface.
This class is not thread-safe.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionALcd2DEditableFloatPolypoint(float[] aPoints, boolean aHasBounds, boolean aBoundsInitialized, boolean aClone) ALcd2DEditableFloatPolypoint(ALcd2DEditableFloatPolypoint aFloatPolypoint) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcalculateBounds(ILcd2DEditableBounds aBoundsSFCT) This method should compute the bounds of the polypoint.protected voidcalculateFocusPoint(ILcd2DEditablePoint aFocusPointSFCT) Computes the focus point as the center of the bounding box.clone()Creates and returns a copy of this object, by delegating toObject.clone().booleancontains2D(double aX, double aY) Checks whether thisILcdShapecontains the given point in the 2D space.protected abstract ILcd2DEditableBoundsCreates an uninitializedILcd2DEditableBoundsobject of a type compatible with the concrete implementation of this class.protected abstract ILcd2DEditablePointCreates an uninitializedILcd2DEditablePointpoint of a type compatible with the concrete implementation of this class (geodesic/cartesian).booleanChecks whether thisALcd2DEditableFloatPolypointis equal to the givenObject.Returns theILcdBoundsby which the geometry of thisILcdBoundedobject is bounded.Returns the focus point of thisILcdShape.final ILcdPointgetPoint(int aIndex) Returns theILcdPointat a given index.final intReturns the number ofILcdPointobjects in the list.inthashCode()The hash code of this shape is the hash code of its class, in order to be consistent with theALcdShape.equals(Object)method.voidinsert2DPoint(int aIndex, double aX, double aY) Inserts a point at the given index into thisILcd2DEditablePointList.protected voidvoidmove2D(double aX, double aY) Translates this shape so that its focus point ends up at the specified position.voidmove2DPoint(int aIndex, double aX, double aY) Moves the specified point of thisILcd2DEditablePointListto the given point in the 2D space.voidremovePointAt(int aIndex) Removes the point at the given index from thisILcd2DEditablePointList.voidtranslate2D(double aDeltaX, double aDeltaY) Translates thisILcd2DEditableShapefrom its current position over the given translation vector in the 2D space.voidtranslate2DPoint(int aIndex, double aDeltaX, double aDeltaY) Translates the specified point of thisILcd2DEditablePointListfrom its current position over the given translation vector in the 2D space.Methods inherited from class com.luciad.shape.shape2D.ALcd2DEditableShape
contains3D, move2DMethods inherited from class com.luciad.shape.ALcdShape
contains2D, contains3D, fromDomainObjectMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.luciad.shape.shape2D.ILcd2DEditablePointList
append2DPointMethods inherited from interface com.luciad.shape.shape2D.ILcd2DEditableShape
move2DMethods inherited from interface com.luciad.shape.ILcdPointList
getPointSFCT, getX, getY, getZMethods inherited from interface com.luciad.shape.ILcdShape
contains2D, contains3D, contains3D
-
Constructor Details
-
ALcd2DEditableFloatPolypoint
public ALcd2DEditableFloatPolypoint() -
ALcd2DEditableFloatPolypoint
public ALcd2DEditableFloatPolypoint(float[] aPoints, boolean aHasBounds, boolean aBoundsInitialized, boolean aClone) -
ALcd2DEditableFloatPolypoint
-
-
Method Details
-
getPointCount
public final int getPointCount()Description copied from interface:ILcdPointListReturns the number ofILcdPointobjects in the list.- Specified by:
getPointCountin interfaceILcdPointList- Returns:
- the number of
ILcdPointobjects in the list.
-
getPoint
Description copied from interface:ILcdPointListReturns theILcdPointat a given index.- Specified by:
getPointin interfaceILcdPointList- Parameters:
aIndex- a valid index in the list ofILcdPointobjects.- Returns:
- the
ILcdPointat the given index.
-
move2DPoint
public void move2DPoint(int aIndex, double aX, double aY) Description copied from interface:ILcd2DEditablePointListMoves the specified point of thisILcd2DEditablePointListto the given point in the 2D space. Only the first two dimensions of theILcdShapeare considered. The third dimension is left unchanged.- Specified by:
move2DPointin interfaceILcd2DEditablePointList- Parameters:
aIndex- a valid index in the list of points.aX- the x coordinate of the point.aY- the y coordinate of the point.
-
translate2DPoint
public void translate2DPoint(int aIndex, double aDeltaX, double aDeltaY) Description copied from interface:ILcd2DEditablePointListTranslates the specified point of thisILcd2DEditablePointListfrom its current position over the given translation vector in the 2D space. Only the first two dimensions of the points are considered. The third dimension is left unchanged.- Specified by:
translate2DPointin interfaceILcd2DEditablePointList- Parameters:
aDeltaX- the x coordinate of the translation vector.aDeltaY- the y coordinate of the translation vector.
-
insert2DPoint
public void insert2DPoint(int aIndex, double aX, double aY) Description copied from interface:ILcd2DEditablePointListInserts a point at the given index into thisILcd2DEditablePointList.- Specified by:
insert2DPointin interfaceILcd2DEditablePointList- Parameters:
aIndex- a valid new index in the list of points.aX- the x coordinate of the new point.aY- the y coordinate of the new point.
-
removePointAt
public void removePointAt(int aIndex) Description copied from interface:ILcd2DEditablePointListRemoves the point at the given index from thisILcd2DEditablePointList.- Specified by:
removePointAtin interfaceILcd2DEditablePointList- Parameters:
aIndex- a valid index in the list ofILcdPointobjects.
-
invalidate
protected void invalidate() -
calculateBounds
This method should compute the bounds of the polypoint. The resultingILcd2DEditableBoundsshould be stored inaBoundsSFCT.- Parameters:
aBoundsSFCT- assumes the location and the width and height of the bounds of the polypoint.
-
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
ILcdBoundsby which the geometry of thisILcdBoundedobject is bounded.
-
calculateFocusPoint
Computes the focus point as the center of the bounding box. The resultingILcd2DEditablePointis stored inaFocusPoint.- Parameters:
aFocusPointSFCT- output parameter, will contain the location of the focus point.
-
getFocusPoint
Description copied from interface:ILcdShapeReturns the focus point of thisILcdShape.- Specified by:
getFocusPointin interfaceILcdShape- Returns:
- the focus point of this
ILcdShape.
-
contains2D
public boolean contains2D(double aX, double aY) Description copied from interface:ILcdShapeChecks whether thisILcdShapecontains the given point in the 2D space. Only the first two dimensions of theILcdShapeare considered.- 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.
-
translate2D
public void translate2D(double aDeltaX, double aDeltaY) Description copied from interface:ILcd2DEditableShapeTranslates thisILcd2DEditableShapefrom its current position over the given translation vector in the 2D space. Only the first two dimensions of theILcdShapeare considered. The third dimension is left unchanged.- Specified by:
translate2Din interfaceILcd2DEditablePointList- Specified by:
translate2Din interfaceILcd2DEditableShape- Parameters:
aDeltaX- the x coordinate of the translation vector.aDeltaY- the y coordinate of the translation vector.
-
move2D
public void move2D(double aX, double aY) Description copied from class:ALcd2DEditableShapeTranslates this shape so that its focus point ends up at the specified position.- Specified by:
move2Din interfaceILcd2DEditableShape- Overrides:
move2Din classALcd2DEditableShape- Parameters:
aX- the x coordinate of the point.aY- the y coordinate of the point.
-
equals
Checks whether thisALcd2DEditableFloatPolypointis equal to the givenObject. -
clone
Description copied from class:ALcdShapeCreates 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 classALcdShape- See Also:
-
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. -
createPoint
Creates an uninitializedILcd2DEditablePointpoint of a type compatible with the concrete implementation of this class (geodesic/cartesian). The created point will be updated and returned by thegetPoint(int)andgetFocusPoint()methods. -
createBounds
Creates an uninitializedILcd2DEditableBoundsobject of a type compatible with the concrete implementation of this class. This bounds object will be updated and returned by thegetBounds()method.
-