Class StarsLayer

    • Field Detail

      • DEFAULT_STARS_FILE

        protected static final java.lang.String DEFAULT_STARS_FILE
        The default name of the stars file.s
        See Also:
        Constant Field Values
      • DEFAULT_MIN_ACTIVE_ALTITUDE

        protected static final double DEFAULT_MIN_ACTIVE_ALTITUDE
        See Also:
        Constant Field Values
      • starsFileName

        protected java.lang.String starsFileName
        The stars file name.
      • starsBuffer

        protected java.nio.FloatBuffer starsBuffer
        The float buffer holding the Cartesian star coordinates.
      • numStars

        protected int numStars
      • rebuild

        protected boolean rebuild
      • radius

        protected java.lang.Double radius
        The radius of the spherical shell containing the stars.
      • longitudeOffset

        protected Angle longitudeOffset
        The star sphere longitudinal rotation.
      • latitudeOffset

        protected Angle latitudeOffset
        The star sphere latitudinal rotation.
      • vboCacheKey

        protected java.lang.Object vboCacheKey
    • Constructor Detail

      • StarsLayer

        public StarsLayer()
        Constructs a stars layer using the default stars file, which may be specified in Configuration.
      • StarsLayer

        public StarsLayer​(java.lang.String starsFileName)
        Constructs a stars layer using a specified stars file.
        Parameters:
        starsFileName - the full path the star file.
      • StarsLayer

        public StarsLayer​(java.lang.String starsFileName,
                          java.lang.Double radius)
        Constructs a stars layer using a specified stars file and star-field radius.
        Parameters:
        starsFileName - the full path the star file.
        radius - the radius of the stars sphere. May be null, in which case the radius in the stars file is used.
    • Method Detail

      • initialize

        protected void initialize​(java.lang.String starsFileName,
                                  java.lang.Double radius)
        Called by constructors to save the stars file name, the stars field radius and the layer's minimum active altitude.
        Parameters:
        starsFileName - the full path the star file.
        radius - the radius of the stars sphere. May be null, in which case the radius in the stars file is used.
      • getStarsFileName

        public java.lang.String getStarsFileName()
        Indicates the path and filename of the stars file.
        Returns:
        name of stars catalog file.
      • setStarsFileName

        public void setStarsFileName​(java.lang.String fileName)
        Specifies the path and filename of the stars file.
        Parameters:
        fileName - the path and filename.
        Throws:
        java.lang.IllegalArgumentException - if the file name is null or empty.
      • getLatitudeOffset

        public Angle getLatitudeOffset()
        Returns the latitude offset (tilt) for the star sphere.
        Returns:
        the latitude offset.
      • setLatitudeOffset

        public void setLatitudeOffset​(Angle offset)
        Sets the latitude offset (tilt) of the star sphere.
        Parameters:
        offset - the latitude offset.
      • getLongitudeOffset

        public Angle getLongitudeOffset()
        Returns the longitude offset of the star sphere.
        Returns:
        the longitude offset.
      • setLongitudeOffset

        public void setLongitudeOffset​(Angle offset)
        Sets the longitude offset of the star sphere.
        Parameters:
        offset - the longitude offset.
        Throws:
        java.lang.IllegalArgumentException - if the angle is null.s
      • drawWithVertexArray

        protected void drawWithVertexArray​(DrawContext dc)
      • drawWithVBO

        protected boolean drawWithVBO​(DrawContext dc)
      • fillVbo

        protected void fillVbo​(DrawContext dc)
        Creates and fills this layer's vertex buffer.
        Parameters:
        dc - the current draw context.
      • loadStars

        protected void loadStars()
        Read stars file and load it into a float buffer.