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,IFadeObject,IRenderable,IFocus,IStarContainer,IVisibilitySwitch,IPosition
- Direct Known Subclasses:
StarGroup
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 -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Integer[]protected Integer[]protected static final doubleprotected float[]Mapping colorsprotected float[]Mapping colorsfloatNoise factor for the color in [0,1]protected Vector3dprotected StringPath of data filebooleanprotected DoubleFactor to apply to the data points, usually to normalise distancesprotected booleanThis flag indicates whether the mean position is already given by the JSON injectorprotected IParticleRecordReference to the current focusprotected Integer[]protected Integer[]protected Vector3dprotected longStores the time when the last sort operation finished, in msprotected doubleprotected doubleThe mean distance from the origin of all points in this group.protected double[]protected doubledouble[]Particle size limits for the GL_TRIANGLES renderer.double[]Particle size limitsprotected List<IParticleRecord>List that contains the point data.floatProfile decay of the particles in the shaderprotected StringFully qualified name of data provider classprotected ProximityProximity particlesprotected static final doubleprotected static final doubleprotected ParticleGroup.UpdaterTaskprotected booleanprotected byte[]Fields inherited from class gaiasky.scenegraph.FadeNode
catalogInfo, currentDistance, highlighted, hlallvisible, hlc, hlcma, hlcmi, hlcmmax, hlcmmin, hlplain, initialUpdate, inSceneGraph, labelPosition, pointscaling, positionFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFocusableObjects(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] position.voidaddHit(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 ray.protected voidaddToIndex(Map<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.booleanComputes the geometric centre of this data cloudcomputeGeomCentre(boolean forceRecompute) Computes the geometric centre of this data cloudvoidvoiddata()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 indexgenerateIndex(List<IParticleRecord> pointData) Generates the index (maps name to array index) and computes the geometric center of this groupget(int index) floatGets the absolute magnitude.Returns the absolute position of this entity in the native coordinates (equatorial system) and internal unitsgetAbsolutePosition(String name, Vector3b out) Returns the absolute position of the entity identified by name within this entity in the native reference system.doublegetAlpha()Returns the right ascension angle of this focus object.floatGets the apparent magnitude.protected floatlongReturns the id of the focus candidate of this object.intReturns the name of the focus candidate of this object.doubleReturns the candidate apparent view angle (view angle corrected with the field of view) of this entity, in radians.Same asIFocus.getAbsolutePosition(Vector3b).doubleSame asIFocus.getDistToCamera().Same asIFocus.getName().float[]getColor()Gets the color of this object.float[]float[]doublegetDelta()Returns the declination angle of this focus object.protected doubleReturns the delta years to integrate the proper motion.doubleReturns the current distance to the camera in internal units.Gets the first ancestor of this node that is of typeStar.Prepares the candidate with the given name.doubleDefault size if not in data, 1e5 kmlonggetId()Returns the iddoubledoubledoublegetName()Returns the first name of this focus.String[]getNames()Returns all names of this focus.Returns the orientation quaternion of this focus.static ParticleGroupgetParticleGroup(String name, List<IParticleRecord> data, DatasetOptions datasetOptions) Creates a default particle group with some parameters, given the name and data.Gets the position in equatorial spherical coordinates.getPredictedPosition(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.doubleReturns the radius in internal unitsdoublegetRadius(int i) Gets the name of a random particle in this groupReturns the rotation component of this focus.doublegetSize()Returns the size (diameter) of this entity in internal units.doublegetSize(int i) Returns the size of the particle at index iintfloatGets the text opacitydoubleReturns the current view angle of this entity, in radians.doubleReturns the current apparent view angle (view angle corrected with the field of view) of this entity, in radians.booleanChecks whether the focus has the given name.booleanChecks whether the focus has the given name.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 colormapfloatvoidvoidinitialize(boolean dataLoad, boolean createCatalogInfo) protected voidbooleanisActive()Returns whether this focus object is active or not.booleanChecks whether this foucs is within its valid time range, so that it can be used as a focus.booleanisLabel()Is it a label or another kind of text?booleanbooleanisVisible(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 visiblebooleanbooleanbooleanisVisibleGroup(boolean attributeValue) voidHook that runs when the candidate is actually made focus.voidbooleanWhether to add this node to the index.voidEvent notification call.voidRegenerates the name indexprotected voidSpecial actions to be taken for this object when removing from the index.voidrender(ExtSpriteBatch batch, ExtShaderProgram shader, FontRenderSystem sys, RenderingContext rc, ICamera camera) Label renderingbooleanTells whether the text must be rendered or not for this entityvoidsetColorMax(double[] colorMax) voidsetColorMax(float[] colorMax) voidsetColorMin(double[] colorMin) voidsetColorMin(float[] colorMin) voidsetColornoise(Double colorNoise) voidsetData(List<IParticleRecord> pointData) voidsetData(List<IParticleRecord> pointData, boolean regenerateIndex) voidsetDatafile(String datafile) voidvoidsetFocusIndex(int index) voidvoidsetParticlesizelimits(double[] sizeLimits) voidsetPosition(double[] pos) Returns position of focusvoidsetProfiledecay(Double profiledecay) voidsetProvider(String provider) voidsetProviderparams(Map<String, Object> params) voidsetVisible(boolean visible) Overrides the setVisible() method and uses the current focus index, if any.voidsetVisible(boolean visible, String name) voidsetVisible(int index, boolean visible) Sets the visibility of the particle with the given index.voidsetVisibleGroup(boolean visibility) protected booleanOverridden because theSceneGraphNode.visibleis not used in particle groups.intsize()Number of objects of this groupprotected voidtext()Returns the textfloat[]Returns an array with the text colour in the fashion [r, g, b, a]voidExecutes 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) floatReturns 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(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, getPointscaling, initializeCatalogInfo, isHighlighted, isHlAllVisible, isHlplain, setCataloginfo, setCatalogInfo, setCatalogInfoBare, setFadein, setFadeIn, setFadeout, setFadeOut, setLabelposition, setPointscaling, setPosition, 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, getCoordinates, getCt, getDescription, getHeight, getHeight, getHeight, getHeightScale, getLabelcolor, getLineCopy, getLocalizedName, getNext, getNode, getNode, getOctant, getOpacity, getOrientation, getPos, getPosition, getPosition, getRoot, getSceneGraphDepth, getSimpleCopy, getUnrotatedPos, getVelocity, getVisibilityOpacityFactor, hasCt, insert, isCopy, isForceLabel, 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, setForceLabel, setId, setLabelcolor, setLabelcolor, setLabelcolor, setName, setName, setNames, setParent, setPos, toString, updateLocalizedName, updateLocalizedNameRecursiveMethods 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, getLocalizedName, getNext, getOctant, getOrientation, getPos, getSceneGraphDepth, 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
Fully qualified name of data provider class -
datafile
Path of data file -
providerParams
-
profileDecay
public float profileDecayProfile decay of the particles in the shader -
colorNoise
public float colorNoiseNoise factor for the color in [0,1] -
particleSizeLimitsPoint
public double[] particleSizeLimitsPointParticle size limits -
particleSizeLimits
public double[] particleSizeLimitsParticle size limits for the GL_TRIANGLES renderer. This will be multiplied by the distance to the particle in the shader, so thatsize = tan(angle) * dist -
fixedMeanPosition
protected boolean fixedMeanPositionThis flag indicates whether the mean position is already given by the JSON injector -
factor
Factor 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
-
UPDATE_INTERVAL_MS
protected static final double UPDATE_INTERVAL_MS- See Also:
-
UPDATE_INTERVAL_MS_2
protected static final double UPDATE_INTERVAL_MS_2- See Also:
-
metadata
protected double[] metadata -
indices1
-
indices2
-
active
-
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
- Specified by:
setVisiblein interfaceIVisibilitySwitch- Overrides:
setVisiblein classSceneGraphNode
-
isVisible
- Specified by:
isVisiblein interfaceIVisibilitySwitch- Overrides:
isVisiblein classSceneGraphNode
-
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
-
isVisibleGroup
public boolean isVisibleGroup()- Overrides:
isVisibleGroupin classSceneGraphNode
-
isVisibleGroup
public boolean isVisibleGroup(boolean attributeValue) - Overrides:
isVisibleGroupin classSceneGraphNode
-
setVisibleGroup
public void setVisibleGroup(boolean visibility) - Overrides:
setVisibleGroupin classSceneGraphNode
-
regenerateIndex
public void regenerateIndex()Regenerates the name index -
generateIndex
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
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
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:
camera- 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
-
setProvider
-
setDatafile
-
setProviderparams
-
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
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
-
setProfiledecay
-
setColornoise
-
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
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:IFocusSame asIFocus.getAbsolutePosition(Vector3b).- 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- The list of focusable objects to add.
-
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
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
Description copied from interface:IFocusReturns all names of this focus.- Specified by:
getNamesin interfaceIFocus- Overrides:
getNamesin classSceneGraphNode- Returns:
- All names of this focus.
-
hasName
Description copied from interface:IFocusChecks whether the focus has the given name.- Specified by:
hasNamein interfaceIFocus- Overrides:
hasNamein classSceneGraphNode- Parameters:
candidate- The name.- Returns:
- True if there is a match.
-
hasName
Description copied from interface:IFocusChecks whether the focus has the given name.- Specified by:
hasNamein interfaceIFocus- Overrides:
hasNamein classSceneGraphNode- Parameters:
candidate- The name.matchCase- Whether to match the case when comparing.- Returns:
- True if there is a match.
-
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 an 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
Description copied from interface:IObserverEvent notification call. -
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
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:
- The current delta years.
-
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.
-
markForUpdate
public void markForUpdate() -
dispose
public void dispose()- Specified by:
disposein interfacecom.badlogic.gdx.utils.Disposable- Overrides:
disposein classSceneGraphNode
-
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(String name, List<IParticleRecord> data, DatasetOptions datasetOptions) 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 group.data- The data of the particle group.datasetOptions- 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 provider.camera- The camera.
-
updateSorter
-
swapBuffers
protected void swapBuffers()
-