Class TLcdVVTerrainProfileRenderer

java.lang.Object
com.luciad.view.vertical.TLcdDefaultVVRenderer
com.luciad.tea.TLcdVVTerrainProfileRenderer
All Implemented Interfaces:
ILcdVVRenderer

public class TLcdVVTerrainProfileRenderer extends TLcdDefaultVVRenderer
This class is used for rendering the terrain profile with the use of a Vertical View. Most of the functionality is used from the TLcdDefaultVVRenderer
  • Constructor Details

    • TLcdVVTerrainProfileRenderer

      public TLcdVVTerrainProfileRenderer()
  • Method Details

    • setAltitudeFormat

      public void setAltitudeFormat(Format aAltitudeFormat)
      Set the format used to display altitude values.
      Parameters:
      aAltitudeFormat - the format used to display altitude values.
      See Also:
    • getAltitudeFormat

      public Format getAltitudeFormat()
      Gets the format used to display altitude values.
      Returns:
      the format used to display altitude values.
      See Also:
    • fillSubProfileStepPolygon

      public void fillSubProfileStepPolygon(Graphics aGraphics, TLcdVVJPanel aVView, int aState, int aRenderingMode, int aSubProfileStepIndex, int aSegmentIndex, int aSubProfileIndex, int[] aXArray, int[] aYArray)
      This method actually paints the terrain profile.
      Specified by:
      fillSubProfileStepPolygon in interface ILcdVVRenderer
      Overrides:
      fillSubProfileStepPolygon in class TLcdDefaultVVRenderer
      Parameters:
      aGraphics - The graphics to paint on.
      aState - Not used yet
      aRenderingMode - See constants defined in this interface
      aSubProfileStepIndex - The segment-index of the subprofile. Can go from zero until ILcdVVModel.subProfilePointCount(int, int) - 2.
      aSegmentIndex - The segment index within the main-profile.
      aSubProfileIndex - The index of the sub-profile.
      aXArray - An array of int that contains the X-values of the points of the polygon in clockwise direction.
      aYArray - An array of int that contains the Y-values of the points of the polygon in clockwise direction.
    • paintPointLabel

      public void paintPointLabel(Graphics aGraphics, TLcdVVJPanel aVView, int aPointIndex, int xPos, int yPos)
      Paints the labels for the main profile points.
      Specified by:
      paintPointLabel in interface ILcdVVRenderer
      Overrides:
      paintPointLabel in class TLcdDefaultVVRenderer
      Parameters:
      aGraphics - the graphics to paint label of the point on.
      xPos - the X-coordinate of the point.
      yPos - the Y-coordinate of the point.
    • paintVerticalCursor

      public void paintVerticalCursor(Graphics aGraphics, TLcdVVJPanel aVView, int aCurrentXPosition, int aYOffset, int aHeight, int aLeftPointIndex, int aRightPointIndex, int aMouseY, double aRatio)
      Paints the vertical cursor. This is the red line which follows the mouse over the terrain profile when the left mouse buttons is pressed and indicates the terrain level at the cursor position.
      Specified by:
      paintVerticalCursor in interface ILcdVVRenderer
      Overrides:
      paintVerticalCursor in class TLcdDefaultVVRenderer
      Parameters:
      aGraphics - the graphics to paint the vertical cursor on.
      aCurrentXPosition - The position on aGraphics where the cursor should be drawn.
      aYOffset - The position indicating the top Y position for the cursor.
      aHeight - The amount of pixels in the Y dimension.
      aLeftPointIndex - The main profile point on the left of the cursor.
      aRightPointIndex - The main profile point on the right of the cursor.
      aMouseY - The Y value indicating where the mouse was last located (while dragging of the cursor occurred). Can be useful for painting the label on the cursor. Will be -1 if no dragging has appeared yet.
      aRatio - If the total delta between left and right point is 1, then this ratio indicates the cursor's new position relative to the first point.
    • setUnknownColor

      public void setUnknownColor(Color aUnknownColor)
      Sets the color to use to display unknown altitudes. The default value is red.
      Parameters:
      aUnknownColor - the color to use to display unknown altitudes.
      See Also:
    • getUnknownColor

      public Color getUnknownColor()
      Returns the color used to display unknown altitudes. The default value is red.
      Returns:
      the color used to display unknown altitudes.
      See Also:
    • isValidElevation

      protected boolean isValidElevation(double aElevationValue)
      Checks whether the given elevation value is a known value as returned by the terrain elevation provider. This method returns false if the elevation value is Double.NaN, Double.POSITIVE_INFINITY or Double.NEGATIVE_INFINITY.
      Parameters:
      aElevationValue - the elevation value to check.
      Returns:
      true for known values, false for the unknown values.