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
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
-
Field Summary
Modifier and TypeFieldDescriptionprotected Integer[]
protected Integer[]
protected static double
protected float[]
Mapping colorsprotected float[]
Mapping colorsfloat
Noise factor for the color in [0,1]int
protected Vector3d
protected String
Path of data fileboolean
protected Double
Factor to apply to the data points, usually to normalise distancesprotected boolean
This flag indicates whether the mean position is already given by the JSON injectorprotected IParticleRecord
Reference to the current focusprotected Integer[]
protected Integer[]
protected Vector3d
protected long
Stores the time when the last sort operation finished, in msprotected double
protected double
The mean distance from the origin of all points in this group.protected double[]
protected double
int
double[]
Particle size limits, in pixelsprotected List<IParticleRecord>
List that contains the point data.float
Profile decay of the particles in the shaderprotected String
Fully qualified name of data provider classprotected Proximity
Proximity particlesprotected static double
protected ParticleGroup.UpdaterTask
protected boolean
protected byte[]
Fields inherited from class gaiasky.scenegraph.FadeNode
catalogInfo, currentDistance, highlighted, hlallvisible, hlc, hlcma, hlcmi, hlcmmax, hlcmmin, hlplain, inSceneGraph, labelcolor, labelPosition
Fields 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addFocusableObjects(com.badlogic.gdx.utils.Array<IFocus> list)
Adds all the children that are focusable objects to the list.void
addHit(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] positionvoid
addHit(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 void
addToIndex(com.badlogic.gdx.utils.ObjectMap<String,SceneGraphNode> map)
Special actions to be taken for this object when adding to the index.protected void
addToRenderLists(ICamera camera)
Adds this entity to the necessary render lists after the distance to the camera and the view angle have been determined.boolean
Computes the geometric centre of this data cloudcomputeGeomCentre(boolean forceRecompute)
Computes the geometric centre of this data cloudvoid
void
data()
Returns the data listvoid
dispose()
void
doneLoading(com.badlogic.gdx.assets.AssetManager manager)
protected Vector3d
fetchPosition(IParticleRecord pb, Vector3d campos, Vector3d destination, double deltaYears)
Fetches the real position of the particle.boolean
filter(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)
float
Gets the absolute magnitudegetAbsolutePosition(Vector3b out)
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 systemdouble
getAlpha()
Returns the right ascension angle of this focus objectfloat
Gets the apparent magnitudeprotected float
long
Returns the id of the focus candidate of this object.int
Returns the name of the focus candidate of this object.double
Returns the candidate apparent view angle (view angle corrected with the field of view) of this entity, in radiansdouble
Same asIFocus.getDistToCamera()
Same asIFocus.getName()
float[]
getColor()
Gets the color of this objectfloat[]
float[]
double
getDelta()
Returns the declination angle of this focus objectprotected double
Returns the delta years to integrate the proper motion.double
Returns 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 namedouble
Default size if not in data, 1e5 kmlong
getId()
Returns the iddouble
double
double
getName()
Returns the first name of this focusString[]
getNames()
Returns all names of this focusReturns the orientation quaternion of this focusstatic ParticleGroup
getParticleGroup(String name, List<IParticleRecord> data, DatasetOptions dops)
Creates a default particle group with some parameters, given the name and dataGets the position in equatorial spherical coordinatesgetPredictedPosition(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.double
Returns the radius in internal unitsdouble
getRadius(int i)
Gets the name of a random particle in this groupReturns the rotation component of this focusdouble
getSize()
Returns the size (diameter) of this entity in internal units.double
getSize(int i)
Returns the size of the particle at index iint
float
Gets the text opacitydouble
Returns the current view angle of this entity, in radians.double
Returns the current apparent view angle (view angle corrected with the field of view) of this entity, in radians.boolean
Checks whether the focus has the given nameboolean
Checks whether the focus has the given namevoid
highlight(boolean hl, float[] color, boolean allVisible)
Highlight using a plain colorvoid
highlight(boolean hl, int cmi, IAttribute cma, double cmmin, double cmmax, boolean allVisible)
Highlight using a colormapfloat
boolean
inGpu()
void
inGpu(boolean inGpu)
void
void
initialize(boolean dataLoad, boolean createCatalogInfo)
protected void
boolean
isActive()
Returns whether this focus object is active or not.boolean
Checks whether this foucs is within its valid time range, so that it can be used as a focusboolean
isLabel()
Is it a label or another kind of text?boolean
boolean
isVisible(boolean attributeValue)
Overrides the isVisible() method, and uses the current focus index, if anyboolean
isVisible(int index)
Checks whether the particle with the given index is visibleboolean
boolean
void
Hook that runs when the candidate is actually made focusboolean
Whether to add this node to the indexvoid
void
Regenerates the name indexprotected void
removeFromIndex(com.badlogic.gdx.utils.ObjectMap<String,SceneGraphNode> map)
Special actions to be taken for this object when removing from the index.void
render(ExtSpriteBatch batch, ExtShaderProgram shader, FontRenderSystem sys, RenderingContext rc, ICamera camera)
Label renderingboolean
Tells whether the text must be rendered or not for this entityvoid
setColorMax(double[] colorMax)
void
setColorMax(float[] colorMax)
void
setColorMin(double[] colorMin)
void
setColorMin(float[] colorMin)
void
setColornoise(Double colorNoise)
void
setData(List<IParticleRecord> pointData)
void
setData(List<IParticleRecord> pointData, boolean regenerateIndex)
void
setDatafile(String datafile)
void
void
setFocusIndex(int index)
void
setInGpu(boolean inGpu)
void
void
setParticlesizelimits(double[] sizeLimits)
void
setPosition(double[] pos)
Returns position of focusvoid
setProfiledecay(Double profiledecay)
void
setProvider(String provider)
void
setVisible(boolean visible)
Overrides the setVisible() method and uses the current focus index, if any.void
setVisible(boolean visible, String name)
void
setVisible(int index, boolean visible)
Sets the visibility of the particle with the given index.void
setVisibleGroup(boolean visibility)
protected boolean
Overridden because theSceneGraphNode.visible
is not used in particle groups.int
size()
Number of objects of this groupprotected void
text()
Returns the textfloat[]
Returns an array with the text colour in the fashion [r, g, b, a]void
Executes the blending for the textvoid
textPosition(ICamera cam, Vector3d out)
Sets the position of this text in the out vectorvoid
textPosition(ICamera cam, Vector3d out, double len, double rad)
float
Returns the text scale for the scale varying in the shaderfloat
textSize()
Returns the text sizevoid
update(ITimeFrameProvider time, Vector3b parentTransform, ICamera camera)
void
update(ITimeFrameProvider time, Vector3b parentTransform, ICamera camera, float opacity)
void
updateFocus(ICamera camera)
Updates the parameters of the focus, if the focus is active in this groupvoid
updateLocalValues(ITimeFrameProvider time, ICamera camera)
This function updates all the local values before the localTransform is updated.void
updateMetadata(ITimeFrameProvider time, ICamera camera)
Updates the metadata information, to use for sorting.void
updateSorter(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, updateOpacity
Methods 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, 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, 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, isCopy
Methods 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 -
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
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:
- Constant Field Values
-
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:
initialize
in 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:
doneLoading
in 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:
isVisible
in interfaceIVisibilitySwitch
- Overrides:
isVisible
in classSceneGraphNode
-
isVisible
public boolean isVisible(boolean attributeValue)Overrides the isVisible() method, and uses the current focus index, if any- Specified by:
isVisible
in interfaceIVisibilitySwitch
- Overrides:
isVisible
in 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:
setVisible
in interfaceIVisibilitySwitch
- Overrides:
setVisible
in classSceneGraphNode
-
isVisible
- Specified by:
isVisible
in interfaceIVisibilitySwitch
- Overrides:
isVisible
in classSceneGraphNode
-
setVisible
public void setVisible(boolean visible)Overrides the setVisible() method and uses the current focus index, if any.- Specified by:
setVisible
in interfaceIVisibilitySwitch
- Overrides:
setVisible
in classSceneGraphNode
- Parameters:
visible
- The visibility state
-
isVisibleGroup
public boolean isVisibleGroup()- Overrides:
isVisibleGroup
in classSceneGraphNode
-
setVisibleGroup
public void setVisibleGroup(boolean visibility)- Overrides:
setVisibleGroup
in 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:SceneGraphNode
Special actions to be taken for this object when adding to the index.- Overrides:
addToIndex
in classSceneGraphNode
- Parameters:
map
- The index
-
removeFromIndex
Description copied from class:SceneGraphNode
Special actions to be taken for this object when removing from the index. Must implement if addToIndex is implemented- Overrides:
removeFromIndex
in 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:
update
in 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:SceneGraphNode
Adds this entity to the necessary render lists after the distance to the camera and the view angle have been determined.- Overrides:
addToRenderLists
in classFadeNode
-
render
public void render(ExtSpriteBatch batch, ExtShaderProgram shader, FontRenderSystem sys, RenderingContext rc, ICamera camera)Label rendering- Specified by:
render
in 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:I3DTextRenderable
Returns the text scale for the scale varying in the shader- Specified by:
textScale
in interfaceI3DTextRenderable
- Returns:
- The scale
-
getProvider
-
setProvider
-
setDatafile
-
updateLocalValues
Description copied from class:SceneGraphNode
This function updates all the local values before the localTransform is updated. Position, rotations and scale must be updated in here.- Overrides:
updateLocalValues
in classFadeNode
-
renderText
public boolean renderText()Description copied from interface:I3DTextRenderable
Tells whether the text must be rendered or not for this entity- Specified by:
renderText
in interfaceI3DTextRenderable
- Returns:
- True if text must be rendered
-
textColour
public float[] textColour()Description copied from interface:I3DTextRenderable
Returns an array with the text colour in the fashion [r, g, b, a]- Specified by:
textColour
in interfaceI3DTextRenderable
- Returns:
- Array with the colour
-
textSize
public float textSize()Description copied from interface:I3DTextRenderable
Returns the text size- Specified by:
textSize
in interfaceI3DTextRenderable
- Returns:
- The text size
-
textPosition
Description copied from interface:I3DTextRenderable
Sets the position of this text in the out vector- Specified by:
textPosition
in interfaceI3DTextRenderable
out
- The out parameter with the result
-
text
Description copied from interface:I3DTextRenderable
Returns the text- Specified by:
text
in interfaceI3DTextRenderable
- Returns:
- The text
-
textDepthBuffer
public void textDepthBuffer()Description copied from interface:I3DTextRenderable
Executes the blending for the text- Specified by:
textDepthBuffer
in interfaceI3DTextRenderable
-
isLabel
public boolean isLabel()Description copied from interface:I3DTextRenderable
Is it a label or another kind of text?- Specified by:
isLabel
in 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:
getId
in interfaceIFocus
- Overrides:
getId
in classSceneGraphNode
- Returns:
- The id
-
getClosestName
Description copied from interface:IFocus
Same asIFocus.getName()
- Specified by:
getClosestName
in interfaceIFocus
- Returns:
- The name
-
getClosestDistToCamera
public double getClosestDistToCamera()Description copied from interface:IFocus
Same asIFocus.getDistToCamera()
- Specified by:
getClosestDistToCamera
in interfaceIFocus
- Returns:
- The distance to the camera in internal units
-
getClosestAbsolutePos
Description copied from interface:IFocus
- Specified by:
getClosestAbsolutePos
in interfaceIFocus
- Parameters:
out
- Vector3d where to put the return value- Returns:
- The absolute position, same as aux
-
getStarCount
public int getStarCount()- Specified by:
getStarCount
in interfaceIStarContainer
- Overrides:
getStarCount
in classSceneGraphNode
-
isActive
public boolean isActive()Description copied from interface:IFocus
Returns whether this focus object is active or not. Useful for particle groups -
setPosition
public void setPosition(double[] pos)Returns position of focus- Overrides:
setPosition
in classFadeNode
-
addFocusableObjects
Adds all the children that are focusable objects to the list.- Overrides:
addFocusableObjects
in classSceneGraphNode
- Parameters:
list
-
-
getComputedAncestor
-
getFirstStarAncestor
Description copied from class:SceneGraphNode
Gets the first ancestor of this node that is of typeStar
- Specified by:
getFirstStarAncestor
in interfaceIFocus
- Overrides:
getFirstStarAncestor
in classSceneGraphNode
- Returns:
- The first ancestor of type
Star
-
getAbsolutePosition
Description copied from class:SceneGraphNode
Returns the absolute position of this entity in the native coordinates (equatorial system) and internal units- Specified by:
getAbsolutePosition
in interfaceIFocus
- Overrides:
getAbsolutePosition
in classSceneGraphNode
- Parameters:
out
- Auxiliary vector to put the result in- Returns:
- The vector with the position
-
getAbsolutePosition
Description copied from interface:IFocus
Returns the absolute position of the entity identified by name within this entity in the native reference system- Specified by:
getAbsolutePosition
in interfaceIFocus
- Overrides:
getAbsolutePosition
in 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:SceneGraphNode
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.- Specified by:
getPredictedPosition
in interfaceIFocus
- Overrides:
getPredictedPosition
in 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:IFocus
Gets the position in equatorial spherical coordinates- Specified by:
getPosSph
in interfaceIFocus
- Overrides:
getPosSph
in classSceneGraphNode
- Returns:
- The position in alpha, delta
-
getDistToCamera
public double getDistToCamera()Description copied from class:SceneGraphNode
Returns the current distance to the camera in internal units.- Specified by:
getDistToCamera
in interfaceIFocus
- Specified by:
getDistToCamera
in interfaceIRenderable
- Overrides:
getDistToCamera
in classSceneGraphNode
- Returns:
- The current distance to the camera, in internal units.
-
getViewAngle
public double getViewAngle()Description copied from class:SceneGraphNode
Returns the current view angle of this entity, in radians.- Specified by:
getViewAngle
in interfaceIFocus
- Overrides:
getViewAngle
in classSceneGraphNode
- Returns:
- The view angle in radians.
-
getViewAngleApparent
public double getViewAngleApparent()Description copied from class:SceneGraphNode
Returns the current apparent view angle (view angle corrected with the field of view) of this entity, in radians.- Specified by:
getViewAngleApparent
in interfaceIFocus
- Overrides:
getViewAngleApparent
in classSceneGraphNode
- Returns:
- The apparent view angle in radians.
-
getSize
public double getSize()Description copied from class:SceneGraphNode
Returns the size (diameter) of this entity in internal units.- Specified by:
getSize
in interfaceIFocus
- Overrides:
getSize
in classSceneGraphNode
- Returns:
- The size in internal units.
-
getAppmag
public float getAppmag()Description copied from interface:IFocus
Gets the apparent magnitude -
getAbsmag
public float getAbsmag()Description copied from interface:IFocus
Gets the absolute magnitude -
getName
Description copied from interface:IFocus
Returns the first name of this focus- Specified by:
getName
in interfaceIFocus
- Specified by:
getName
in interfaceIVisibilitySwitch
- Overrides:
getName
in classSceneGraphNode
- Returns:
- The first name
-
getNames
Description copied from interface:IFocus
Returns all names of this focus- Specified by:
getNames
in interfaceIFocus
- Overrides:
getNames
in classSceneGraphNode
- Returns:
- All names of this focus
-
hasName
Description copied from interface:IFocus
Checks whether the focus has the given name- Specified by:
hasName
in interfaceIFocus
- Overrides:
hasName
in classSceneGraphNode
- Parameters:
candidate
- The name- Returns:
- True if there is a match
-
hasName
Description copied from interface:IFocus
Checks whether the focus has the given name- Specified by:
hasName
in interfaceIFocus
- Overrides:
hasName
in classSceneGraphNode
- Parameters:
candidate
- The namematchCase
- 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:SceneGraphNode
Returns the radius in internal units- Specified by:
getRadius
in interfaceIFocus
- Overrides:
getRadius
in classSceneGraphNode
- Returns:
- The radius of the object, in internal units
-
getRotationComponent
Description copied from interface:IFocus
Returns the rotation component of this focus- Specified by:
getRotationComponent
in interfaceIFocus
- Returns:
- The rotation component. Can be null
-
getOrientationQuaternion
Description copied from interface:IFocus
Returns the orientation quaternion of this focus- Specified by:
getOrientationQuaternion
in interfaceIFocus
- Returns:
- The orientation quaternion. Can be null
-
getColor
public float[] getColor()Description copied from interface:IFocus
Gets the color of this object- Specified by:
getColor
in interfaceIFocus
- Overrides:
getColor
in 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:IFocus
Adds 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:IFocus
Adds 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:IFocus
Hook that runs when the candidate is actually made focus -
getCandidateIndex
public int getCandidateIndex() -
getCandidateId
public long getCandidateId()Description copied from interface:IFocus
Returns the id of the focus candidate of this object. Defaults toIFocus.getId()
- Specified by:
getCandidateId
in interfaceIFocus
- Returns:
- The id of the candidate
-
getCandidateName
Description copied from interface:IFocus
Returns the name of the focus candidate of this object. Defaults toIFocus.getName()
- Specified by:
getCandidateName
in interfaceIFocus
- Returns:
- The name of the candidate
-
getCandidateViewAngleApparent
public double getCandidateViewAngleApparent()Description copied from interface:IFocus
Returns the candidate apparent view angle (view angle corrected with the field of view) of this entity, in radians- Specified by:
getCandidateViewAngleApparent
in interfaceIFocus
- Returns:
- The apparent view angle in radians
-
getFocus
Description copied from interface:IFocus
Prepares the candidate with the given name -
getCandidateBean
-
getAlpha
public double getAlpha()Description copied from interface:IFocus
Returns the right ascension angle of this focus object- Specified by:
getAlpha
in interfaceIFocus
- Overrides:
getAlpha
in classSceneGraphNode
- Returns:
- The right ascension angle in degrees
-
getDelta
public double getDelta()Description copied from interface:IFocus
Returns the declination angle of this focus object- Specified by:
getDelta
in interfaceIFocus
- Overrides:
getDelta
in classSceneGraphNode
- Returns:
- The declination angle in degrees
-
getBaseOpacity
protected float getBaseOpacity()- Overrides:
getBaseOpacity
in 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:IFocus
Checks whether this foucs is within its valid time range, so that it can be used as a focus- Specified by:
isCoordinatesTimeOverflow
in interfaceIFocus
- Returns:
- Whether the focus object is within its valid time range
-
canSelect
public boolean canSelect() -
mustAddToIndex
public boolean mustAddToIndex()Description copied from class:SceneGraphNode
Whether to add this node to the index- Overrides:
mustAddToIndex
in classSceneGraphNode
- Returns:
- True if the node needs to be added to the index.
-
dispose
public void dispose()- Specified by:
dispose
in interfacecom.badlogic.gdx.utils.Disposable
- Overrides:
dispose
in 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:I3DTextRenderable
Gets the text opacity- Specified by:
getTextOpacity
in interfaceI3DTextRenderable
- Returns:
- Text opacity
-
highlight
public void highlight(boolean hl, float[] color, boolean allVisible)Description copied from class:FadeNode
Highlight using a plain color -
highlight
public void highlight(boolean hl, int cmi, IAttribute cma, double cmmin, double cmmax, boolean allVisible)Description copied from class:FadeNode
Highlight 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.visible
is not used in particle groups.visibilityArray
is used instead.- Overrides:
shouldRender
in 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 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()
-