Class Wedge

    • Field Detail

      • wedgeAngle

        protected Angle wedgeAngle
      • faceCount

        protected int faceCount
      • subdivisions

        protected int subdivisions
    • Constructor Detail

      • Wedge

        public Wedge()
        Construct a wedge with default parameters
      • Wedge

        public Wedge​(Position centerPosition,
                     Angle angle,
                     double height,
                     double radius)
        Constructs a Wedge from a specified center position, height, radius and angle.
        Parameters:
        centerPosition - the Wedge's center position.
        height - the Wedge's height, in meters.
        radius - the radius of the Wedge's base, in meters.
        angle - the angle covered by the wedge
        Throws:
        java.lang.IllegalArgumentException - if the center position is null, if the wedgeAngle is null or not in [0, 2*PI], or if any of the radii are not greater than 0.
      • Wedge

        public Wedge​(Position centerPosition,
                     Angle angle,
                     double northSouthRadius,
                     double verticalRadius,
                     double eastWestRadius)
        Constructs a wedge from a specified center position and axes lengths.
        Parameters:
        centerPosition - the wedge's center position.
        angle - the angle covered by the wedge
        northSouthRadius - the wedge's north-south radius, in meters.
        verticalRadius - the wedge's vertical radius, in meters.
        eastWestRadius - the wedge's east-west radius, in meters.
        Throws:
        java.lang.IllegalArgumentException - if the center position is null, if the wedgeAngle is null or not in [0, 2*PI], or if any of the radii are not greater than 0.
      • Wedge

        public Wedge​(Position centerPosition,
                     Angle angle,
                     double northSouthRadius,
                     double verticalRadius,
                     double eastWestRadius,
                     Angle heading,
                     Angle tilt,
                     Angle roll)
        Constructs a wedge from a specified center position, axes lengths and rotation angles. All angles are specified in degrees and positive angles are counter-clockwise.
        Parameters:
        centerPosition - the wedge's center position.
        angle - the angle covered by the wedge
        northSouthRadius - the wedge's north-south radius, in meters.
        verticalRadius - the wedge's vertical radius, in meters.
        eastWestRadius - the wedge's east-west radius, in meters.
        heading - the wedge's azimuth, its rotation about its vertical axis.
        tilt - the wedge pitch, its rotation about its east-west axis.
        roll - the wedge's roll, its rotation about its north-south axis.
        Throws:
        java.lang.IllegalArgumentException - the centerPosition is null, or if the wedgeAngle is null or not in [0, 2*PI], or if any of the radii are not greater than 0.
    • Method Detail

      • initialize

        protected void initialize()
        Description copied from class: AbstractShape
        Called during construction to establish any subclass-specific state such as different default values than those set by this class.
        Overrides:
        initialize in class RigidShape
      • getWedgeAngle

        public Angle getWedgeAngle()
        Returns the angle covered by this wedge.
        Returns:
        the angle covered by the wedge.
      • setWedgeAngle

        public void setWedgeAngle​(Angle angle)
        Specifies the angle covered by the wedge. This angle must fall in [0, 2*PI].
        Parameters:
        angle - the angle covered by the wedge. Must be in [0, 2*PI].
        Throws:
        java.lang.IllegalArgumentException - if the wedgeAngle is null, or is not in [0, 2*PI].
      • getFaceCount

        public int getFaceCount()
        Description copied from class: RigidShape
        Returns the number of separate faces that comprise this shape.
        Overrides:
        getFaceCount in class RigidShape
        Returns:
        number of faces
      • computeDetailThreshold

        protected double computeDetailThreshold()
        Computes a threshold value, based on the current detailHint, for use in the sufficientDetail() calculation.
        Returns:
        the detailThreshold
      • computeSubdivisions

        protected void computeSubdivisions​(DrawContext dc,
                                           RigidShape.ShapeData shapeData)
        Computes the number of subdivisions necessary to achieve the expected Level of Detail given the shape's relationship to the viewer.
        Specified by:
        computeSubdivisions in class RigidShape
        Parameters:
        dc - the current drawContext.
        shapeData - the current globe-specific shape data
      • mustRegenerateGeometry

        protected boolean mustRegenerateGeometry​(DrawContext dc)
        Description copied from class: AbstractShape
        Indicates whether this shape's renderable geometry must be recomputed, either as a result of an attribute or property change or the expiration of the geometry regeneration interval.

        A AbstractShape.AbstractShapeData must be current when this method is called.

        Overrides:
        mustRegenerateGeometry in class RigidShape
        Parameters:
        dc - the current draw context.
        Returns:
        true if this shape's geometry must be regenerated, otherwise false.
      • makeGeometry

        protected void makeGeometry​(RigidShape.ShapeData shapeData)
        Sets the Geometry mesh for this wedge, either by pulling it from the geometryCache, or by creating it anew if the appropriate geometry does not yet exist in the cache.
        Specified by:
        makeGeometry in class RigidShape
        Parameters:
        shapeData - this shape's current shape data.
        Throws:
        java.lang.IllegalArgumentException - if the wedgeAngle is null
      • makeUnitWedge

        protected void makeUnitWedge​(int subdivisions,
                                     java.util.List<Geometry> meshes)
        Generates a unit wedge geometry, including the vertices, indices, normals and texture coordinates, tessellated with the specified number of divisions.
        Parameters:
        subdivisions - the number of times to subdivide the unit wedge geometry
        meshes - the Geometry list to hold the computed points, etc. for all wedge Geometries
        Throws:
        java.lang.IllegalArgumentException - if the wedgeAngle is null
      • drawGeometry

        protected void drawGeometry​(DrawContext dc,
                                    int mode,
                                    int count,
                                    int type,
                                    java.nio.Buffer elementBuffer,
                                    RigidShape.ShapeData shapeData,
                                    int face)
        Renders the wedge, using data from the provided buffer and the given parameters.
        Specified by:
        drawGeometry in class RigidShape
        Parameters:
        dc - the current draw context
        mode - the render mode
        count - the number of elements to be drawn
        type - the data type of the elements to be drawn
        elementBuffer - the buffer containing the list of elements to be drawn
        shapeData - this shape's current globe-specific shape data
        face - the index of the shape face to render
      • doExportAsKML

        protected void doExportAsKML​(javax.xml.stream.XMLStreamWriter xmlWriter)
                              throws java.io.IOException,
                                     javax.xml.stream.XMLStreamException
        Description copied from class: AbstractShape
        Exports shape-specific fields.
        Specified by:
        doExportAsKML in class AbstractShape
        Parameters:
        xmlWriter - the export writer to write to.
        Throws:
        java.io.IOException - if an IO error occurs while writing to the output destination.
        javax.xml.stream.XMLStreamException - if an exception occurs converting this shape's fields to XML.