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
ConstructorsConstructorDescriptionConstructs a new emptyTLcd3DEditablePointList.TLcd3DEditablePointList(ILcd3DEditablePoint[] a3DEditablePoints, boolean aDeepCopy) Constructs a newTLcd3DEditablePointListthat contains the given array of points.TLcd3DEditablePointList(ILcd3DEditablePointList aPointList, boolean aDeepCopy) Constructs a newTLcd3DEditablePointListthat is a copy of the givenILcd3DEditablePointList. -
Method Summary
Modifier and TypeMethodDescriptionclone()MakesObject.clone()public.protected ILcd3DEditablePointcreate3DEditablePoint(double aX, double aY, double aZ) Creates anILcd3DEditablePointwith coordinates ( aX, aY, aZ ).final booleanfinal ILcdPointgetPoint(int aIndex) Returns theILcdPointat a given index.final intReturns the number ofILcdPointobjects in the list.voidgetPointSFCT(int aIndex, ILcd3DEditablePoint aPointSFCT) Stores the coordinates of the point ataIndexin the given point.doublegetX(int aIndex) Returns the X coordinate of the point ataIndex.doublegetY(int aIndex) Returns the Y coordinate of the point ataIndex.doublegetZ(int aIndex) Returns the Z coordinate of the point ataIndex.final voidinsert2DPoint(int aIndex, double aX, double aY) Inserts a point at the given index into thisILcd2DEditablePointList.final voidinsert3DPoint(int aIndex, double aX, double aY, double aZ) Inserts a point at the given index into thisILcd3DEditablePointList.final voidinsert3DPoint(int aIndex, ILcd3DEditablePoint a3DEditablePoint) final voidmove2DPoint(int aIndex, double aX, double aY) Moves the specified point of thisILcd2DEditablePointListto the given point in the 2D space.final voidmove3DPoint(int aIndex, double aX, double aY, double aZ) Moves the specified point of thisILcd3DEditablePointListto the given point in the 3D space.final voidremovePointAt(int aIndex) Removes the point at the given index from thisILcd3DEditablePointList.final voidtranslate2D(double aDeltaX, double aDeltaY) Translates all the points of thisILcd2DEditablePointListfrom their current positions over the given translation vector in the 2D space.final 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.final voidtranslate3D(double aDeltaX, double aDeltaY, double aDeltaZ) Translates all the points of thisILcd3DEditablePointListfrom their current positions over the given translation vector in the 3D space.final voidtranslate3DPoint(int aIndex, double aX, double aY, double aZ) Translates the specified point of thisILcd3DEditablePointListfrom 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, waitMethods inherited from interface com.luciad.shape.shape2D.ILcd2DEditablePointList
append2DPoint
-
Constructor Details
-
TLcd3DEditablePointList
public TLcd3DEditablePointList()Constructs a new emptyTLcd3DEditablePointList. -
TLcd3DEditablePointList
Constructs a newTLcd3DEditablePointListthat is a copy of the givenILcd3DEditablePointList.- Parameters:
aPointList- theILcd3DEditablePointListto copy.aDeepCopy- a boolean indicating whether the individual points in the list should be cloned or just referenced.
-
TLcd3DEditablePointList
Constructs a newTLcd3DEditablePointListthat 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: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.
-
translate3D
public final void translate3D(double aDeltaX, double aDeltaY, double aDeltaZ) Description copied from interface:ILcd3DEditablePointListTranslates all the points of thisILcd3DEditablePointListfrom their current positions over the given translation vector in the 3D space.- Specified by:
translate3Din 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:ILcd3DEditablePointListMoves the specified point of thisILcd3DEditablePointListto the given point in the 3D space.- Specified by:
move3DPointin 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:ILcd3DEditablePointListTranslates the specified point of thisILcd3DEditablePointListfrom its current position over the given translation vector in the 3D space.- Specified by:
translate3DPointin 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:ILcd3DEditablePointListInserts a point at the given index into thisILcd3DEditablePointList.- Specified by:
insert3DPointin 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:ILcd3DEditablePointListRemoves the point at the given index from thisILcd3DEditablePointList.- Specified by:
removePointAtin interfaceILcd2DEditablePointList- Specified by:
removePointAtin interfaceILcd3DEditablePointList- Parameters:
aIndex- a valid index in the list ofILcdPointobjects.
-
equals
-
translate2D
public final void translate2D(double aDeltaX, double aDeltaY) Description copied from interface:ILcd2DEditablePointListTranslates all the points of thisILcd2DEditablePointListfrom 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:
translate2Din 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: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 final 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 final 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.
-
clone
Description copied from interface:ILcdCloneableMakes
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:
clonein interfaceILcdCloneable- Overrides:
clonein classObject- See Also:
-
create3DEditablePoint
Creates anILcd3DEditablePointwith 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
ILcd3DEditablePointwith coordinates ( aX, aY, aZ ).
-
getX
public double getX(int aIndex) Description copied from interface:ILcdPointListReturns the X coordinate of the point ataIndex.- Specified by:
getXin 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:ILcdPointListReturns the Y coordinate of the point ataIndex.- Specified by:
getYin 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:ILcdPointListReturns the Z coordinate of the point ataIndex.- Specified by:
getZin 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:ILcdPointListStores the coordinates of the point ataIndexin the given point.- Specified by:
getPointSFCTin 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.
-