Class StarGroup

    • Constructor Detail

      • StarGroup

        public StarGroup()
    • Method Detail

      • doneLoading

        public void doneLoading​(com.badlogic.gdx.assets.AssetManager manager)
        Overrides:
        doneLoading in class ParticleGroup
      • setData

        public void setData​(com.badlogic.gdx.utils.Array<StarGroup.StarBean> pointData)
      • setData

        public void setData​(com.badlogic.gdx.utils.Array<StarGroup.StarBean> pointData,
                            boolean regenerateIndex)
      • regenerateIndex

        public void regenerateIndex()
      • generateIndex

        public com.badlogic.gdx.utils.ObjectIntMap<java.lang.String> generateIndex​(com.badlogic.gdx.utils.Array<StarGroup.StarBean> pointData)
        Generates the index (maps star name and id to array index) and computes the geometric center of this star vgroup
        Parameters:
        pointData - The star data
        Returns:
        An map{string,int} mapping names/ids to indexes
      • computeFixedMeanPosition

        public void computeFixedMeanPosition()
      • updateFocus

        public void updateFocus​(ITimeFrameProvider time,
                                ICamera camera)
        Updates the parameters of the focus, if the focus is active in this vgroup
        Overrides:
        updateFocus in class ParticleGroup
        Parameters:
        time - The time frame provider
        camera - The current camera
      • getPredictedPosition

        public Vector3d getPredictedPosition​(Vector3d aux,
                                             ITimeFrameProvider time,
                                             ICamera camera,
                                             boolean force)
        Overrides ParticleGroup's implementation by actually integrating the position using the proper motion and the given time.
        Specified by:
        getPredictedPosition in interface IFocus
        Overrides:
        getPredictedPosition in class ParticleGroup
        Parameters:
        aux - The out vector where the result will be stored.
        time - The time frame provider.
        camera - The camera.
        force - Whether to force the computation if time is off.
        Returns:
        The aux vector for chaining.
      • updateAdditional

        public void updateAdditional​(ITimeFrameProvider time,
                                     ICamera camera)
        Updates the additional information array, to use for sorting.
        Parameters:
        camera -
      • updateSorter

        public void updateSorter​(ITimeFrameProvider time,
                                 ICamera camera)
        Sorts the list of particles using the apparent magnitude (view angle) criterion. This should be called only when the camera frustum is significantly changed. By no means should this be called every cycle. Sorting happens always in the working buffer, which is not the active buffer. After sorting, buffers are swapped.
        Overrides:
        updateSorter in class ParticleGroup
      • addToRenderLists

        protected void addToRenderLists​(ICamera camera)
        Description copied from class: AbstractPositionEntity
        Adds this entity to the necessary render lists after the distance to the camera and the view angle have been determined.
        Overrides:
        addToRenderLists in class ParticleGroup
      • getFuzzyRenderSize

        public double getFuzzyRenderSize​(double size,
                                         double radius,
                                         double distToCamera,
                                         double viewAngle,
                                         double thDown,
                                         double thUp)
      • textPosition

        public void textPosition​(ICamera cam,
                                 Vector3d out,
                                 float len,
                                 float rad)
      • getFocusSize

        public double getFocusSize()
        Description copied from class: ParticleGroup
        Default size if not in data, 1e5 km
        Overrides:
        getFocusSize in class ParticleGroup
        Returns:
        The size
      • getAppmag

        public float getAppmag()
        Description copied from interface: IFocus
        Gets the apparent magnitude
        Specified by:
        getAppmag in interface IFocus
        Overrides:
        getAppmag in class ParticleGroup
        Returns:
        The apparent magnitude
      • getAbsmag

        public float getAbsmag()
        Description copied from interface: IFocus
        Gets the absolute magnitude
        Specified by:
        getAbsmag in interface IFocus
        Overrides:
        getAbsmag in class ParticleGroup
        Returns:
        The absolute magnitude
      • getMuAlpha

        public double getMuAlpha()
        Description copied from interface: IProperMotion
        Returns the mu alpha in mas/yr
        Specified by:
        getMuAlpha in interface IProperMotion
        Returns:
        The mu alpha in mas/yr
      • getMuDelta

        public double getMuDelta()
        Description copied from interface: IProperMotion
        Returns the mu delta in mas/yr
        Specified by:
        getMuDelta in interface IProperMotion
        Returns:
        The mu delta in mas/yr
      • getRadialVelocity

        public double getRadialVelocity()
        Description copied from interface: IProperMotion
        Returns the radial velocity in km/s
        Specified by:
        getRadialVelocity in interface IProperMotion
        Returns:
        The radial velocity in km/s
      • getSize

        public double getSize​(int i)
        Returns the size of the particle at index i
        Overrides:
        getSize in class ParticleGroup
        Parameters:
        i - The index
        Returns:
        The size
      • getCatalogSource

        public int getCatalogSource()
        Description copied from interface: IStarFocus
        Gets the catalog source of this star. Possible values are:
        • -1: Unknown
        • 1: Gaia
        • 2: Hipparcos (HYG)
        • 3: Tycho
        • 4: Other
        Specified by:
        getCatalogSource in interface IStarFocus
        Returns:
        The catalog source number
      • getHip

        public int getHip()
        Description copied from interface: IStarFocus
        Returns the HIP number of this star, or negative if it has no HIP number
        Specified by:
        getHip in interface IStarFocus
        Returns:
        The HIP number
      • getClosestDist

        public double getClosestDist()
        Description copied from interface: IStarFocus
        Returns the closest star distance to the camera
        Specified by:
        getClosestDist in interface IStarFocus
        Returns:
        Distance of closest star to camera
      • getClosestName

        public java.lang.String getClosestName()
        Description copied from interface: IStarFocus
        Name of closest star to camera
        Specified by:
        getClosestName in interface IStarFocus
        Returns:
        The name of the closest star to the camera
      • getClosestSize

        public double getClosestSize()
        Description copied from interface: IStarFocus
        Returns the size of the closest star
        Specified by:
        getClosestSize in interface IStarFocus
        Returns:
        The size of the closest star
      • getClosestPos

        public Vector3d getClosestPos​(Vector3d out)
        Description copied from interface: IStarFocus
        Returns the position of the closest star in camera coordinates
        Specified by:
        getClosestPos in interface IStarFocus
        Parameters:
        out - The out vector
        Returns:
        The out vector with the position
      • getClosestCol

        public float[] getClosestCol()
        Description copied from interface: IStarFocus
        Returns the color of the closest star
        Specified by:
        getClosestCol in interface IStarFocus
        Returns:
        The color in rgb
      • getFocus

        public IFocus getFocus​(java.lang.String name)
        Description copied from interface: IFocus
        Prepares the candidate with the given name
        Specified by:
        getFocus in interface IFocus
        Overrides:
        getFocus in class ParticleGroup
        Parameters:
        name - The name in lower case
      • getAbsolutePosition

        public Vector3d getAbsolutePosition​(java.lang.String name,
                                            Vector3d aux)
        Description copied from interface: IFocus
        Returns the absolute position of the entity identified by name within this entity in the native reference system
        Specified by:
        getAbsolutePosition in interface IFocus
        Overrides:
        getAbsolutePosition in class ParticleGroup
        Parameters:
        name - The name (lowercase) of the entity to get the position from (useful in case of star groups)
        aux - Vector3d to put the return value
        Returns:
        The absolute position of the entity if it exists, null otherwise
      • fetchPosition

        protected Vector3d fetchPosition​(ParticleGroup.ParticleBean pb,
                                         Vector3d campos,
                                         Vector3d dest,
                                         double deltaYears)
        Description copied from class: ParticleGroup
        Fetches the real position of the particle. It will apply the necessary integrations (i.e. proper motion).
        Overrides:
        fetchPosition in class ParticleGroup
        Parameters:
        pb - The particle bean
        campos - The position of the camera. If null, the camera position is not subtracted so that the coordinates are given in the global reference system instead of the camera reference system.
        dest - The destination fector
        deltaYears - The delta years
        Returns:
        The vector for chaining
      • getDeltaYears

        protected double getDeltaYears()
        Description copied from class: ParticleGroup
        Returns the delta years to integrate the proper motion.
        Overrides:
        getDeltaYears in class ParticleGroup
        Returns:
      • setEpoch

        public void setEpoch​(java.lang.Double epochJd)
        Sets the epoch to use for the stars in this vgroup
        Parameters:
        epochJd - The epoch in julian days (days since January 1, 4713 BCE)
      • getEpoch

        public java.lang.Double getEpoch()
        Returns the epoch in Julian Days used for the stars in this vgroup
        Returns:
        The epoch in julian days
      • addToIndex

        protected void addToIndex​(com.badlogic.gdx.utils.ObjectMap<java.lang.String,​SceneGraphNode> map)
        Description copied from class: SceneGraphNode
        Special actions to be taken for this object when adding to the index.
        Overrides:
        addToIndex in class SceneGraphNode
        Parameters:
        map - The index
      • removeFromIndex

        protected void removeFromIndex​(com.badlogic.gdx.utils.ObjectMap<java.lang.String,​SceneGraphNode> map)
        Description copied from class: SceneGraphNode
        Special actions to be taken for this object when removing from the index. Must implement if addToIndex is implemented
        Overrides:
        removeFromIndex in class SceneGraphNode
        Parameters:
        map - The index
      • dispose

        public void dispose()
        Specified by:
        dispose in interface com.badlogic.gdx.utils.Disposable
        Overrides:
        dispose in class ParticleGroup
      • getColor

        public float getColor​(int index)
      • getDefaultStarGroup

        public static StarGroup getDefaultStarGroup​(java.lang.String name,
                                                    com.badlogic.gdx.utils.Array<StarGroup.StarBean> data)
        Creates a default star vgroup with some sane parameters, given the name and the data
        Parameters:
        name - The name of the star vgroup. Any occurrence of '%%SGID%%' in name will be replaced with the id of the star vgroup
        data - The data of the star vgroup
        Returns:
        A new star vgroup with sane parameters
      • getDefaultStarGroup

        public static StarGroup getDefaultStarGroup​(java.lang.String name,
                                                    com.badlogic.gdx.utils.Array<StarGroup.StarBean> data,
                                                    boolean fullInit)
        Creates a default star vgroup with some sane parameters, given the name and the data
        Parameters:
        name - The name of the star vgroup. Any occurrence of '%%SGID%%' in name will be replaced with the id of the star vgroup
        data - The data of the star vgroup
        fullInit - Initializes the vgroup right away
        Returns:
        A new star vgroup with sane parameters