Class TLcdGeneralPath

java.lang.Object
com.luciad.view.gxy.TLcdGeneralPath
All Implemented Interfaces:
ILcdGeneralPath

public class TLcdGeneralPath extends Object implements ILcdGeneralPath
This class provides an implementation of an ILcdGeneralPath.

Like a Vector, each TLcdGeneralPath tries to optimize storage management by maintaining a capacity and a capacityIncrementFraction, in this case for storing all of its points. The capacity is always at least as large as the number of stored points. It is usually larger, because as points are added to the path, the path's storage increases by a factor of capacityIncrementFraction. Note that this is a relative increment (e.g. 0.5 for 50%), unlike the increment for Vector, which is absolute. An application can ensure a certain capacity of a path before inserting a large number of points; this reduces the amount of incremental reallocation. An application can also trim the capacity to the actual size of the path after having inserted a set of points; this reduces the eventual memory usage.

  • Constructor Details

    • TLcdGeneralPath

      public TLcdGeneralPath()
    • TLcdGeneralPath

      public TLcdGeneralPath(int aInitialCapacity)
    • TLcdGeneralPath

      public TLcdGeneralPath(int aInitialCapacity, double aCapacityIncrementFraction)
  • Method Details

    • reset

      public void reset()
      Description copied from interface: ILcdGeneralPath
      Resets the path. The path becomes empty, containing no subpaths and thus no points.
      Specified by:
      reset in interface ILcdGeneralPath
    • moveTo

      public void moveTo(double aX, double aY)
      Description copied from interface: ILcdGeneralPath
      Breaks the current line and moves to the world point (aX, aY).
      Specified by:
      moveTo in interface ILcdGeneralPath
    • lineTo

      public void lineTo(double aX, double aY)
      Description copied from interface: ILcdGeneralPath
      Appends a line to the world point (aX, aY).
      Specified by:
      lineTo in interface ILcdGeneralPath
    • breakLine

      public void breakLine()
      Description copied from interface: ILcdGeneralPath
      Appends a line break to the path. Subsequent points will define a new polyline. The points will continue to define the same current polygon, however. For example, when a polygon in a model is represented by more than 1 polygon in world coordinates. This is possible in some projections where the polygon is at the edge of the projection and wraps around to the other edge.
      Specified by:
      breakLine in interface ILcdGeneralPath
    • breakPolygon

      public void breakPolygon()
      Description copied from interface: ILcdGeneralPath
      Appends a polygon break to the path. Subsequent points will define a detached polygonal piece of the current polygon.
      Specified by:
      breakPolygon in interface ILcdGeneralPath
    • closePolygon

      public void closePolygon()
      Description copied from interface: ILcdGeneralPath
      Closes the current polygon. Subsequent points will define a new polygon or hole.
      Specified by:
      closePolygon in interface ILcdGeneralPath
    • ensureCapacity

      public void ensureCapacity(int aMinimumCapacity)
      Ensures a given point capacity for this TLcdGeneralPath.
      Parameters:
      aMinimumCapacity - the minimum number of points this TLcdGeneralPath should be able to store without reallocating memory.
    • trimToSize

      public void trimToSize()
      Trims this TLcdAWTPath so that it occupies as little memory as possible.
    • subPathCount

      public int subPathCount()
      Specified by:
      subPathCount in interface ILcdGeneralPath
      Returns:
      the number of subpaths.
    • subPathLength

      public int subPathLength(int aSubpathIndex)
      Specified by:
      subPathLength in interface ILcdGeneralPath
      Returns:
      the length of the subpath at the given index.
    • subPathBreaksLine

      public boolean subPathBreaksLine(int aSubpathIndex)
      Specified by:
      subPathBreaksLine in interface ILcdGeneralPath
      Returns:
      whether the subpath at the given index represents a broken line.
    • subPathBreaksPolygon

      public boolean subPathBreaksPolygon(int aSubpathIndex)
      Specified by:
      subPathBreaksPolygon in interface ILcdGeneralPath
      Returns:
      whether the subpath at the given index represents a broken part of a polygon.
    • subPathClosesPolygon

      public boolean subPathClosesPolygon(int aSubpathIndex)
      Specified by:
      subPathClosesPolygon in interface ILcdGeneralPath
      Returns:
      whether the subpath at the given index represents a closing part of a polygon.
    • maxSubpathLength

      public int maxSubpathLength()
    • getX

      public double getX(int aSubpathIndex, int aPointIndex)
      Specified by:
      getX in interface ILcdGeneralPath
      Returns:
      the x coordinate of the subpath point at the given indices.
    • getY

      public double getY(int aSubpathIndex, int aPointIndex)
      Specified by:
      getY in interface ILcdGeneralPath
      Returns:
      the y coordinate of the subpath point at the given indices.
    • calculateWorldBoundsSFCT

      public void calculateWorldBoundsSFCT(ILcd2DEditableBounds aBoundsSFCT) throws TLcdNoBoundsException
      Description copied from interface: ILcdGeneralPath
      Returns a bounding box of this ILcdGeneralPath (in world coordinates) in the side effect parameter aBoundsSFCT.
      Specified by:
      calculateWorldBoundsSFCT in interface ILcdGeneralPath
      Throws:
      TLcdNoBoundsException - if no bounds are available
    • polygonContains

      public boolean polygonContains(double aX, double aY)
      Description copied from interface: ILcdGeneralPath
      Checks whether the given point is contained by the polygon represented by this ILcdGeneralPath.
      Specified by:
      polygonContains in interface ILcdGeneralPath