Package com.luciad.ais.shape
Class TLcdAISPoint
java.lang.Object
com.luciad.ais.shape.TLcdAISPoint
- All Implemented Interfaces:
ILcdBounded,ILcdPoint,ILcdShape,ILcd2DEditablePoint,ILcd2DEditableShape,ILcd3DEditablePoint,ILcd3DEditableShape,ILcdCloneable,Serializable,Cloneable
- Direct Known Subclasses:
TLcdAerodrome,TLcdArrestingGear,TLcdDME,TLcdGeoPathLeg,TLcdGlidePath,TLcdLocalizer,TLcdLocationBasedService,TLcdMarker,TLcdMilitaryTrainingRoutePoint,TLcdNDB,TLcdObstacle,TLcdRefuelingTrackPoint,TLcdRunwayClinePoint,TLcdSubPointlistAirspaceSegment,TLcdTACAN,TLcdVFRRoutePoint,TLcdVOR,TLcdWayPoint
An generic point class that delegates to another ILcd3DEditablePoint instance.
This allows the use of different ILcd3DEditablePoint implementations within
this single point class. For example, TLcdAISPoint can mimic a geodetic or a cartesian point
by setting the delegate point to an instance of TLcdLonLatHeightPoint or TLcdXYZPoint
respectively. This is the typical use in AIS, because it allows a single domain object
to be used in geodetic and grid references by just changing the type of the delegate point.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionThis default constructor creates a TLcdAISPoint which has no location yet.TLcdAISPoint(ILcd3DEditablePoint aPoint) Constructs a TLcdAISPoint which delegates to the supplied aPoint. -
Method Summary
Modifier and TypeMethodDescriptionclone()MakesObject.clone()public.Returns a copy of thisILcdPointthat is also anILcd2DEditablePoint.Returns a copy of thisILcdPointthat is also anILcd3DEditablePoint.booleancontains2D(double v, double v1) Checks whether thisILcdShapecontains the given point in the 2D space.booleancontains2D(ILcdPoint aPoint) Checks whether thisILcdShapecontains the givenILcdPointin the 2D space.booleancontains3D(double v, double v1, double v2) Checks whether thisILcdShapecontains the given point in the 3D space.booleancontains3D(ILcdPoint aPoint) Checks whether thisILcdShapecontains the givenILcdPointin the 3D space.booleanChecks whether thisILcdPointis equal to the givenObject.Returns theILcdBoundsby which the geometry of thisILcdBoundedobject is bounded.doublegetCosX()Returns cos(getX()* DEG2RAD ).doublegetCosY()Returns cos(getY()* DEG2RAD ).Returns the focus point of thisILcdShape.doublegetSinX()Returns sin(getX()* DEG2RAD ).doublegetSinY()Returns sin(getY()* DEG2RAD ).doublegetTanX()Returns tan(getX()* DEG2RAD ).doublegetTanY()Returns tan(getY()* DEG2RAD ).doublegetX()Returns the x coordinate of thisILcdPoint.doublegetY()Returns the y coordinate of thisILcdPoint.doublegetZ()Returns the z coordinate of thisILcdPoint.inthashCode()voidmove2D(double v, double v1) Moves thisILcd2DEditableShapeto the given point in the 2D space.voidMoves thisILcd2DEditableShapeto the given point in the 2D space.voidmove3D(double v, double v1, double v2) Moves thisILcd3DEditableShapeto the given point in the 3D space.voidMoves thisILcd3DEditableShapeto the given point in the 3D space.voidsetLocation(ILcd3DEditablePoint aPoint) Sets the delegate point to aPoint.voidtranslate2D(double v, double v1) Translates thisILcd2DEditableShapefrom its current position over the given translation vector in the 2D space.voidtranslate3D(double v, double v1, double v2) Translates thisILcd3DEditableShapefrom its current position over the given translation vector in the 3D space.
-
Constructor Details
-
TLcdAISPoint
public TLcdAISPoint()This default constructor creates a TLcdAISPoint which has no location yet. It is necessary to callsetLocationbefore the created point can be used. Otherwise any ILcd3DEditablePoint operation will throw a null pointer exception. -
TLcdAISPoint
Constructs a TLcdAISPoint which delegates to the supplied aPoint.- Parameters:
aPoint- a point that will be used directly as location; it is not cloned.
-
-
Method Details
-
setLocation
Sets the delegate point to aPoint.- Parameters:
aPoint-
-
getX
public double getX()Description copied from interface:ILcdPointReturns the x coordinate of thisILcdPoint. -
getY
public double getY()Description copied from interface:ILcdPointReturns the y coordinate of thisILcdPoint. -
getZ
public double getZ()Description copied from interface:ILcdPointReturns the z coordinate of thisILcdPoint. -
getCosX
public double getCosX()Description copied from interface:ILcdPointReturns cos(getX()* DEG2RAD ). -
getCosY
public double getCosY()Description copied from interface:ILcdPointReturns cos(getY()* DEG2RAD ). -
getSinX
public double getSinX()Description copied from interface:ILcdPointReturns sin(getX()* DEG2RAD ). -
getSinY
public double getSinY()Description copied from interface:ILcdPointReturns sin(getY()* DEG2RAD ). -
getTanX
public double getTanX()Description copied from interface:ILcdPointReturns tan(getX()* DEG2RAD ). -
getTanY
public double getTanY()Description copied from interface:ILcdPointReturns tan(getY()* DEG2RAD ). -
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:
-
equals
Description copied from interface:ILcdPointChecks whether thisILcdPointis equal to the givenObject.- Specified by:
equalsin interfaceILcdPoint- Overrides:
equalsin classObject- Parameters:
aObject- theObjectto compare to.- Returns:
- false if aObject is an ILcdPoint object with different 3D coordinates or the object is not an ILcdPoint. If the objects do have the same 3D coordinates, the return value is defined by the specific implementations of ILcdPoint and may still be false.
-
hashCode
public int hashCode() -
cloneAs2DEditablePoint
Description copied from interface:ILcdPointReturns a copy of thisILcdPointthat is also anILcd2DEditablePoint. This makes sure that the first two dimensions of the copy are writable,- Specified by:
cloneAs2DEditablePointin interfaceILcdPoint- Returns:
- cloneAs2DEditablePoint performed on the delegate point, and not a cloned instance of this TLcdAISPoint. This is to prevent nested TLcdAISPoints.
- See Also:
-
cloneAs3DEditablePoint
Description copied from interface:ILcdPointReturns a copy of thisILcdPointthat is also anILcd3DEditablePoint. This makes sure that all three dimensions of the copy are writable,- Specified by:
cloneAs3DEditablePointin interfaceILcdPoint- Returns:
- cloneAs3DEditablePoint performed on the delegate point, and not a cloned instance of this TLcdAISPoint. This is to prevent nested TLcdAISPoints.
- See Also:
-
getFocusPoint
Description copied from interface:ILcdShapeReturns the focus point of thisILcdShape.- Specified by:
getFocusPointin interfaceILcdShape- Returns:
- the focus point of this
ILcdShape.
-
contains2D
Description copied from interface:ILcdShapeChecks whether thisILcdShapecontains the givenILcdPointin the 2D space. Only the first two dimensions of theILcdShapeand theILcdPointare considered.- Specified by:
contains2Din interfaceILcdShape- Parameters:
aPoint- theILcdPointto test.- Returns:
- the boolean result of the containment test.
- See Also:
-
contains2D
public boolean contains2D(double v, double v1) 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:
v- the x coordinate of the point.v1- the y coordinate of the point.- Returns:
- the boolean result of the containment test.
-
contains3D
Description copied from interface:ILcdShapeChecks whether thisILcdShapecontains the givenILcdPointin the 3D space.- Specified by:
contains3Din interfaceILcdShape- Parameters:
aPoint- theILcdPointto test.- Returns:
- the boolean result of the containment test.
- See Also:
-
contains3D
public boolean contains3D(double v, double v1, double v2) Description copied from interface:ILcdShapeChecks whether thisILcdShapecontains the given point in the 3D space.- Specified by:
contains3Din interfaceILcdShape- Parameters:
v- the x coordinate of the point.v1- the y coordinate of the point.v2- the z coordinate of the point.- Returns:
- the boolean result of the containment test.
-
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.
-
move2D
Description copied from interface:ILcd2DEditableShapeMoves thisILcd2DEditableShapeto the given point in the 2D space. The focus point is used as the handle by which the shape is moved. Only the first two dimensions of theILcdShapeand theILcdPointare considered. The third dimension is left unchanged.- Specified by:
move2Din interfaceILcd2DEditableShape- Parameters:
aPoint- theILcdPointto move to.- See Also:
-
move2D
public void move2D(double v, double v1) Description copied from interface:ILcd2DEditableShapeMoves thisILcd2DEditableShapeto the given point in the 2D space. The focus point is used as the handle by which the shape is moved. Only the first two dimensions of theILcdShapeare considered. The third dimension is left unchanged.- Specified by:
move2Din interfaceILcd2DEditableShape- Parameters:
v- the x coordinate of the point.v1- the y coordinate of the point.
-
translate2D
public void translate2D(double v, double v1) 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 interfaceILcd2DEditableShape- Parameters:
v- the x coordinate of the translation vector.v1- the y coordinate of the translation vector.
-
move3D
Description copied from interface:ILcd3DEditableShapeMoves thisILcd3DEditableShapeto the given point in the 3D space. The focus point is used as the handle by which the shape is moved.- Specified by:
move3Din interfaceILcd3DEditableShape- Parameters:
aPoint- theILcdPointto move to.- See Also:
-
move3D
public void move3D(double v, double v1, double v2) Description copied from interface:ILcd3DEditableShapeMoves thisILcd3DEditableShapeto the given point in the 3D space. The focus point is used as the handle by which the shape is moved.- Specified by:
move3Din interfaceILcd3DEditableShape- Parameters:
v- the x coordinate of the point.v1- the y coordinate of the point.v2- the z coordinate of the point.
-
translate3D
public void translate3D(double v, double v1, double v2) Description copied from interface:ILcd3DEditableShapeTranslates thisILcd3DEditableShapefrom its current position over the given translation vector in the 3D space.- Specified by:
translate3Din interfaceILcd3DEditableShape- Parameters:
v- the x coordinate of the translation vector.v1- the y coordinate of the translation vector.v2- the z coordinate of the translation vector.
-