Package com.luciad.shape.shape3D
Class TLcd3DEditablePointList
java.lang.Object
com.luciad.shape.shape3D.TLcd3DEditablePointList
- All Implemented Interfaces:
ILcdPointList
,ILcdPointList2
,ILcd2DEditablePointList
,ILcd3DEditablePointList
,ILcdCloneable
,Serializable
,Cloneable
public class TLcd3DEditablePointList
extends Object
implements ILcd3DEditablePointList, ILcdCloneable, ILcdPointList, ILcdPointList2
This class provides an implementation of
ILcd3DEditablePointList
.
This implementation uses an array of the right size to store the list of
points, which is memory efficient, but inefficient for adding and
removing points.
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.
Note that the default implementation of the create3DEditablePoint(double, double, double)
method creates
cartesian points (TLcdXYZPoint), which are not suitable for use in geodetic shapes
(TLcdLonLatHeightPolypoint, TLcdLonLatHeightPolyline, etc).
- See Also:
-
Constructor Summary
ConstructorDescriptionConstructs a new emptyTLcd3DEditablePointList
.TLcd3DEditablePointList
(ILcd3DEditablePoint[] a3DEditablePoints, boolean aDeepCopy) Constructs a newTLcd3DEditablePointList
that contains the given array of points.TLcd3DEditablePointList
(ILcd3DEditablePointList aPointList, boolean aDeepCopy) Constructs a newTLcd3DEditablePointList
that is a copy of the givenILcd3DEditablePointList
. -
Method Summary
Modifier and TypeMethodDescriptionclone()
MakesObject.clone()
public.protected ILcd3DEditablePoint
create3DEditablePoint
(double aX, double aY, double aZ) Creates anILcd3DEditablePoint
with coordinates ( aX, aY, aZ ).final boolean
final ILcdPoint
getPoint
(int aIndex) Returns theILcdPoint
at a given index.final int
Returns the number ofILcdPoint
objects in the list.void
getPointSFCT
(int aIndex, ILcd3DEditablePoint aPointSFCT) Stores the coordinates of the point ataIndex
in the given point.double
getX
(int aIndex) Returns the X coordinate of the point ataIndex
.double
getY
(int aIndex) Returns the Y coordinate of the point ataIndex
.double
getZ
(int aIndex) Returns the Z coordinate of the point ataIndex
.final void
insert2DPoint
(int aIndex, double aX, double aY) Inserts a point at the given index into thisILcd2DEditablePointList
.final void
insert3DPoint
(int aIndex, double aX, double aY, double aZ) Inserts a point at the given index into thisILcd3DEditablePointList
.final void
insert3DPoint
(int aIndex, ILcd3DEditablePoint a3DEditablePoint) final void
move2DPoint
(int aIndex, double aX, double aY) Moves the specified point of thisILcd2DEditablePointList
to the given point in the 2D space.final void
move3DPoint
(int aIndex, double aX, double aY, double aZ) Moves the specified point of thisILcd3DEditablePointList
to the given point in the 3D space.final void
removePointAt
(int aIndex) Removes the point at the given index from thisILcd3DEditablePointList
.final void
translate2D
(double aDeltaX, double aDeltaY) Translates all the points of thisILcd2DEditablePointList
from their current positions over the given translation vector in the 2D space.final 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.final void
translate3D
(double aDeltaX, double aDeltaY, double aDeltaZ) Translates all the points of thisILcd3DEditablePointList
from their current positions over the given translation vector in the 3D space.final void
translate3DPoint
(int aIndex, double aX, double aY, double aZ) Translates the specified point of thisILcd3DEditablePointList
from its current position over the given translation vector in the 3D space.Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.shape.shape2D.ILcd2DEditablePointList
append2DPoint
-
Constructor Details
-
TLcd3DEditablePointList
public TLcd3DEditablePointList()Constructs a new emptyTLcd3DEditablePointList
. -
TLcd3DEditablePointList
Constructs a newTLcd3DEditablePointList
that is a copy of the givenILcd3DEditablePointList
.- Parameters:
aPointList
- theILcd3DEditablePointList
to copy.aDeepCopy
- a boolean indicating whether the individual points in the list should be cloned or just referenced.
-
TLcd3DEditablePointList
Constructs a newTLcd3DEditablePointList
that contains the given array of points.- Parameters:
a3DEditablePoints
- the array of points to copy.aDeepCopy
- a boolean indicating whether the array and the individual points in the list should be cloned or not.
-
-
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.
-
translate3D
public final void translate3D(double aDeltaX, double aDeltaY, double aDeltaZ) Description copied from interface:ILcd3DEditablePointList
Translates all the points of thisILcd3DEditablePointList
from their current positions over the given translation vector in the 3D space.- Specified by:
translate3D
in interfaceILcd3DEditablePointList
- Parameters:
aDeltaX
- the x coordinate of the translation vector.aDeltaY
- the y coordinate of the translation vector.aDeltaZ
- the z coordinate of the translation vector.
-
move3DPoint
public final void move3DPoint(int aIndex, double aX, double aY, double aZ) Description copied from interface:ILcd3DEditablePointList
Moves the specified point of thisILcd3DEditablePointList
to the given point in the 3D space.- Specified by:
move3DPoint
in interfaceILcd3DEditablePointList
- Parameters:
aIndex
- a valid index in the list of points.aX
- the x coordinate of the point.aY
- the y coordinate of the point.aZ
- the z coordinate of the point.
-
translate3DPoint
public final void translate3DPoint(int aIndex, double aX, double aY, double aZ) Description copied from interface:ILcd3DEditablePointList
Translates the specified point of thisILcd3DEditablePointList
from its current position over the given translation vector in the 3D space.- Specified by:
translate3DPoint
in interfaceILcd3DEditablePointList
- Parameters:
aIndex
- a valid new index in the list of points.aX
- the x coordinate of the translation vector.aY
- the y coordinate of the translation vector.aZ
- the z coordinate of the translation vector.
-
insert3DPoint
-
insert3DPoint
public final void insert3DPoint(int aIndex, double aX, double aY, double aZ) Description copied from interface:ILcd3DEditablePointList
Inserts a point at the given index into thisILcd3DEditablePointList
.- Specified by:
insert3DPoint
in interfaceILcd3DEditablePointList
- 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.aZ
- the z coordinate of the new point.
-
removePointAt
public final void removePointAt(int aIndex) Description copied from interface:ILcd3DEditablePointList
Removes the point at the given index from thisILcd3DEditablePointList
.- Specified by:
removePointAt
in interfaceILcd2DEditablePointList
- Specified by:
removePointAt
in interfaceILcd3DEditablePointList
- Parameters:
aIndex
- a valid index in the list ofILcdPoint
objects.
-
equals
-
translate2D
public final void translate2D(double aDeltaX, double aDeltaY) Description copied from interface:ILcd2DEditablePointList
Translates all the points of thisILcd2DEditablePointList
from their current positions 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:
translate2D
in interfaceILcd2DEditablePointList
- Parameters:
aDeltaX
- the x coordinate of the translation vector.aDeltaY
- the y coordinate of the translation vector.
-
move2DPoint
public final 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 final 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 final 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.
-
clone
Description copied from interface:ILcdCloneable
Makes
When for example extending fromObject.clone()
public.java.lang.Object
, it can be implemented like this:public Object clone() { try { return super.clone(); } catch ( CloneNotSupportedException e ) { // Cannot happen: extends from Object and implements Cloneable (see also Object.clone) throw new RuntimeException( e ); } }
- Specified by:
clone
in interfaceILcdCloneable
- Overrides:
clone
in classObject
- See Also:
-
create3DEditablePoint
Creates anILcd3DEditablePoint
with coordinates ( aX, aY, aZ ). By default this method creates a TLcdXYZPoint. To use the point list with a geodetic shape (TLcdLonLatHeightPolypoint, TLcdLonLatHeightPolyline, etc) you should override this method to create geodetic points (seeTLcdLonLatHeightPoint
)- Parameters:
aX
- The x-co-ordinate of the point to be created.aY
- The y-co-ordinate of the point to be created.aZ
- The z-co-ordinate of the point to be created.- Returns:
- An
ILcd3DEditablePoint
with coordinates ( aX, aY, aZ ).
-
getX
public double getX(int aIndex) Description copied from interface:ILcdPointList
Returns the X coordinate of the point ataIndex
.- Specified by:
getX
in interfaceILcdPointList
- Parameters:
aIndex
- the index of the point for which to return the X coordinate.- Returns:
- the X coordinate of the point at
aIndex
.
-
getY
public double getY(int aIndex) Description copied from interface:ILcdPointList
Returns the Y coordinate of the point ataIndex
.- Specified by:
getY
in interfaceILcdPointList
- Parameters:
aIndex
- the index of the point for which to return the Y coordinate.- Returns:
- the Y coordinate of the point at
aIndex
.
-
getZ
public double getZ(int aIndex) Description copied from interface:ILcdPointList
Returns the Z coordinate of the point ataIndex
.- Specified by:
getZ
in interfaceILcdPointList
- Parameters:
aIndex
- the index of the point for which to return the Z coordinate.- Returns:
- the Z coordinate of the point at
aIndex
.
-
getPointSFCT
Description copied from interface:ILcdPointList
Stores the coordinates of the point ataIndex
in the given point.- Specified by:
getPointSFCT
in interfaceILcdPointList
- Parameters:
aIndex
- the index of the point for which to retrieve the coordinates.aPointSFCT
- the side-effect parameter in which to store the coordinates of the requested point.
-