Class StarGroup

All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable, IObserver, I3DTextRenderable, IFadeObject, ILineRenderable, IModelRenderable, IQuadRenderable, IRenderable, IFocus, IProperMotion, IStarContainer, IStarFocus, IVisibilitySwitch, IPosition

A particle group which additionally to the xyz position, supports color and magnitude. id x y z pmx pmy pmz appmag absmag col size additional
  • Constructor Details

    • StarGroup

      public StarGroup()
  • Method Details

    • initialize

      public void initialize()
      Overrides:
      initialize in class ParticleGroup
    • initialize

      public void initialize(boolean createCatalogInfo)
    • doneLoading

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

      public List<IParticleRecord> data()
      Returns the data list
      Overrides:
      data in class ParticleGroup
      Returns:
      The data list
    • setData

      public void setData(List<IParticleRecord> pointData, boolean regenerateIndex)
      Overrides:
      setData in class ParticleGroup
    • generateIndex

      public Map<String,Integer> generateIndex(com.badlogic.gdx.utils.Array<IParticleRecord> pointData)
      Generates the index (maps star name and id to array index)
      Parameters:
      pointData - The star data
      Returns:
      An map{string,int} mapping names/ids to indexes
    • update

      public void update(ITimeFrameProvider time, Vector3b parentTransform, ICamera camera, float opacity)
      Overrides:
      update in class ParticleGroup
    • updateFocus

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

      public Vector3b getPredictedPosition(Vector3b 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.
    • addToRenderLists

      protected void addToRenderLists(ICamera camera)
      Description copied from class: SceneGraphNode
      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
    • render

      public void render(ExtShaderProgram shader, float alpha, IntMesh mesh, ICamera camera)
      Billboard rendering
      Specified by:
      render in interface IQuadRenderable
      Parameters:
      shader - The shader program
      alpha - Opacity value
      mesh - The mesh
      camera - The camera
    • getFuzzyRenderSize

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

      public void render(IntModelBatch modelBatch, float alpha, double t, RenderingContext rc, SceneGraphRenderer.RenderGroup group)
      Model rendering
      Specified by:
      render in interface IModelRenderable
    • render

      public void render(LineRenderSystem renderer, ICamera camera, float alpha)
      Proper motion rendering
      Specified by:
      render in interface ILineRenderable
    • getLineWidth

      public float getLineWidth()
      Specified by:
      getLineWidth in interface ILineRenderable
    • getGlPrimitive

      public int getGlPrimitive()
      Specified by:
      getGlPrimitive in interface ILineRenderable
    • render

      public void render(ExtSpriteBatch batch, ExtShaderProgram shader, FontRenderSystem sys, RenderingContext rc, ICamera camera)
      Label rendering
      Specified by:
      render in interface I3DTextRenderable
      Overrides:
      render in class ParticleGroup
      Parameters:
      batch - The sprite batch
      shader - The shader
      sys - The font render system
      rc - The render context
      camera - The camera
    • 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
    • getRadius

      public double getRadius()
      Description copied from class: SceneGraphNode
      Returns the radius in internal units
      Specified by:
      getRadius in interface IFocus
      Overrides:
      getRadius in class ParticleGroup
      Returns:
      The radius of the object, in internal units
    • getRadius

      public double getRadius(int i)
      Overrides:
      getRadius in class ParticleGroup
    • 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.
    • getId

      public long getId()
      Description copied from class: ParticleGroup
      Returns the id
      Specified by:
      getId in interface IFocus
      Specified by:
      getId in interface IStarFocus
      Overrides:
      getId in class ParticleGroup
      Returns:
      The id.
    • 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
    • notify

      public void notify(Event event, Object source, Object... data)
      Description copied from interface: IObserver
      Event notification call.
      Specified by:
      notify in interface IObserver
      Overrides:
      notify in class ParticleGroup
      Parameters:
      event - The event type.
      source - The source object, if any.
      data - The data associated with this event.
    • 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
    • getCandidateId

      public long getCandidateId()
      Description copied from interface: IFocus
      Returns the id of the focus candidate of this object. Defaults to IFocus.getId().
      Specified by:
      getCandidateId in interface IFocus
      Overrides:
      getCandidateId in class ParticleGroup
      Returns:
      The id of the candidate.
    • getCandidateName

      public String getCandidateName()
      Description copied from interface: IFocus
      Returns the name of the focus candidate of this object. Defaults to IFocus.getName().
      Specified by:
      getCandidateName in interface IFocus
      Overrides:
      getCandidateName in class ParticleGroup
      Returns:
      The name of the candidate.
    • getCandidateViewAngleApparent

      public double getCandidateViewAngleApparent()
      Description copied from interface: IFocus
      Returns the candidate apparent view angle (view angle corrected with the field of view) of this entity, in radians.
      Specified by:
      getCandidateViewAngleApparent in interface IFocus
      Overrides:
      getCandidateViewAngleApparent in class ParticleGroup
      Returns:
      The apparent view angle in radians.
    • getClosestDistToCamera

      public double getClosestDistToCamera()
      Description copied from interface: IFocus
      Specified by:
      getClosestDistToCamera in interface IFocus
      Specified by:
      getClosestDistToCamera in interface IStarFocus
      Overrides:
      getClosestDistToCamera in class ParticleGroup
      Returns:
      The distance to the camera in internal units.
    • getClosestName

      public String getClosestName()
      Description copied from interface: IFocus
      Specified by:
      getClosestName in interface IFocus
      Specified by:
      getClosestName in interface IStarFocus
      Overrides:
      getClosestName in class ParticleGroup
      Returns:
      The name.
    • 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
    • getClosestAbsolutePos

      public Vector3b getClosestAbsolutePos(Vector3b out)
      Description copied from interface: IFocus
      Specified by:
      getClosestAbsolutePos in interface IFocus
      Specified by:
      getClosestAbsolutePos in interface IStarFocus
      Overrides:
      getClosestAbsolutePos in class ParticleGroup
      Parameters:
      out - Vector3d where to put the return value.
      Returns:
      The absolute position, same as aux.
    • 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
    • hasAtmosphere

      public boolean hasAtmosphere()
      Specified by:
      hasAtmosphere in interface IModelRenderable
    • getFocus

      public IFocus getFocus(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 Vector3b getAbsolutePosition(String name, Vector3b 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.
    • getAbsolutePosition

      public Vector3d getAbsolutePosition(String name, Vector3d aux)
    • fetchPosition

      protected Vector3d fetchPosition(IParticleRecord pb, Vector3d campos, Vector3d out, 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.
      out - The destination factor
      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:
      The current delta years.
    • setEpoch

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

      public Double getEpoch()
      Returns the epoch in Julian Days used for the stars in this group
      Returns:
      The epoch in julian days
    • setVariabilityepoch

      public void setVariabilityepoch(Double epochJd)
      Sets the light curve epoch to use for the stars in this group
      Parameters:
      epochJd - The light curve epoch in julian days (days since January 1, 4713 BCE)
    • getVariabilityepoch

      public Double getVariabilityepoch()
      Returns the light curve epoch in Julian Days used for the stars in this group
      Returns:
      The light curve epoch in julian days
    • 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)
    • getStarGroup

      public static StarGroup getStarGroup(String name, List<IParticleRecord> data, DatasetOptions datasetOptions)
      Creates a default star group with some parameters, given the name and data
      Parameters:
      name - The name of the star group. Any occurrence of '%%SGID%%' will be replaced with the id of the star group
      data - The data of the star group
      datasetOptions - The dataset options
      Returns:
      A new star group with the given parameters
    • getDefaultStarGroup

      public static StarGroup getDefaultStarGroup(String name, List<IParticleRecord> data)
      Creates a default star group with some sane parameters, given the name and the data
      Parameters:
      name - The name of the star group. Any occurrence of '%%SGID%%' in name will be replaced with the id of the star group
      data - The data of the star group
      Returns:
      A new star group with sane parameters
    • getDefaultStarGroup

      public static StarGroup getDefaultStarGroup(String name, List<IParticleRecord> data, boolean fullInit)
      Creates a default star group with some sane parameters, given the name and the data
      Parameters:
      name - The name of the star group. Any occurrence of '%%SGID%%' in name will be replaced with the id of the star group
      data - The data of the star group
      fullInit - Initializes the group right away
      Returns:
      A new star group with sane parameters
    • updateMetadata

      public void updateMetadata(ITimeFrameProvider time, ICamera camera)
      Updates the additional information array, to use for sorting. In stars, we need to take into account the proper motion and the brightness.
      Overrides:
      updateMetadata in class ParticleGroup
      Parameters:
      time - The current time frame provider
      camera - The camera
    • setLabelcolor

      public void setLabelcolor(float[] color, String name)
      Overrides:
      setLabelcolor in class SceneGraphNode
    • setForceLabel

      public void setForceLabel(Boolean forceLabel, String name)
      Overrides:
      setForceLabel in class SceneGraphNode
    • isForceLabel

      public boolean isForceLabel(String name)
      Overrides:
      isForceLabel in class SceneGraphNode
    • textColour

      public float[] textColour(String name)
    • markForUpdate

      public void markForUpdate()
      Overrides:
      markForUpdate in class ParticleGroup