Package gaiasky.scenegraph
Class ParticleGroup
java.lang.Object
gaiasky.scenegraph.SceneGraphNode
gaiasky.scenegraph.FadeNode
gaiasky.scenegraph.ParticleGroup
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable,IObserver,I3DTextRenderable,IRenderable,IFocus,IStarContainer,IVisibilitySwitch,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 classParticleGroup.UpdaterTask -
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 colorsfloatcolorNoiseNoise factor for the color in [0,1]intcountprotected Vector3dcPosDprotected 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 IParticleRecordfocusReference to the current focusprotected java.util.Map<java.lang.String,java.lang.Integer>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 doubleminDistanceintoffsetdouble[]particleSizeLimitsParticle size limits, in pixelsprotected java.util.List<IParticleRecord>pointDataList that contains the point data.floatprofileDecayProfile decay of the particles in the shaderprotected java.lang.StringproviderFully qualified name of data provider classprotected ProximityproximityProximity particlesprotected static doubleUPDATE_INTERVAL_MSprotected ParticleGroup.UpdaterTaskupdaterTaskprotected booleanupdatingprotected byte[]visibilityArrayFields inherited from class gaiasky.scenegraph.FadeNode
catalogInfo, currentDistance, highlighted, hlallvisible, hlc, hlcma, hlcmi, hlcmmax, hlcmmin, hlplain, inSceneGraph, labelcolor, labelPositionFields inherited from class gaiasky.scenegraph.SceneGraphNode
aux3b1, aux3b2, aux3b3, aux3b4, aux3d1, aux3d2, aux3d3, aux3d4, aux3f1, aux3f2, aux3f3, aux3f4, cc, children, computed, coordinates, copy, ct, distToCamera, id, lastStateChangeTimeMs, localTransform, namekey, names, numChildren, octant, octantId, opacity, orientation, parent, parentkey, parentName, pos, posSph, ROOT_NAME, sg, size, translation, viewAngle, viewAngleApparent, visible -
Constructor Summary
Constructors Constructor Description ParticleGroup() -
Method Summary
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<IParticleRecord>data()Returns the data listvoiddispose()voiddoneLoading(com.badlogic.gdx.assets.AssetManager manager)protected Vector3dfetchPosition(IParticleRecord 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 indexjava.util.Map<java.lang.String,java.lang.Integer>generateIndex(java.util.List<IParticleRecord> pointData)Generates the index (maps name to array index) and computes the geometric center of this groupIParticleRecordget(int index)floatgetAbsmag()Gets the absolute magnitudeVector3bgetAbsolutePosition(Vector3b out)Returns the absolute position of this entity in the native coordinates (equatorial system) and internal unitsVector3bgetAbsolutePosition(java.lang.String name, Vector3b 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()IParticleRecordgetCandidateBean()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 radiansVector3bgetClosestAbsolutePos(Vector3b out)doublegetClosestDistToCamera()Same asIFocus.getDistToCamera()java.lang.StringgetClosestName()Same asIFocus.getName()float[]getColor()Gets the color of this objectfloat[]getColorMax()float[]getColorMin()SceneGraphNodegetComputedAncestor()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<IParticleRecord> data, DatasetOptions dops)Creates a default particle group with some parameters, given the name and dataVector2dgetPosSph()Gets the position in equatorial spherical coordinatesVector3bgetPredictedPosition(Vector3b 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()doublegetRadius()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, boolean allVisible)Highlight using a plain colorvoidhighlight(boolean hl, int cmi, IAttribute cma, double cmmin, double cmmax, boolean allVisible)Highlight using a colormapfloathighlightedSizeFactor()booleaninGpu()voidinGpu(boolean inGpu)voidinitialize()voidinitialize(boolean dataLoad, boolean createCatalogInfo)protected voidinitSortingData()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?booleanisVisible()booleanisVisible(boolean attributeValue)Overrides the isVisible() method, and uses the current focus index, if anybooleanisVisible(int index)Checks whether the particle with the given index is visiblevoidmakeFocus()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<IParticleRecord> pointData)voidsetData(java.util.List<IParticleRecord> 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)voidsetVisible(boolean visible)Overrides the setVisible() method and uses the current focus index, if any.voidsetVisible(int index, boolean visible)Sets the visibility of the particle with the given index.protected booleanshouldRender()Overridden because theSceneGraphNode.visibleis not used in particle groups.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, double len, double rad)floattextScale()Returns the text scale for the scale varying in the shaderfloattextSize()Returns the text sizevoidupdate(ITimeFrameProvider time, Vector3b parentTransform, ICamera camera)voidupdate(ITimeFrameProvider time, Vector3b 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)Methods inherited from class gaiasky.scenegraph.FadeNode
getCatalogInfo, getFadeIn, getFadeOut, getHlcma, getHlcmi, getHlcmmax, getHlcmmin, isHighlighted, isHlAllVisible, isHlplain, setCataloginfo, setCatalogInfo, setCatalogInfoBare, setFadein, setFadeout, setLabelcolor, setLabelcolor, setLabelposition, setPositionobjectname, setSize, setSize, setUp, updateLocal, updateOpacityMethods inherited from class gaiasky.scenegraph.SceneGraphNode
add, add, addChild, addChild, addName, addNodes, addToRender, computeFuturePosition, getAbsoluteOrientation, getAggregatedChildren, getChildByName, getChildByNameAndType, getChildrenByComponentType, getChildrenByType, getComponentType, getCt, getDescription, getHeight, getHeight, getHeight, getHeightScale, getLineCopy, getNext, getNode, getNode, getOctant, getOpacity, getOrientation, getPos, getPosition, getPosition, getRoot, getSceneGraphDepth, getSimpleCopy, getUnrotatedPos, getVelocity, getVisibilityOpacityFactor, hasCt, hasName, hasName, insert, insert, isCopy, isInRender, isInRender, isValidPosition, isVisibilityOn, msSinceStateChange, mustUpdatePosition, namesConcat, removeChild, removeFromRender, render2DLabel, render2DLabel, render2DLabel, render2DLabel, render3DLabel, render3DLabel, returnToPool, setColor, setColor, setComputedFlag, setCoordinates, setCt, setCt, setDescription, setId, setName, setNamekey, setNames, setParent, setParentkey, toString, updateNames, updateNamesRecMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface gaiasky.scenegraph.IFocus
getCt, getHeight, getHeight, getHeight, getHeightScale, getNext, getOctant, getOrientation, getPos, getSceneGraphDepth, hasName, hasName, isCopyMethods inherited from interface gaiasky.render.IRenderable
getComponentType, getOpacity
-
Field Details
-
pointData
List that contains the point data. It contains only [x y z] -
provider
protected java.lang.String providerFully qualified name of data provider class -
datafile
protected java.lang.String datafilePath of data file -
profileDecay
public float profileDecayProfile decay of the particles in the shader -
colorNoise
public float colorNoiseNoise factor for the color in [0,1] -
particleSizeLimits
public double[] particleSizeLimitsParticle size limits, in pixels -
offset
public int offset -
count
public int count -
fixedMeanPosition
protected boolean fixedMeanPositionThis flag indicates whether the mean position is already given by the JSON injector -
factor
protected java.lang.Double factorFactor to apply to the data points, usually to normalise distances -
ccMin
protected float[] ccMinMapping colors -
ccMax
protected float[] ccMaxMapping colors -
lastSortTime
protected long lastSortTimeStores the time when the last sort operation finished, in ms -
meanDistance
protected double meanDistanceThe 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
Reference to the current focus -
proximity
Proximity particles -
disposed
public boolean disposed -
index
protected java.util.Map<java.lang.String,java.lang.Integer> index -
UPDATE_INTERVAL_MS
protected static final double UPDATE_INTERVAL_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 -
visibilityArray
protected byte[] visibilityArray -
updating
protected volatile boolean updating -
updaterTask
-
CAM_DX_TH
protected static final double CAM_DX_TH -
lastSortCameraPos
-
cPosD
-
-
Constructor Details
-
ParticleGroup
public ParticleGroup()
-
-
Method Details
-
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
-
initSortingData
protected void initSortingData() -
data
Returns the data list- Returns:
- The data list
-
setData
-
setData
-
isVisible
public boolean isVisible(int index)Checks whether the particle with the given index is visible- Parameters:
index- The index of the particle- Returns:
- The visibility of the particle
-
isVisible
public boolean isVisible()- Specified by:
isVisiblein interfaceIVisibilitySwitch- Overrides:
isVisiblein classSceneGraphNode
-
isVisible
public boolean isVisible(boolean attributeValue)Overrides the isVisible() method, and uses the current focus index, if any- Specified by:
isVisiblein interfaceIVisibilitySwitch- Overrides:
isVisiblein classSceneGraphNode- Parameters:
attributeValue- Whether to use the visibility attribute directly- Returns:
- The visibility
-
setVisible
public void setVisible(int index, boolean visible)Sets the visibility of the particle with the given index. If the visibility has changed, it marks the particle group for update.- Parameters:
index- The index of the particlevisible- Visibility flag
-
setVisible
public void setVisible(boolean visible)Overrides the setVisible() method and uses the current focus index, if any.- Specified by:
setVisiblein interfaceIVisibilitySwitch- Overrides:
setVisiblein classSceneGraphNode- Parameters:
visible- The visibility state
-
regenerateIndex
public void regenerateIndex()Regenerates the name index -
generateIndex
public java.util.Map<java.lang.String,java.lang.Integer> generateIndex(java.util.List<IParticleRecord> 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
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
-
getRandomParticleName
public java.lang.String getRandomParticleName()Gets the name of a random particle in this group- Returns:
- The name of a random particle
-
computeGeomCentre
Computes the geometric centre of this data cloud -
computeGeomCentre
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, Vector3b parentTransform, ICamera camera, float opacity) -
update
- Overrides:
updatein classSceneGraphNode
-
updateFocus
Updates the parameters of the focus, if the focus is active in this group- Parameters:
time- The time frame providercamera- The current camera
-
addToRenderLists
Description copied from class:SceneGraphNodeAdds 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
-
textPosition
-
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() -
setProvider
public void setProvider(java.lang.String provider) -
setDatafile
public void setDatafile(java.lang.String datafile) -
updateLocalValues
Description copied from class:SceneGraphNodeThis 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
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
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
Adds all the children that are focusable objects to the list.- Overrides:
addFocusableObjectsin classSceneGraphNode- Parameters:
list-
-
getComputedAncestor
-
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
Description copied from class:SceneGraphNodeReturns the absolute position of this entity in the native coordinates (equatorial system) and internal units- Specified by:
getAbsolutePositionin interfaceIFocus- Overrides:
getAbsolutePositionin classSceneGraphNode- Parameters:
out- Auxiliary vector to put the result in- Returns:
- The vector with the position
-
getAbsolutePosition
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 classSceneGraphNode- 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 Vector3b getPredictedPosition(Vector3b aux, ITimeFrameProvider time, ICamera camera, boolean force)Description copied from class:SceneGraphNodeGets 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 classSceneGraphNode- 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
Description copied from interface:IFocusGets the position in equatorial spherical coordinates- Specified by:
getPosSphin interfaceIFocus- Overrides:
getPosSphin classSceneGraphNode- Returns:
- The position in alpha, delta
-
getDistToCamera
public double getDistToCamera()Description copied from class:SceneGraphNodeReturns the current distance to the camera in internal units.- Specified by:
getDistToCamerain interfaceIFocus- Specified by:
getDistToCamerain interfaceIRenderable- Overrides:
getDistToCamerain classSceneGraphNode- Returns:
- The current distance to the camera, in internal units.
-
getViewAngle
public double getViewAngle()Description copied from class:SceneGraphNodeReturns the current view angle of this entity, in radians.- Specified by:
getViewAnglein interfaceIFocus- Overrides:
getViewAnglein classSceneGraphNode- Returns:
- The view angle in radians.
-
getViewAngleApparent
public double getViewAngleApparent()Description copied from class:SceneGraphNodeReturns the current apparent view angle (view angle corrected with the field of view) of this entity, in radians.- Specified by:
getViewAngleApparentin interfaceIFocus- Overrides:
getViewAngleApparentin classSceneGraphNode- Returns:
- The apparent view angle in radians.
-
getSize
public double getSize()Description copied from class:SceneGraphNodeReturns the size (diameter) of this entity in internal units.- Specified by:
getSizein interfaceIFocus- Overrides:
getSizein classSceneGraphNode- 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- Specified by:
getNamein interfaceIVisibilitySwitch- 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:SceneGraphNodeReturns the radius in internal units- Specified by:
getRadiusin interfaceIFocus- Overrides:
getRadiusin classSceneGraphNode- Returns:
- The radius of the object, in internal units
-
getRotationComponent
Description copied from interface:IFocusReturns the rotation component of this focus- Specified by:
getRotationComponentin interfaceIFocus- Returns:
- The rotation component. Can be null
-
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()Description copied from interface:IFocusGets the color of this object- Specified by:
getColorin interfaceIFocus- Overrides:
getColorin classSceneGraphNode- Returns:
- The color as a RGBA float array
-
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
-
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
Description copied from interface:IFocusPrepares the candidate with the given name -
getCandidateBean
-
getAlpha
public double getAlpha()Description copied from interface:IFocusReturns the right ascension angle of this focus object- Specified by:
getAlphain interfaceIFocus- Overrides:
getAlphain classSceneGraphNode- 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 classSceneGraphNode- Returns:
- The declination angle in degrees
-
getBaseOpacity
protected float getBaseOpacity()- Overrides:
getBaseOpacityin classFadeNode
-
fetchPosition
protected Vector3d fetchPosition(IParticleRecord 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, boolean allVisible)Description copied from class:FadeNodeHighlight using a plain color -
highlight
public void highlight(boolean hl, int cmi, IAttribute cma, double cmmin, double cmmax, boolean allVisible)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() -
shouldRender
protected boolean shouldRender()Overridden because theSceneGraphNode.visibleis not used in particle groups.visibilityArrayis used instead.- Overrides:
shouldRenderin classSceneGraphNode- Returns:
- Whether the particle group should be sent to render
-
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, true if the particle passed the filtering, false otherwise
-
getParticleGroup
public static ParticleGroup getParticleGroup(java.lang.String name, java.util.List<IParticleRecord> 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
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
-
swapBuffers
protected void swapBuffers()
-