Class SurfaceQuad

    • Field Detail

      • center

        protected LatLon center
      • width

        protected double width
      • height

        protected double height
      • heading

        protected Angle heading
    • Constructor Detail

      • SurfaceQuad

        public SurfaceQuad()
        Constructs a new surface quad with the default attributes, default center location, default dimensions, and default heading.
      • SurfaceQuad

        public SurfaceQuad​(ShapeAttributes normalAttrs)
        Constructs a new surface quad with the specified normal (as opposed to highlight) attributes, default center location, default dimensions, and default heading. Modifying the attribute reference after calling this constructor causes this shape's appearance to change accordingly.
        Parameters:
        normalAttrs - the normal attributes. May be null, in which case default attributes are used.
      • SurfaceQuad

        public SurfaceQuad​(LatLon center,
                           double width,
                           double height)
        Constructs a new surface quad with the default attributes, the specified center location and dimensions (in meters).
        Parameters:
        center - the quad's center location.
        width - the quad's width, in meters.
        height - the quad's height, in meters.
        Throws:
        java.lang.IllegalArgumentException - if the center is null, or if the width or height are negative.
      • SurfaceQuad

        public SurfaceQuad​(LatLon center,
                           double width,
                           double height,
                           Angle heading)
        Constructs a new surface quad with the default attributes, the specified center location, dimensions (in meters), and heading clockwise from North.
        Parameters:
        center - the quad's center location.
        width - the quad's width, in meters.
        height - the quad's height, in meters.
        heading - the quad's heading, clockwise from North.
        Throws:
        java.lang.IllegalArgumentException - if the center or heading are null, or if the width or height are negative.
      • SurfaceQuad

        public SurfaceQuad​(ShapeAttributes normalAttrs,
                           LatLon center,
                           double width,
                           double height)
        Constructs a new surface quad with the specified normal (as opposed to highlight) attributes, the specified center location and dimensions (in meters). Modifying the attribute reference after calling this constructor causes this shape's appearance to change accordingly.
        Parameters:
        normalAttrs - the normal attributes. May be null, in which case default attributes are used.
        center - the quad's center location.
        width - the quad's width, in meters.
        height - the quad's height, in meters.
        Throws:
        java.lang.IllegalArgumentException - if the center is null, or if the width or height are negative.
      • SurfaceQuad

        public SurfaceQuad​(SurfaceQuad source)
        Creates a shallow copy of the specified source shape.
        Parameters:
        source - the shape to copy.
      • SurfaceQuad

        public SurfaceQuad​(ShapeAttributes normalAttrs,
                           LatLon center,
                           double width,
                           double height,
                           Angle heading)
        Constructs a new surface quad with the specified normal (as opposed to highlight) attributes, the specified center location and dimensions (in meters). Modifying the attribute reference after calling this constructor causes this shape's appearance to change accordingly.
        Parameters:
        normalAttrs - the normal attributes. May be null, in which case default attributes are used.
        center - the quad's center location.
        width - the quad's width, in meters.
        height - the quad's height, in meters.
        heading - the quad's heading, clockwise from North.
        Throws:
        java.lang.IllegalArgumentException - if the center or heading are null, or if the width or height are negative.
    • Method Detail

      • getCenter

        public LatLon getCenter()
      • setCenter

        public void setCenter​(LatLon center)
      • getWidth

        public double getWidth()
      • getHeight

        public double getHeight()
      • setWidth

        public void setWidth​(double width)
      • setHeight

        public void setHeight​(double height)
      • setSize

        public void setSize​(double width,
                            double height)
      • getHeading

        public Angle getHeading()
      • setHeading

        public void setHeading​(Angle heading)
      • getStateKey

        public java.lang.Object getStateKey​(DrawContext dc)
        Returns an object that uniquely identifies this renderable's state for the specified draw context.

        Callers can perform an equality test on two state keys using Object.equals(Object) in order to determine whether or not a renderable has changed. The returned object is guaranteed to be globally unique with respect to other SurfaceRenderable state keys; an equality test with a state key from another renderable always returns false.

        The returned state key is constructed the SurfaceShape's unique ID, last modified time, and its active attributes. The returned state key has no dependency on the Globe. Subclasses that depend on the Globe should return a state key that include the globe's state key.

        Overridden to include the globe's state key in the returned state key.

        Specified by:
        getStateKey in interface SurfaceRenderable
        Overrides:
        getStateKey in class AbstractSurfaceShape
        Parameters:
        dc - the draw context for which to determine this renderable's current state.
        Returns:
        an object representing this renderable's current state.
        See Also:
        Globe.getStateKey(DrawContext)
      • getReferencePosition

        public Position getReferencePosition()
        Description copied from interface: Movable
        A position associated with the object that indicates its aggregate geographic position. The chosen position varies among implementers of this interface. For objects defined by a list of positions, the reference position is typically the first position in the list. For symmetric objects the reference position is often the center of the object. In many cases the object's reference position may be explicitly specified by the application.
        Specified by:
        getReferencePosition in interface Movable
        Specified by:
        getReferencePosition in interface Movable2
        Specified by:
        getReferencePosition in class AbstractSurfaceShape
        Returns:
        the object's reference position, or null if no reference position is available.
      • getLocations

        public java.lang.Iterable<? extends LatLon> getLocations​(Globe globe)
        Description copied from interface: SurfaceShape
        Returns the shape's locations as they appear on the specified globe, or null if the shape has no locations.
        Specified by:
        getLocations in interface SurfaceShape
        Parameters:
        globe - the globe the shape is related to.
        Returns:
        the shapes locations on the globe, or null if the shape has no locations.
      • exportAsKML

        protected void exportAsKML​(java.lang.Object output)
                            throws java.io.IOException,
                                   javax.xml.stream.XMLStreamException
        Export the polygon to KML as a <Placemark> element. The output object will receive the data. This object must be one of: java.io.Writer java.io.OutputStream javax.xml.stream.XMLStreamWriter
        Overrides:
        exportAsKML in class AbstractSurfaceShape
        Parameters:
        output - Object to receive the generated KML.
        Throws:
        javax.xml.stream.XMLStreamException - If an exception occurs while writing the KML
        java.io.IOException - if an exception occurs while exporting the data.
        See Also:
        AbstractSurfaceShape.export(String, Object)