Package gaiasky.scenegraph
Class StarGroup
java.lang.Object
gaiasky.scenegraph.SceneGraphNode
gaiasky.scenegraph.FadeNode
gaiasky.scenegraph.ParticleGroup
gaiasky.scenegraph.StarGroup
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
,IObserver
,I3DTextRenderable
,IFadeObject
,ILineRenderable
,IModelRenderable
,IQuadRenderable
,IRenderable
,IFocus
,IProperMotion
,IStarContainer
,IStarFocus
,IVisibilitySwitch
,IPosition
public class StarGroup
extends ParticleGroup
implements ILineRenderable, IStarFocus, IQuadRenderable, IModelRenderable, IObserver
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
-
Nested Class Summary
Nested classes/interfaces inherited from class gaiasky.scenegraph.ParticleGroup
ParticleGroup.UpdaterTask
-
Field Summary
Fields inherited from class gaiasky.scenegraph.ParticleGroup
active, background, CAM_DX_TH, ccMax, ccMin, colorNoise, cPosD, datafile, disposed, factor, fixedMeanPosition, focus, index, indices1, indices2, lastSortCameraPos, lastSortTime, maxDistance, meanDistance, metadata, minDistance, particleSizeLimits, particleSizeLimitsPoint, pointData, profileDecay, provider, providerParams, proximity, UPDATE_INTERVAL_MS, UPDATE_INTERVAL_MS_2, updaterTask, updating, visibilityArray
Fields inherited from class gaiasky.scenegraph.FadeNode
catalogInfo, currentDistance, highlighted, hlallvisible, hlc, hlcma, hlcmi, hlcmmax, hlcmmin, hlplain, initialUpdate, inSceneGraph, labelPosition, pointscaling, position
Fields inherited from class gaiasky.scenegraph.SceneGraphNode
B31, B32, B33, B34, cc, children, computed, coordinates, copy, ct, D31, D32, D33, D34, distToCamera, F31, F32, F33, F34, forceLabel, id, labelcolor, lastStateChangeTimeMs, localizedNameIndex, localTransform, names, numChildren, octant, octantId, opacity, orientation, parent, parentName, pos, posSph, ROOT_NAME, size, translation, viewAngle, viewAngleApparent, visible
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addToRenderLists
(ICamera camera) Adds this entity to the necessary render lists after the distance to the camera and the view angle have been determined.data()
Returns the data listvoid
dispose()
void
doneLoading
(com.badlogic.gdx.assets.AssetManager manager) protected Vector3d
fetchPosition
(IParticleRecord pb, Vector3d campos, Vector3d out, double deltaYears) Fetches the real position of the particle.generateIndex
(com.badlogic.gdx.utils.Array<IParticleRecord> pointData) Generates the index (maps star name and id to array index)float
Gets the absolute magnitude.getAbsolutePosition
(String name, Vector3b aux) Returns the absolute position of the entity identified by name within this entity in the native reference system.getAbsolutePosition
(String name, Vector3d aux) float
Gets the apparent magnitude.long
Returns the id of the focus candidate of this object.Returns the name of the focus candidate of this object.double
Returns the candidate apparent view angle (view angle corrected with the field of view) of this entity, in radians.int
Gets the catalog source of this star.Same asIFocus.getAbsolutePosition(Vector3b)
.float[]
Returns the color of the closest stardouble
Same asIFocus.getDistToCamera()
.Same asIFocus.getName()
.getClosestPos
(Vector3d out) Returns the position of the closest star in camera coordinatesdouble
Returns the size of the closest starfloat
getColor
(int index) static StarGroup
getDefaultStarGroup
(String name, List<IParticleRecord> data) Creates a default star group with some sane parameters, given the name and the datastatic StarGroup
getDefaultStarGroup
(String name, List<IParticleRecord> data, boolean fullInit) Creates a default star group with some sane parameters, given the name and the dataprotected double
Returns the delta years to integrate the proper motion.getEpoch()
Returns the epoch in Julian Days used for the stars in this groupPrepares the candidate with the given name.double
Default size if not in data, 1e5 kmdouble
getFuzzyRenderSize
(double size, double radius, double distToCamera, double viewAngle, double thDown, double thUp) int
int
getHip()
Returns the HIP number of this star, or negative if it has no HIP numberlong
getId()
Returns the idfloat
double
Returns the mu alpha in mas/yrdouble
Returns the mu delta in mas/yrgetPredictedPosition
(Vector3b aux, ITimeFrameProvider time, ICamera camera, boolean force) OverridesParticleGroup
's implementation by actually integrating the position using the proper motion and the given time.double
Returns the radial velocity in km/sdouble
Returns the radius in internal unitsdouble
getRadius
(int i) double
getSize
(int i) Returns the size of the particle at index istatic StarGroup
getStarGroup
(String name, List<IParticleRecord> data, DatasetOptions datasetOptions) Creates a default star group with some parameters, given the name and dataReturns the light curve epoch in Julian Days used for the stars in this groupboolean
void
void
initialize
(boolean createCatalogInfo) boolean
isForceLabel
(String name) void
void
Event notification call.void
render
(LineRenderSystem renderer, ICamera camera, float alpha) Proper motion renderingvoid
render
(ExtSpriteBatch batch, ExtShaderProgram shader, FontRenderSystem sys, RenderingContext rc, ICamera camera) Label renderingvoid
render
(IntModelBatch modelBatch, float alpha, double t, RenderingContext rc, SceneGraphRenderer.RenderGroup group) Model renderingvoid
render
(ExtShaderProgram shader, float alpha, IntMesh mesh, ICamera camera) Billboard renderingvoid
setData
(List<IParticleRecord> pointData, boolean regenerateIndex) void
Sets the epoch to use for the stars in this groupvoid
setForceLabel
(Boolean forceLabel, String name) void
setLabelcolor
(float[] color, String name) void
setVariabilityepoch
(Double epochJd) Sets the light curve epoch to use for the stars in this groupfloat[]
textColour
(String name) void
update
(ITimeFrameProvider time, Vector3b parentTransform, ICamera camera, float opacity) void
updateFocus
(ICamera camera) Updates the parameters of the focus, if the focus is active in this groupvoid
updateMetadata
(ITimeFrameProvider time, ICamera camera) Updates the additional information array, to use for sorting.Methods inherited from class gaiasky.scenegraph.ParticleGroup
addFocusableObjects, addHit, addHit, addToIndex, canSelect, computeGeomCentre, computeGeomCentre, computeMeanPosition, computeMinMeanMaxDistances, filter, generateIndex, get, getAbsolutePosition, getAlpha, getBaseOpacity, getCandidateBean, getCandidateIndex, getColor, getColorMax, getColorMin, getComputedAncestor, getDelta, getDistToCamera, getFirstStarAncestor, getLocalizedName, getMaxDistance, getMeanDistance, getMinDistance, getName, getNames, getOrientationQuaternion, getParticleGroup, getPosSph, getProvider, getRandomParticleName, getRotationComponent, getSize, getStarCount, getTextOpacity, getViewAngle, getViewAngleApparent, hasName, hasName, highlight, highlight, highlightedSizeFactor, initialize, initSortingData, isActive, isCoordinatesTimeOverflow, isLabel, isVisible, isVisible, isVisible, isVisible, isVisibleGroup, isVisibleGroup, makeFocus, mustAddToIndex, regenerateIndex, removeFromIndex, renderText, setColorMax, setColorMax, setColorMin, setColorMin, setColornoise, setData, setDatafile, setFactor, setFocusIndex, setLabelPosition, setParticlesizelimits, setPosition, setProfiledecay, setProvider, setProviderparams, setVisible, setVisible, setVisible, setVisibleGroup, shouldRender, size, swapBuffers, text, textColour, textDepthBuffer, textPosition, textPosition, textScale, textSize, update, updateLocalValues, updateSorter
Methods inherited from class gaiasky.scenegraph.FadeNode
getCatalogInfo, getFadeIn, getFadeOut, getHlcma, getHlcmi, getHlcmmax, getHlcmmin, getPointscaling, initializeCatalogInfo, isHighlighted, isHlAllVisible, isHlplain, setCataloginfo, setCatalogInfo, setCatalogInfoBare, setFadein, setFadeIn, setFadeout, setFadeOut, setLabelposition, setPointscaling, setPosition, setPositionobjectname, setSize, setSize, setUp, updateLocal, updateOpacity
Methods inherited from class gaiasky.scenegraph.SceneGraphNode
add, add, addChild, addChild, addName, addNodes, addToRender, computeFuturePosition, getAbsoluteOrientation, getAggregatedChildren, getChildByName, getChildByNameAndType, getChildrenByComponentType, getChildrenByType, getComponentType, getCoordinates, getCt, getDescription, getHeight, getHeight, getHeight, getHeightScale, getLabelcolor, getLineCopy, getNext, getNode, getNode, getOctant, getOpacity, getOrientation, getPos, getPosition, getPosition, getRoot, getSceneGraphDepth, getSimpleCopy, getUnrotatedPos, getVelocity, getVisibilityOpacityFactor, hasCt, insert, isCopy, isForceLabel, isInRender, isInRender, isValidPosition, isVisibilityOn, msSinceStateChange, mustUpdatePosition, namesConcat, removeChild, removeFromRender, render2DLabel, render2DLabel, render2DLabel, render2DLabel, render3DLabel, render3DLabel, returnToPool, setColor, setColor, setComputedFlag, setCoordinates, setCt, setCt, setDescription, setForcelabel, setForceLabel, setId, setLabelcolor, setLabelcolor, setName, setName, setNames, setParent, setPos, toString, updateLocalizedName, updateLocalizedNameRecursive
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface gaiasky.scenegraph.IFocus
addHit, addHit, getAbsolutePosition, getAlpha, getColor, getCt, getDelta, getDistToCamera, getFirstStarAncestor, getHeight, getHeight, getHeight, getHeightScale, getLocalizedName, getName, getNames, getNext, getOctant, getOrientation, getOrientationQuaternion, getPos, getPosSph, getRotationComponent, getSceneGraphDepth, getSize, getViewAngle, getViewAngleApparent, hasName, hasName, isActive, isCoordinatesTimeOverflow, isCopy, makeFocus
Methods inherited from interface gaiasky.render.IRenderable
getComponentType, getDistToCamera, getOpacity
-
Constructor Details
-
StarGroup
public StarGroup()
-
-
Method Details
-
initialize
public void initialize()- Overrides:
initialize
in classParticleGroup
-
initialize
public void initialize(boolean createCatalogInfo) -
doneLoading
public void doneLoading(com.badlogic.gdx.assets.AssetManager manager) - Overrides:
doneLoading
in classParticleGroup
-
data
Returns the data list- Overrides:
data
in classParticleGroup
- Returns:
- The data list
-
setData
- Overrides:
setData
in classParticleGroup
-
generateIndex
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 classParticleGroup
-
updateFocus
Updates the parameters of the focus, if the focus is active in this group- Overrides:
updateFocus
in classParticleGroup
- Parameters:
camera
- The current camera
-
getPredictedPosition
public Vector3b getPredictedPosition(Vector3b aux, ITimeFrameProvider time, ICamera camera, boolean force) OverridesParticleGroup
's implementation by actually integrating the position using the proper motion and the given time.- Specified by:
getPredictedPosition
in interfaceIFocus
- Overrides:
getPredictedPosition
in classParticleGroup
- 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
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 classParticleGroup
-
render
Billboard rendering- Specified by:
render
in interfaceIQuadRenderable
- Parameters:
shader
- The shader programalpha
- Opacity valuemesh
- The meshcamera
- 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 interfaceIModelRenderable
-
render
Proper motion rendering- Specified by:
render
in interfaceILineRenderable
-
getLineWidth
public float getLineWidth()- Specified by:
getLineWidth
in interfaceILineRenderable
-
getGlPrimitive
public int getGlPrimitive()- Specified by:
getGlPrimitive
in interfaceILineRenderable
-
render
public void render(ExtSpriteBatch batch, ExtShaderProgram shader, FontRenderSystem sys, RenderingContext rc, ICamera camera) Label rendering- Specified by:
render
in interfaceI3DTextRenderable
- Overrides:
render
in classParticleGroup
- Parameters:
batch
- The sprite batchshader
- The shadersys
- The font render systemrc
- The render contextcamera
- The camera
-
getFocusSize
public double getFocusSize()Description copied from class:ParticleGroup
Default size if not in data, 1e5 km- Overrides:
getFocusSize
in classParticleGroup
- Returns:
- The size
-
getRadius
public double getRadius()Description copied from class:SceneGraphNode
Returns the radius in internal units- Specified by:
getRadius
in interfaceIFocus
- Overrides:
getRadius
in classParticleGroup
- Returns:
- The radius of the object, in internal units
-
getRadius
public double getRadius(int i) - Overrides:
getRadius
in classParticleGroup
-
getAppmag
public float getAppmag()Description copied from interface:IFocus
Gets the apparent magnitude.- Specified by:
getAppmag
in interfaceIFocus
- Overrides:
getAppmag
in classParticleGroup
- Returns:
- The apparent magnitude.
-
getAbsmag
public float getAbsmag()Description copied from interface:IFocus
Gets the absolute magnitude.- Specified by:
getAbsmag
in interfaceIFocus
- Overrides:
getAbsmag
in classParticleGroup
- Returns:
- The absolute magnitude.
-
getId
public long getId()Description copied from class:ParticleGroup
Returns the id- Specified by:
getId
in interfaceIFocus
- Specified by:
getId
in interfaceIStarFocus
- Overrides:
getId
in classParticleGroup
- Returns:
- The id.
-
getMuAlpha
public double getMuAlpha()Description copied from interface:IProperMotion
Returns the mu alpha in mas/yr- Specified by:
getMuAlpha
in interfaceIProperMotion
- 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 interfaceIProperMotion
- 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 interfaceIProperMotion
- 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 classParticleGroup
- Parameters:
i
- The index- Returns:
- The size
-
notify
Description copied from interface:IObserver
Event notification call.- Specified by:
notify
in interfaceIObserver
- Overrides:
notify
in classParticleGroup
- 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 interfaceIStarFocus
- 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 interfaceIStarFocus
- Returns:
- The HIP number
-
getCandidateId
public long getCandidateId()Description copied from interface:IFocus
Returns the id of the focus candidate of this object. Defaults toIFocus.getId()
.- Specified by:
getCandidateId
in interfaceIFocus
- Overrides:
getCandidateId
in classParticleGroup
- Returns:
- The id of the candidate.
-
getCandidateName
Description copied from interface:IFocus
Returns the name of the focus candidate of this object. Defaults toIFocus.getName()
.- Specified by:
getCandidateName
in interfaceIFocus
- Overrides:
getCandidateName
in classParticleGroup
- 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 interfaceIFocus
- Overrides:
getCandidateViewAngleApparent
in classParticleGroup
- Returns:
- The apparent view angle in radians.
-
getClosestDistToCamera
public double getClosestDistToCamera()Description copied from interface:IFocus
Same asIFocus.getDistToCamera()
.- Specified by:
getClosestDistToCamera
in interfaceIFocus
- Specified by:
getClosestDistToCamera
in interfaceIStarFocus
- Overrides:
getClosestDistToCamera
in classParticleGroup
- Returns:
- The distance to the camera in internal units.
-
getClosestName
Description copied from interface:IFocus
Same asIFocus.getName()
.- Specified by:
getClosestName
in interfaceIFocus
- Specified by:
getClosestName
in interfaceIStarFocus
- Overrides:
getClosestName
in classParticleGroup
- Returns:
- The name.
-
getClosestSize
public double getClosestSize()Description copied from interface:IStarFocus
Returns the size of the closest star- Specified by:
getClosestSize
in interfaceIStarFocus
- Returns:
- The size of the closest star
-
getClosestPos
Description copied from interface:IStarFocus
Returns the position of the closest star in camera coordinates- Specified by:
getClosestPos
in interfaceIStarFocus
- Parameters:
out
- The out vector- Returns:
- The out vector with the position
-
getClosestAbsolutePos
Description copied from interface:IFocus
Same asIFocus.getAbsolutePosition(Vector3b)
.- Specified by:
getClosestAbsolutePos
in interfaceIFocus
- Specified by:
getClosestAbsolutePos
in interfaceIStarFocus
- Overrides:
getClosestAbsolutePos
in classParticleGroup
- 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 interfaceIStarFocus
- Returns:
- The color in rgb
-
hasAtmosphere
public boolean hasAtmosphere()- Specified by:
hasAtmosphere
in interfaceIModelRenderable
-
getFocus
Description copied from interface:IFocus
Prepares the candidate with the given name.- Specified by:
getFocus
in interfaceIFocus
- Overrides:
getFocus
in classParticleGroup
- Parameters:
name
- The name in lower case.
-
getAbsolutePosition
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 interfaceIFocus
- Overrides:
getAbsolutePosition
in classParticleGroup
- 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
-
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 classParticleGroup
- Parameters:
pb
- The particle beancampos
- 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 factordeltaYears
- 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 classParticleGroup
- Returns:
- The current delta years.
-
setEpoch
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
Returns the epoch in Julian Days used for the stars in this group- Returns:
- The epoch in julian days
-
setVariabilityepoch
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
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 interfacecom.badlogic.gdx.utils.Disposable
- Overrides:
dispose
in classParticleGroup
-
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 groupdata
- The data of the star groupdatasetOptions
- The dataset options- Returns:
- A new star group with the given parameters
-
getDefaultStarGroup
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 groupdata
- 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 groupdata
- The data of the star groupfullInit
- Initializes the group right away- Returns:
- A new star group with sane parameters
-
updateMetadata
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 classParticleGroup
- Parameters:
time
- The current time frame providercamera
- The camera
-
setLabelcolor
- Overrides:
setLabelcolor
in classSceneGraphNode
-
setForceLabel
- Overrides:
setForceLabel
in classSceneGraphNode
-
isForceLabel
- Overrides:
isForceLabel
in classSceneGraphNode
-
textColour
-
markForUpdate
public void markForUpdate()- Overrides:
markForUpdate
in classParticleGroup
-