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
ConstructorDescriptionALcd2DEditableFloatPolypoint
(float[] aPoints, boolean aHasBounds, boolean aBoundsInitialized, boolean aClone) ALcd2DEditableFloatPolypoint
(ALcd2DEditableFloatPolypoint aFloatPolypoint) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
calculateBounds
(ILcd2DEditableBounds aBoundsSFCT) This method should compute the bounds of the polypoint.protected void
calculateFocusPoint
(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()
.boolean
contains2D
(double aX, double aY) Checks whether thisILcdShape
contains the given point in the 2D space.protected abstract ILcd2DEditableBounds
Creates an uninitializedILcd2DEditableBounds
object of a type compatible with the concrete implementation of this class.protected abstract ILcd2DEditablePoint
Creates an uninitializedILcd2DEditablePoint
point of a type compatible with the concrete implementation of this class (geodesic/cartesian).boolean
Checks whether thisALcd2DEditableFloatPolypoint
is equal to the givenObject
.Returns theILcdBounds
by which the geometry of thisILcdBounded
object is bounded.Returns the focus point of thisILcdShape
.final ILcdPoint
getPoint
(int aIndex) Returns theILcdPoint
at a given index.final int
Returns the number ofILcdPoint
objects in the list.int
hashCode()
The hash code of this shape is the hash code of its class, in order to be consistent with theALcdShape.equals(Object)
method.void
insert2DPoint
(int aIndex, double aX, double aY) Inserts a point at the given index into thisILcd2DEditablePointList
.protected void
void
move2D
(double aX, double aY) Translates this shape so that its focus point ends up at the specified position.void
move2DPoint
(int aIndex, double aX, double aY) Moves the specified point of thisILcd2DEditablePointList
to the given point in the 2D space.void
removePointAt
(int aIndex) Removes the point at the given index from thisILcd2DEditablePointList
.void
translate2D
(double aDeltaX, double aDeltaY) Translates thisILcd2DEditableShape
from its current position over the given translation vector in the 2D space.void
translate2DPoint
(int aIndex, double aDeltaX, double aDeltaY) Translates the specified point of thisILcd2DEditablePointList
from its current position over the given translation vector in the 2D space.Methods inherited from class com.luciad.shape.shape2D.ALcd2DEditableShape
contains3D, move2D
Methods inherited from class com.luciad.shape.ALcdShape
contains2D, contains3D, fromDomainObject
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.shape.shape2D.ILcd2DEditablePointList
append2DPoint
Methods inherited from interface com.luciad.shape.shape2D.ILcd2DEditableShape
move2D
Methods inherited from interface com.luciad.shape.ILcdPointList
getPointSFCT, getX, getY, getZ
Methods 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:ILcdPointList
Returns the number ofILcdPoint
objects in the list.- Specified by:
getPointCount
in interfaceILcdPointList
- Returns:
- the number of
ILcdPoint
objects in the list.
-
getPoint
Description copied from interface:ILcdPointList
Returns theILcdPoint
at a given index.- Specified by:
getPoint
in interfaceILcdPointList
- Parameters:
aIndex
- a valid index in the list ofILcdPoint
objects.- Returns:
- the
ILcdPoint
at the given index.
-
move2DPoint
public void move2DPoint(int aIndex, double aX, double aY) Description copied from interface:ILcd2DEditablePointList
Moves the specified point of thisILcd2DEditablePointList
to the given point in the 2D space. Only the first two dimensions of theILcdShape
are considered. The third dimension is left unchanged.- Specified by:
move2DPoint
in 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:ILcd2DEditablePointList
Translates the specified point of thisILcd2DEditablePointList
from 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:
translate2DPoint
in 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:ILcd2DEditablePointList
Inserts a point at the given index into thisILcd2DEditablePointList
.- Specified by:
insert2DPoint
in 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:ILcd2DEditablePointList
Removes the point at the given index from thisILcd2DEditablePointList
.- Specified by:
removePointAt
in interfaceILcd2DEditablePointList
- Parameters:
aIndex
- a valid index in the list ofILcdPoint
objects.
-
invalidate
protected void invalidate() -
calculateBounds
This method should compute the bounds of the polypoint. The resultingILcd2DEditableBounds
should be stored inaBoundsSFCT
.- Parameters:
aBoundsSFCT
- assumes the location and the width and height of the bounds of the polypoint.
-
getBounds
Description copied from interface:ILcdBounded
Returns theILcdBounds
by which the geometry of thisILcdBounded
object 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
undefined
bounds. You can create undefined bounds using the default constructors ofTLcdLonLatBounds
orTLcdXYBounds
.- Specified by:
getBounds
in interfaceILcdBounded
- Returns:
- the
ILcdBounds
by which the geometry of thisILcdBounded
object is bounded.
-
calculateFocusPoint
Computes the focus point as the center of the bounding box. The resultingILcd2DEditablePoint
is stored inaFocusPoint
.- Parameters:
aFocusPointSFCT
- output parameter, will contain the location of the focus point.
-
getFocusPoint
Description copied from interface:ILcdShape
Returns the focus point of thisILcdShape
.- Specified by:
getFocusPoint
in interfaceILcdShape
- Returns:
- the focus point of this
ILcdShape
.
-
contains2D
public boolean contains2D(double aX, double aY) Description copied from interface:ILcdShape
Checks whether thisILcdShape
contains the given point in the 2D space. Only the first two dimensions of theILcdShape
are considered.- Specified by:
contains2D
in 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:ILcd2DEditableShape
Translates thisILcd2DEditableShape
from its current position over the given translation vector in the 2D space. Only the first two dimensions of theILcdShape
are considered. The third dimension is left unchanged.- Specified by:
translate2D
in interfaceILcd2DEditablePointList
- Specified by:
translate2D
in 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:ALcd2DEditableShape
Translates this shape so that its focus point ends up at the specified position.- Specified by:
move2D
in interfaceILcd2DEditableShape
- Overrides:
move2D
in classALcd2DEditableShape
- Parameters:
aX
- the x coordinate of the point.aY
- the y coordinate of the point.
-
equals
Checks whether thisALcd2DEditableFloatPolypoint
is equal to the givenObject
. -
clone
Description copied from class:ALcdShape
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 classALcdShape
- See Also:
-
hashCode
public int hashCode()Description copied from class:ALcdShape
The 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 uninitializedILcd2DEditablePoint
point 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 uninitializedILcd2DEditableBounds
object of a type compatible with the concrete implementation of this class. This bounds object will be updated and returned by thegetBounds()
method.
-