Interface ISceneGraph
-
- All Superinterfaces:
com.badlogic.gdx.utils.Disposable
- All Known Implementing Classes:
AbstractSceneGraph
,SceneGraph
public interface ISceneGraph extends com.badlogic.gdx.utils.Disposable
Defines the interface for any scene graph implementation
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addNodeAuxiliaryInfo(SceneGraphNode node)
Updates the string to node map and the star map if necessary.boolean
containsNode(java.lang.String name)
Whether this scene graphs contains a node with the given nameIFocus
findFocus(java.lang.String name)
com.badlogic.gdx.utils.Array<IFocus>
getFocusableObjects()
SceneGraphNode
getNode(java.lang.String name)
Returns the node with the given name, or null if it does not exist.com.badlogic.gdx.utils.Array<SceneGraphNode>
getNodes()
double[]
getObjectPosition(java.lang.String name, double[] out)
Gets the current position of the object identified by the given name.SceneGraphNode
getRoot()
int
getSize()
com.badlogic.gdx.utils.IntMap<IPosition>
getStarMap()
Gets a star map: HIP -> IPosition It only contains the stars with HIP numbervoid
initialize(com.badlogic.gdx.utils.Array<SceneGraphNode> nodes, ITimeFrameProvider time, boolean hasOctree, boolean hasStarGroup)
Initializes the scene graphvoid
insert(SceneGraphNode node, boolean addToIndex)
Inserts a nodevoid
remove(SceneGraphNode node, boolean removeFromIndex)
Removes a nodevoid
removeNodeAuxiliaryInfo(SceneGraphNode node)
Removes the info of the node from the aux lists.void
update(ITimeFrameProvider time, ICamera camera)
Updates the nodes of this scene graph
-
-
-
Method Detail
-
initialize
void initialize(com.badlogic.gdx.utils.Array<SceneGraphNode> nodes, ITimeFrameProvider time, boolean hasOctree, boolean hasStarGroup)
Initializes the scene graph- Parameters:
nodes
- The list of nodestime
- The time providerhasOctree
- Whether the list of nodes contains an octreehasStarGroup
- Whether the list contains a star vgroup
-
insert
void insert(SceneGraphNode node, boolean addToIndex)
Inserts a node- Parameters:
node
- The node to addaddToIndex
- Whether to add the ids of this node to the index
-
remove
void remove(SceneGraphNode node, boolean removeFromIndex)
Removes a node- Parameters:
node
- The node to removeremoveFromIndex
- Whether to remove the ids of this node from the index
-
update
void update(ITimeFrameProvider time, ICamera camera)
Updates the nodes of this scene graph- Parameters:
time
- The current time providercamera
- The current camera
-
containsNode
boolean containsNode(java.lang.String name)
Whether this scene graphs contains a node with the given name- Parameters:
name
- The name- Returns:
- True if this scene graph contains the node, false otherwise
-
getNode
SceneGraphNode getNode(java.lang.String name)
Returns the node with the given name, or null if it does not exist.- Parameters:
name
- The name of the node.- Returns:
- The node with the name.
-
addNodeAuxiliaryInfo
void addNodeAuxiliaryInfo(SceneGraphNode node)
Updates the string to node map and the star map if necessary.- Parameters:
node
- The node to add
-
removeNodeAuxiliaryInfo
void removeNodeAuxiliaryInfo(SceneGraphNode node)
Removes the info of the node from the aux lists.- Parameters:
node
- The node to remove
-
getStarMap
com.badlogic.gdx.utils.IntMap<IPosition> getStarMap()
Gets a star map: HIP -> IPosition It only contains the stars with HIP number- Returns:
- The HIP star map
-
getNodes
com.badlogic.gdx.utils.Array<SceneGraphNode> getNodes()
-
getRoot
SceneGraphNode getRoot()
-
getFocusableObjects
com.badlogic.gdx.utils.Array<IFocus> getFocusableObjects()
-
findFocus
IFocus findFocus(java.lang.String name)
-
getSize
int getSize()
-
getObjectPosition
double[] getObjectPosition(java.lang.String name, double[] out)
Gets the current position of the object identified by the given name. The given position is in the internal reference system and corrects stars for proper motions and other objects for their specific motions as well.- Parameters:
name
- The name of the objectout
- The out double array- Returns:
- The out double array if the object exists, has a position and out has 3 or more slots. Null otherwise.
-
-