Package gaiasky.scenegraph
Class ParticleGroup
- java.lang.Object
-
- gaiasky.scenegraph.SceneGraphNode
-
- gaiasky.scenegraph.AbstractPositionEntity
-
- gaiasky.scenegraph.FadeNode
-
- gaiasky.scenegraph.ParticleGroup
-
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable,IObserver,I3DTextRenderable,IRenderable,IFocus,IStarContainer,IPosition
- Direct Known Subclasses:
StarGroup
public class ParticleGroup extends FadeNode implements I3DTextRenderable, IFocus, IObserver
This class represents a group of non-focusable particles, all with the same luminosity. The contents of this group will be sent once to GPU memory and stay there, so all particles get rendered directly in the GPU from the GPU with no CPU intervention. This allows for much faster rendering. Use this for large groups of particles.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classParticleGroup.ParticleBeanclassParticleGroup.UpdaterTask-
Nested classes/interfaces inherited from class gaiasky.scenegraph.SceneGraphNode
SceneGraphNode.RenderGroup, SceneGraphNode.TLV3, SceneGraphNode.TLV3D
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Integer[]activeprotected java.lang.Integer[]backgroundprotected static doubleCAM_DX_THprotected float[]ccMaxMapping colorsprotected float[]ccMinMapping colorsprotected Vector3dclosestAbsolutePosClosestprotected doubleclosestDistprotected java.lang.StringclosestNameprotected Vector3dclosestPosClosestfloatcolorNoiseNoise factor for the color in [0,1]intcountprotected java.lang.StringdatafilePath of data filebooleandisposedprotected java.lang.DoublefactorFactor to apply to the data points, usually to normalise distancesprotected booleanfixedMeanPositionThis flag indicates whether the mean position is already given by the JSON injectorprotected ParticleGroup.ParticleBeanfocusReference to the current focusprotected com.badlogic.gdx.utils.ObjectIntMap<java.lang.String>indexprotected java.lang.Integer[]indices1protected java.lang.Integer[]indices2protected Vector3dlastSortCameraPosprotected longlastSortTimeStores the time when the last sort operation finished, in msprotected doublemaxDistanceprotected doublemeanDistanceThe mean distance from the origin of all points in this group.protected double[]metadataprotected static doubleMIN_UPDATE_TIME_MSprotected doubleminDistanceintoffsetdouble[]particleSizeLimitsParticle size limits, in pixelsprotected java.util.List<ParticleGroup.ParticleBean>pointDataList that contains the point data.floatprofileDecayProfile decay of the particles in the shaderprotected java.lang.StringproviderFully qualified name of data provider classprotected ParticleGroup.UpdaterTaskupdaterTaskprotected booleanupdating-
Fields inherited from class gaiasky.scenegraph.FadeNode
catalogInfo, highlighted, hlc, hlcma, hlcmi, hlcmmax, hlcmmin, hlplain, inSceneGraph, labelcolor, labelPosition
-
Fields inherited from class gaiasky.scenegraph.AbstractPositionEntity
cc, coordinates, copy, distToCamera, octant, octantId, pos, posSph, size, viewAngle, viewAngleApparent
-
Fields inherited from class gaiasky.scenegraph.SceneGraphNode
aux3d1, aux3d2, aux3d3, aux3d4, aux3f1, aux3f2, aux3f3, aux3f4, children, computed, ct, id, localTransform, namekey, names, numChildren, opacity, orientation, parent, parentkey, parentName, ROOT_NAME, sg, translation
-
-
Constructor Summary
Constructors Constructor Description ParticleGroup()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFocusableObjects(com.badlogic.gdx.utils.Array<IFocus> list)Adds all the children that are focusable objects to the list.voidaddHit(int screenX, int screenY, int w, int h, int pxdist, NaturalCamera camera, com.badlogic.gdx.utils.Array<IFocus> hits)Adds this focus to the hits list if it is hit by the [screenX, screenY] positionvoidaddHit(Vector3d p0, Vector3d p1, NaturalCamera camera, com.badlogic.gdx.utils.Array<IFocus> hits)Adds this focus to the hits list if it is hit by the given rayprotected voidaddToIndex(com.badlogic.gdx.utils.ObjectMap<java.lang.String,SceneGraphNode> map)Special actions to be taken for this object when adding to the index.protected voidaddToRenderLists(ICamera camera)Adds this entity to the necessary render lists after the distance to the camera and the view angle have been determined.booleancanSelect()Vector3dcomputeGeomCentre()Computes the geometric centre of this data cloudVector3dcomputeGeomCentre(boolean forceRecompute)Computes the geometric centre of this data cloudvoidcomputeMeanPosition()voidcomputeMinMeanMaxDistances()java.util.List<? extends ParticleGroup.ParticleBean>data()Returns the data listvoiddispose()voiddoneLoading(com.badlogic.gdx.assets.AssetManager manager)protected Vector3dfetchPosition(ParticleGroup.ParticleBean pb, Vector3d campos, Vector3d destination, double deltaYears)Fetches the real position of the particle.booleanfilter(int index)Evaluates the filter of this dataset (if any) for the given particle indexcom.badlogic.gdx.utils.ObjectIntMap<java.lang.String>generateIndex(java.util.List<? extends ParticleGroup.ParticleBean> pointData)Generates the index (maps name to array index) and computes the geometric center of this groupParticleGroup.ParticleBeanget(int index)floatgetAbsmag()Gets the absolute magnitudeVector3dgetAbsolutePosition(Vector3d out)Returns the absolute position of this entity in the native coordinates (equatorial system) and internal unitsVector3dgetAbsolutePosition(java.lang.String name, Vector3d out)Returns the absolute position of the entity identified by name within this entity in the native reference systemdoublegetAlpha()Returns the right ascension angle of this focus objectfloatgetAppmag()Gets the apparent magnitudeprotected floatgetBaseOpacity()longgetCandidateId()Returns the id of the focus candidate of this object.intgetCandidateIndex()java.lang.StringgetCandidateName()Returns the name of the focus candidate of this object.doublegetCandidateViewAngleApparent()Returns the candidate apparent view angle (view angle corrected with the field of view) of this entity, in radiansVector3dgetClosestAbsolutePos(Vector3d out)doublegetClosestDistToCamera()Same asIFocus.getDistToCamera()java.lang.StringgetClosestName()Same asIFocus.getName()float[]getColor()float[]getColorMax()float[]getColorMin()AbstractPositionEntitygetComputedAncestor()doublegetDelta()Returns the declination angle of this focus objectprotected doublegetDeltaYears()Returns the delta years to integrate the proper motion.doublegetDistToCamera()Returns the current distance to the camera in internal units.SceneGraphNodegetFirstStarAncestor()Gets the first ancestor of this node that is of typeStarIFocusgetFocus(java.lang.String name)Prepares the candidate with the given namedoublegetFocusSize()Default size if not in data, 1e5 kmlonggetId()Returns the iddoublegetMaxDistance()doublegetMeanDistance()doublegetMinDistance()java.lang.StringgetName()Returns the first name of this focusjava.lang.String[]getNames()Returns all names of this focusQuaterniondgetOrientationQuaternion()Returns the orientation quaternion of this focusstatic ParticleGroupgetParticleGroup(java.lang.String name, java.util.List<ParticleGroup.ParticleBean> data, DatasetOptions dops)Creates a default particle group with some parameters, given the name and dataVector2dgetPosSph()Gets the position in equatorial spherical coordinatesVector3dgetPredictedPosition(Vector3d aux, ITimeFrameProvider time, ICamera camera, boolean force)Gets the position of this entity in the next time step in the internal reference system using the given time provider and the given camera.java.lang.StringgetProvider()LABELdoublegetRadius()Returns the radius in internal unitsdoublegetRadius(int i)java.lang.StringgetRandomParticleName()Gets the name of a random particle in this groupRotationComponentgetRotationComponent()Returns the rotation component of this focusdoublegetSize()Returns the size (diameter) of this entity in internal units.doublegetSize(int i)Returns the size of the particle at index iintgetStarCount()floatgetTextOpacity()Gets the text opacitydoublegetViewAngle()Returns the current view angle of this entity, in radians.doublegetViewAngleApparent()Returns the current apparent view angle (view angle corrected with the field of view) of this entity, in radians.voidhighlight(boolean hl, float[] color)Highlight using a plain colorvoidhighlight(boolean hl, int cmi, IAttribute cma, double cmmin, double cmmax)Highlight using a colormapfloathighlightedSizeFactor()booleaninGpu()voidinGpu(boolean inGpu)voidinitialize()voidinitialize(boolean dataLoad, boolean createCatalogInfo)booleanisActive()Returns whether this focus object is active or not.booleanisCoordinatesTimeOverflow()Checks whether this foucs is within its valid time range, so that it can be used as a focusbooleanisLabel()Is it a label or another kind of text?voidmakeFocus()Hook that runs when the candidate is actually made focusbooleanmustAddToIndex()Whether to add this node to the indexvoidnotify(Events event, java.lang.Object... data)voidregenerateIndex()Regenerates the name indexprotected voidremoveFromIndex(com.badlogic.gdx.utils.ObjectMap<java.lang.String,SceneGraphNode> map)Special actions to be taken for this object when removing from the index.voidrender(ExtSpriteBatch batch, ExtShaderProgram shader, FontRenderSystem sys, RenderingContext rc, ICamera camera)Label renderingbooleanrenderText()Tells whether the text must be rendered or not for this entityvoidsetColorMax(double[] colorMax)voidsetColorMax(float[] colorMax)voidsetColorMin(double[] colorMin)voidsetColorMin(float[] colorMin)voidsetColornoise(java.lang.Double colorNoise)voidsetData(java.util.List<ParticleGroup.ParticleBean> pointData)voidsetData(java.util.List<ParticleGroup.ParticleBean> pointData, boolean regenerateIndex)voidsetDatafile(java.lang.String datafile)voidsetFactor(java.lang.Double factor)voidsetFocusIndex(int index)voidsetInGpu(boolean inGpu)voidsetLabelPosition()voidsetParticlesizelimits(double[] sizeLimits)voidsetPosition(double[] pos)Returns position of focusvoidsetProfiledecay(java.lang.Double profiledecay)voidsetProvider(java.lang.String provider)intsize()Number of objects of this groupprotected voidswapBuffers()java.lang.Stringtext()Returns the textfloat[]textColour()Returns an array with the text colour in the fashion [r, g, b, a]voidtextDepthBuffer()Executes the blending for the textvoidtextPosition(ICamera cam, Vector3d out)Sets the position of this text in the out vectorvoidtextPosition(ICamera cam, Vector3d out, float len, float rad)floattextScale()Returns the text scale for the scale varying in the shaderfloattextSize()Returns the text sizevoidupdate(ITimeFrameProvider time, Vector3d parentTransform, ICamera camera)voidupdate(ITimeFrameProvider time, Vector3d parentTransform, ICamera camera, float opacity)voidupdateFocus(ITimeFrameProvider time, ICamera camera)Updates the parameters of the focus, if the focus is active in this groupvoidupdateLocalValues(ITimeFrameProvider time, ICamera camera)This function updates all the local values before the localTransform is updated.voidupdateMetadata(ITimeFrameProvider time, ICamera camera)Updates the metadata information, to use for sorting.voidupdateSorter(ITimeFrameProvider time, ICamera camera)booleanwithinMagLimit()Returns true if the focus is within the magnitude limit defined inGlobalConf-
Methods inherited from class gaiasky.scenegraph.FadeNode
getCatalogInfo, getHlcma, getHlcmi, getHlcmmax, getHlcmmin, isHighlighted, isHlplain, isVisible, setCataloginfo, setCatalogInfo, setCatalogInfoBare, setFadein, setFadeout, setLabelcolor, setLabelcolor, setLabelposition, setPositionobjectname, setSize, setSize, setUp, setVisible, updateLocal
-
Methods inherited from class gaiasky.scenegraph.AbstractPositionEntity
computeFuturePosition, getAbsoluteOrientation, getHeight, getHeight, getHeight, getHeightScale, getNext, getOctant, getPos, getPosition, getPosition, getSimpleCopy, isCopy, mustUpdatePosition, render2DLabel, render2DLabel, render2DLabel, render2DLabel, render3DLabel, setColor, setColor, setCoordinates
-
Methods inherited from class gaiasky.scenegraph.SceneGraphNode
add, add, addChild, addChild, addName, addNodes, addToRender, getAggregatedChildren, getChildByName, getChildByNameAndType, getChildrenByType, getComponentType, getCt, getLineCopy, getNode, getNode, getOpacity, getOrientation, getRoot, getSceneGraphDepth, getVelocity, hasName, hasName, insert, insert, isInRender, isInRender, isValidPosition, isVisibilityOn, namesConcat, removeChild, removeFromRender, returnToPool, setComputedFlag, setCt, setCt, setId, setName, setNamekey, setNames, setParent, setParentkey, toString, updateNames, updateNamesRec
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface gaiasky.scenegraph.IFocus
getCt, getHeight, getHeight, getHeight, getHeightScale, getNext, getOctant, getOrientation, getPos, getSceneGraphDepth, hasName, hasName, isCopy
-
Methods inherited from interface gaiasky.render.IRenderable
getComponentType, getOpacity
-
-
-
-
Field Detail
-
pointData
protected java.util.List<ParticleGroup.ParticleBean> pointData
List that contains the point data. It contains only [x y z]
-
provider
protected java.lang.String provider
Fully qualified name of data provider class
-
datafile
protected java.lang.String datafile
Path of data file
-
profileDecay
public float profileDecay
Profile decay of the particles in the shader
-
colorNoise
public float colorNoise
Noise factor for the color in [0,1]
-
particleSizeLimits
public double[] particleSizeLimits
Particle size limits, in pixels
-
offset
public int offset
-
count
public int count
-
fixedMeanPosition
protected boolean fixedMeanPosition
This flag indicates whether the mean position is already given by the JSON injector
-
factor
protected java.lang.Double factor
Factor to apply to the data points, usually to normalise distances
-
ccMin
protected float[] ccMin
Mapping colors
-
ccMax
protected float[] ccMax
Mapping colors
-
lastSortTime
protected long lastSortTime
Stores the time when the last sort operation finished, in ms
-
meanDistance
protected double meanDistance
The mean distance from the origin of all points in this group. Gives a sense of the scale.
-
maxDistance
protected double maxDistance
-
minDistance
protected double minDistance
-
focus
protected ParticleGroup.ParticleBean focus
Reference to the current focus
-
closestPos
protected Vector3d closestPos
Closest
-
closestAbsolutePos
protected Vector3d closestAbsolutePos
Closest
-
closestDist
protected double closestDist
-
closestName
protected java.lang.String closestName
-
disposed
public boolean disposed
-
index
protected com.badlogic.gdx.utils.ObjectIntMap<java.lang.String> index
-
MIN_UPDATE_TIME_MS
protected static final double MIN_UPDATE_TIME_MS
- See Also:
- Constant Field Values
-
metadata
protected double[] metadata
-
indices1
protected java.lang.Integer[] indices1
-
indices2
protected java.lang.Integer[] indices2
-
active
protected java.lang.Integer[] active
-
background
protected java.lang.Integer[] background
-
updating
protected volatile boolean updating
-
updaterTask
protected ParticleGroup.UpdaterTask updaterTask
-
CAM_DX_TH
protected static final double CAM_DX_TH
-
lastSortCameraPos
protected Vector3d lastSortCameraPos
-
-
Method Detail
-
initialize
public void initialize()
- Overrides:
initializein classSceneGraphNode
-
initialize
public void initialize(boolean dataLoad, boolean createCatalogInfo)
-
computeMinMeanMaxDistances
public void computeMinMeanMaxDistances()
-
computeMeanPosition
public void computeMeanPosition()
-
setLabelPosition
public void setLabelPosition()
-
doneLoading
public void doneLoading(com.badlogic.gdx.assets.AssetManager manager)
- Overrides:
doneLoadingin classFadeNode
-
data
public java.util.List<? extends ParticleGroup.ParticleBean> data()
Returns the data list- Returns:
- The data list
-
setData
public void setData(java.util.List<ParticleGroup.ParticleBean> pointData)
-
setData
public void setData(java.util.List<ParticleGroup.ParticleBean> pointData, boolean regenerateIndex)
-
regenerateIndex
public void regenerateIndex()
Regenerates the name index
-
generateIndex
public com.badlogic.gdx.utils.ObjectIntMap<java.lang.String> generateIndex(java.util.List<? extends ParticleGroup.ParticleBean> pointData)
Generates the index (maps name to array index) and computes the geometric center of this group- Parameters:
pointData- The data- Returns:
- An map{string,int} mapping names to indices
-
addToIndex
protected void addToIndex(com.badlogic.gdx.utils.ObjectMap<java.lang.String,SceneGraphNode> map)
Description copied from class:SceneGraphNodeSpecial actions to be taken for this object when adding to the index.- Overrides:
addToIndexin classSceneGraphNode- Parameters:
map- The index
-
removeFromIndex
protected void removeFromIndex(com.badlogic.gdx.utils.ObjectMap<java.lang.String,SceneGraphNode> map)
Description copied from class:SceneGraphNodeSpecial actions to be taken for this object when removing from the index. Must implement if addToIndex is implemented- Overrides:
removeFromIndexin classSceneGraphNode- Parameters:
map- The index
-
get
public ParticleGroup.ParticleBean get(int index)
-
getRandomParticleName
public java.lang.String getRandomParticleName()
Gets the name of a random particle in this group- Returns:
- The name of a random particle
-
computeGeomCentre
public Vector3d computeGeomCentre()
Computes the geometric centre of this data cloud
-
computeGeomCentre
public Vector3d computeGeomCentre(boolean forceRecompute)
Computes the geometric centre of this data cloud- Parameters:
forceRecompute- Recomputes the geometric centre even if it has been already computed
-
size
public int size()
Number of objects of this group- Returns:
- The number of objects
-
update
public void update(ITimeFrameProvider time, Vector3d parentTransform, ICamera camera, float opacity)
-
update
public void update(ITimeFrameProvider time, Vector3d parentTransform, ICamera camera)
- Overrides:
updatein classSceneGraphNode
-
updateFocus
public void updateFocus(ITimeFrameProvider time, ICamera camera)
Updates the parameters of the focus, if the focus is active in this group- Parameters:
time- The time frame providercamera- The current camera
-
addToRenderLists
protected void addToRenderLists(ICamera camera)
Description copied from class:AbstractPositionEntityAdds this entity to the necessary render lists after the distance to the camera and the view angle have been determined.- Overrides:
addToRenderListsin classFadeNode
-
render
public void render(ExtSpriteBatch batch, ExtShaderProgram shader, FontRenderSystem sys, RenderingContext rc, ICamera camera)
Label rendering- Specified by:
renderin interfaceI3DTextRenderable- Parameters:
batch- The sprite batchshader- The shadersys- The font render systemrc- The render contextcamera- The camera
-
textScale
public float textScale()
Description copied from interface:I3DTextRenderableReturns the text scale for the scale varying in the shader- Specified by:
textScalein interfaceI3DTextRenderable- Returns:
- The scale
-
getProvider
public java.lang.String getProvider()
LABEL
-
setProvider
public void setProvider(java.lang.String provider)
-
setDatafile
public void setDatafile(java.lang.String datafile)
-
updateLocalValues
public void updateLocalValues(ITimeFrameProvider time, ICamera camera)
Description copied from class:AbstractPositionEntityThis function updates all the local values before the localTransform is updated. Position, rotations and scale must be updated in here.- Overrides:
updateLocalValuesin classFadeNode
-
renderText
public boolean renderText()
Description copied from interface:I3DTextRenderableTells whether the text must be rendered or not for this entity- Specified by:
renderTextin interfaceI3DTextRenderable- Returns:
- True if text must be rendered
-
textColour
public float[] textColour()
Description copied from interface:I3DTextRenderableReturns an array with the text colour in the fashion [r, g, b, a]- Specified by:
textColourin interfaceI3DTextRenderable- Returns:
- Array with the colour
-
textSize
public float textSize()
Description copied from interface:I3DTextRenderableReturns the text size- Specified by:
textSizein interfaceI3DTextRenderable- Returns:
- The text size
-
textPosition
public void textPosition(ICamera cam, Vector3d out)
Description copied from interface:I3DTextRenderableSets the position of this text in the out vector- Specified by:
textPositionin interfaceI3DTextRenderableout- The out parameter with the result
-
text
public java.lang.String text()
Description copied from interface:I3DTextRenderableReturns the text- Specified by:
textin interfaceI3DTextRenderable- Returns:
- The text
-
textDepthBuffer
public void textDepthBuffer()
Description copied from interface:I3DTextRenderableExecutes the blending for the text- Specified by:
textDepthBufferin interfaceI3DTextRenderable
-
isLabel
public boolean isLabel()
Description copied from interface:I3DTextRenderableIs it a label or another kind of text?- Specified by:
isLabelin interfaceI3DTextRenderable- Returns:
- Whether this is a label
-
setFactor
public void setFactor(java.lang.Double factor)
-
setProfiledecay
public void setProfiledecay(java.lang.Double profiledecay)
-
setColornoise
public void setColornoise(java.lang.Double colorNoise)
-
setParticlesizelimits
public void setParticlesizelimits(double[] sizeLimits)
-
getFocusSize
public double getFocusSize()
Default size if not in data, 1e5 km- Returns:
- The size
-
getId
public long getId()
Returns the id- Specified by:
getIdin interfaceIFocus- Overrides:
getIdin classSceneGraphNode- Returns:
- The id
-
getClosestName
public java.lang.String getClosestName()
Description copied from interface:IFocusSame asIFocus.getName()- Specified by:
getClosestNamein interfaceIFocus- Returns:
- The name
-
getClosestDistToCamera
public double getClosestDistToCamera()
Description copied from interface:IFocusSame asIFocus.getDistToCamera()- Specified by:
getClosestDistToCamerain interfaceIFocus- Returns:
- The distance to the camera in internal units
-
getClosestAbsolutePos
public Vector3d getClosestAbsolutePos(Vector3d out)
Description copied from interface:IFocus- Specified by:
getClosestAbsolutePosin interfaceIFocus- Parameters:
out- Vector3d where to put the return value- Returns:
- The absolute position, same as aux
-
getStarCount
public int getStarCount()
- Specified by:
getStarCountin interfaceIStarContainer- Overrides:
getStarCountin classSceneGraphNode
-
isActive
public boolean isActive()
Description copied from interface:IFocusReturns whether this focus object is active or not. Useful for particle groups
-
setPosition
public void setPosition(double[] pos)
Returns position of focus- Overrides:
setPositionin classFadeNode
-
addFocusableObjects
public void addFocusableObjects(com.badlogic.gdx.utils.Array<IFocus> list)
Adds all the children that are focusable objects to the list.- Overrides:
addFocusableObjectsin classSceneGraphNode- Parameters:
list-
-
getComputedAncestor
public AbstractPositionEntity getComputedAncestor()
-
getFirstStarAncestor
public SceneGraphNode getFirstStarAncestor()
Description copied from class:SceneGraphNodeGets the first ancestor of this node that is of typeStar- Specified by:
getFirstStarAncestorin interfaceIFocus- Overrides:
getFirstStarAncestorin classSceneGraphNode- Returns:
- The first ancestor of type
Star
-
getAbsolutePosition
public Vector3d getAbsolutePosition(Vector3d out)
Description copied from class:AbstractPositionEntityReturns the absolute position of this entity in the native coordinates (equatorial system) and internal units- Specified by:
getAbsolutePositionin interfaceIFocus- Overrides:
getAbsolutePositionin classAbstractPositionEntity- Parameters:
out- Auxiliary vector to put the result in- Returns:
- The vector with the position
-
getAbsolutePosition
public Vector3d getAbsolutePosition(java.lang.String name, Vector3d out)
Description copied from interface:IFocusReturns the absolute position of the entity identified by name within this entity in the native reference system- Specified by:
getAbsolutePositionin interfaceIFocus- Overrides:
getAbsolutePositionin classAbstractPositionEntity- Parameters:
name- The name (lowercase) of the entity to get the position from (useful in case of star groups)out- Vector3d to put the return value- Returns:
- The absolute position of the entity if it exists, null otherwise
-
getPredictedPosition
public Vector3d getPredictedPosition(Vector3d aux, ITimeFrameProvider time, ICamera camera, boolean force)
Description copied from class:AbstractPositionEntityGets the position of this entity in the next time step in the internal reference system using the given time provider and the given camera.- Specified by:
getPredictedPositionin interfaceIFocus- Overrides:
getPredictedPositionin classAbstractPositionEntity- 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.
-
getPosSph
public Vector2d getPosSph()
Description copied from interface:IFocusGets the position in equatorial spherical coordinates- Specified by:
getPosSphin interfaceIFocus- Overrides:
getPosSphin classAbstractPositionEntity- Returns:
- The position in alpha, delta
-
getDistToCamera
public double getDistToCamera()
Description copied from class:AbstractPositionEntityReturns the current distance to the camera in internal units.- Specified by:
getDistToCamerain interfaceIFocus- Specified by:
getDistToCamerain interfaceIRenderable- Overrides:
getDistToCamerain classAbstractPositionEntity- Returns:
- The current distance to the camera, in internal units.
-
getViewAngle
public double getViewAngle()
Description copied from class:AbstractPositionEntityReturns the current view angle of this entity, in radians.- Specified by:
getViewAnglein interfaceIFocus- Overrides:
getViewAnglein classAbstractPositionEntity- Returns:
- The view angle in radians.
-
getViewAngleApparent
public double getViewAngleApparent()
Description copied from class:AbstractPositionEntityReturns the current apparent view angle (view angle corrected with the field of view) of this entity, in radians.- Specified by:
getViewAngleApparentin interfaceIFocus- Overrides:
getViewAngleApparentin classAbstractPositionEntity- Returns:
- The apparent view angle in radians.
-
getSize
public double getSize()
Description copied from class:AbstractPositionEntityReturns the size (diameter) of this entity in internal units.- Specified by:
getSizein interfaceIFocus- Overrides:
getSizein classAbstractPositionEntity- Returns:
- The size in internal units.
-
getAppmag
public float getAppmag()
Description copied from interface:IFocusGets the apparent magnitude
-
getAbsmag
public float getAbsmag()
Description copied from interface:IFocusGets the absolute magnitude
-
getName
public java.lang.String getName()
Description copied from interface:IFocusReturns the first name of this focus- Specified by:
getNamein interfaceIFocus- Overrides:
getNamein classSceneGraphNode- Returns:
- The first name
-
getNames
public java.lang.String[] getNames()
Description copied from interface:IFocusReturns all names of this focus- Specified by:
getNamesin interfaceIFocus- Overrides:
getNamesin classSceneGraphNode- Returns:
- All names of this focus
-
getSize
public double getSize(int i)
Returns the size of the particle at index i- Parameters:
i- The index- Returns:
- The size
-
getRadius
public double getRadius(int i)
-
getRadius
public double getRadius()
Description copied from class:AbstractPositionEntityReturns the radius in internal units- Specified by:
getRadiusin interfaceIFocus- Overrides:
getRadiusin classAbstractPositionEntity- Returns:
- The radius of the object, in internal units
-
withinMagLimit
public boolean withinMagLimit()
Description copied from interface:IFocusReturns true if the focus is within the magnitude limit defined inGlobalConf- Specified by:
withinMagLimitin interfaceIFocus- Returns:
- True if focus within magnitude limit
-
getRotationComponent
public RotationComponent getRotationComponent()
Description copied from interface:IFocusReturns the rotation component of this focus- Specified by:
getRotationComponentin interfaceIFocus- Returns:
- The rotation component. Can be null
-
getOrientationQuaternion
public Quaterniond getOrientationQuaternion()
Description copied from interface:IFocusReturns the orientation quaternion of this focus- Specified by:
getOrientationQuaternionin interfaceIFocus- Returns:
- The orientation quaternion. Can be null
-
getColor
public float[] getColor()
-
highlightedSizeFactor
public float highlightedSizeFactor()
-
addHit
public void addHit(int screenX, int screenY, int w, int h, int pxdist, NaturalCamera camera, com.badlogic.gdx.utils.Array<IFocus> hits)Description copied from interface:IFocusAdds this focus to the hits list if it is hit by the [screenX, screenY] position
-
addHit
public void addHit(Vector3d p0, Vector3d p1, NaturalCamera camera, com.badlogic.gdx.utils.Array<IFocus> hits)
Description copied from interface:IFocusAdds this focus to the hits list if it is hit by the given ray
-
notify
public void notify(Events event, java.lang.Object... data)
-
setFocusIndex
public void setFocusIndex(int index)
-
makeFocus
public void makeFocus()
Description copied from interface:IFocusHook that runs when the candidate is actually made focus
-
getCandidateIndex
public int getCandidateIndex()
-
getCandidateId
public long getCandidateId()
Description copied from interface:IFocusReturns the id of the focus candidate of this object. Defaults toIFocus.getId()- Specified by:
getCandidateIdin interfaceIFocus- Returns:
- The id of the candidate
-
getCandidateName
public java.lang.String getCandidateName()
Description copied from interface:IFocusReturns the name of the focus candidate of this object. Defaults toIFocus.getName()- Specified by:
getCandidateNamein interfaceIFocus- Returns:
- The name of the candidate
-
getCandidateViewAngleApparent
public double getCandidateViewAngleApparent()
Description copied from interface:IFocusReturns the candidate apparent view angle (view angle corrected with the field of view) of this entity, in radians- Specified by:
getCandidateViewAngleApparentin interfaceIFocus- Returns:
- The apparent view angle in radians
-
getFocus
public IFocus getFocus(java.lang.String name)
Description copied from interface:IFocusPrepares the candidate with the given name
-
getAlpha
public double getAlpha()
Description copied from interface:IFocusReturns the right ascension angle of this focus object- Specified by:
getAlphain interfaceIFocus- Overrides:
getAlphain classAbstractPositionEntity- Returns:
- The right ascension angle in degrees
-
getDelta
public double getDelta()
Description copied from interface:IFocusReturns the declination angle of this focus object- Specified by:
getDeltain interfaceIFocus- Overrides:
getDeltain classAbstractPositionEntity- Returns:
- The declination angle in degrees
-
getBaseOpacity
protected float getBaseOpacity()
- Overrides:
getBaseOpacityin classFadeNode
-
fetchPosition
protected Vector3d fetchPosition(ParticleGroup.ParticleBean pb, Vector3d campos, Vector3d destination, double deltaYears)
Fetches the real position of the particle. It will apply the necessary integrations (i.e. proper motion).- 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.destination- The destination factordeltaYears- The delta years- Returns:
- The vector for chaining
-
getMeanDistance
public double getMeanDistance()
-
getMinDistance
public double getMinDistance()
-
getMaxDistance
public double getMaxDistance()
-
getDeltaYears
protected double getDeltaYears()
Returns the delta years to integrate the proper motion.- Returns:
-
isCoordinatesTimeOverflow
public boolean isCoordinatesTimeOverflow()
Description copied from interface:IFocusChecks whether this foucs is within its valid time range, so that it can be used as a focus- Specified by:
isCoordinatesTimeOverflowin interfaceIFocus- Returns:
- Whether the focus object is within its valid time range
-
canSelect
public boolean canSelect()
-
mustAddToIndex
public boolean mustAddToIndex()
Description copied from class:SceneGraphNodeWhether to add this node to the index- Overrides:
mustAddToIndexin classSceneGraphNode- Returns:
- True if the node needs to be added to the index.
-
dispose
public void dispose()
- Specified by:
disposein interfacecom.badlogic.gdx.utils.Disposable- Overrides:
disposein classSceneGraphNode
-
inGpu
public boolean inGpu()
-
inGpu
public void inGpu(boolean inGpu)
-
setInGpu
public void setInGpu(boolean inGpu)
-
getTextOpacity
public float getTextOpacity()
Description copied from interface:I3DTextRenderableGets the text opacity- Specified by:
getTextOpacityin interfaceI3DTextRenderable- Returns:
- Text opacity
-
highlight
public void highlight(boolean hl, float[] color)Description copied from class:FadeNodeHighlight using a plain color
-
highlight
public void highlight(boolean hl, int cmi, IAttribute cma, double cmmin, double cmmax)Description copied from class:FadeNodeHighlight using a colormap
-
setColorMin
public void setColorMin(double[] colorMin)
-
setColorMin
public void setColorMin(float[] colorMin)
-
setColorMax
public void setColorMax(double[] colorMax)
-
setColorMax
public void setColorMax(float[] colorMax)
-
getColorMin
public float[] getColorMin()
-
getColorMax
public float[] getColorMax()
-
filter
public boolean filter(int index)
Evaluates the filter of this dataset (if any) for the given particle index- Parameters:
index- The index to filter- Returns:
- The result of the filter evaluation
-
getParticleGroup
public static ParticleGroup getParticleGroup(java.lang.String name, java.util.List<ParticleGroup.ParticleBean> data, DatasetOptions dops)
Creates a default particle group with some parameters, given the name and data- Parameters:
name- The name of the particle group. Any occurrence of '%%PGID%%' will be replaced with the id of the particle groupdata- The data of the particle groupdops- The dataset options- Returns:
- A new particle group with the given parameters
-
updateMetadata
public void updateMetadata(ITimeFrameProvider time, ICamera camera)
Updates the metadata information, to use for sorting. For particles, only the position (distance from camera) is important.- Parameters:
time- The time frame providercamera- The camera
-
updateSorter
public void updateSorter(ITimeFrameProvider time, ICamera camera)
-
swapBuffers
protected void swapBuffers()
-
-