Class SceneModule
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSceneModule
(EventManager em, APIv2 api, String name) Create a new module with the given attributes. -
Method Summary
Modifier and TypeMethodDescriptionvoid
add_polyline
(String name, double[] points, double[] color) Add a new polyline with the given name, points and color.void
add_polyline
(String name, double[] points, double[] color, double width) Add a new polyline with the given name, points, color and line width.void
add_polyline
(String name, double[] points, double[] color, double width, boolean caps) Add a new polyline with the given name, points, color and line width.void
add_polyline
(String name, double[] points, double[] color, double width, int primitive) Add a new polyline with the given name, points, color, line width and primitive.void
add_polyline
(String name, double[] points, double[] color, double width, int primitive, boolean caps) Add a new polyline with the given name, points, color, line width, primitive and arrow caps.void
add_polyline
(String name, double[] points, double[] color, int lineWidth) void
add_polyline
(String name, double[] points, double[] color, int lineWidth, int primitive) void
add_polyline
(String name, List<?> points, List<?> color) void
add_polyline
(String name, List<?> points, List<?> color, float lineWidth) void
add_polyline
(String name, List<?> points, List<?> color, float lineWidth, boolean arrowCaps) void
add_polyline
(String name, List<?> points, List<?> color, float lineWidth, int primitive) void
add_polyline
(String name, List<?> points, List<?> color, float lineWidth, int primitive, boolean arrowCaps) void
add_polyline
(String name, List<?> points, List<?> color, int lineWidth) void
add_polyline
(String name, List<?> points, List<?> color, int lineWidth, boolean arrowCaps) void
add_polyline
(String name, List<?> points, List<?> color, int lineWidth, int primitive) void
add_polyline
(String name, List<?> points, List<?> color, int lineWidth, int primitive, boolean arrowCaps) void
add_shape_around_object
(String name, String shapeType, String primitive, double size, String obj_name, float r, float g, float b, float a, boolean label, boolean track) Add a shape object of the given type with the given size around the object with the given name and primitive.void
add_shape_around_object
(String name, String shapeType, String primitive, String ori, double size, String obj_name, float r, float g, float b, float a, boolean label, boolean track) Add a shape object of the given type with the given size around the object with the given name, primitive and orientation.void
add_trajectory_line
(String name, double[] points, double[] color) Add a new trajectory object with the given name, points and color.void
add_trajectory_line
(String name, double[] points, double[] color, double trail) Add a new trajectory object with the given name, points and color.void
add_trajectory_line
(String name, List<?> points, List<?> color) void
add_trajectory_line
(String name, List<?> points, List<?> color, double trailMap) void
Clears all label-filtering regular expressions currently in use, set withSceneAPI.set_label_exclude_regexp(String)
orSceneAPI.set_label_include_regexp(String)
, if any.void
Forcefully trigger an update of the internal scene graph, and the positions of all the objects.boolean
Get the visibility of the component type described by the key.com.badlogic.ashley.core.Entity
get_entity
(String name) Get the reference to an entity given its name.com.badlogic.ashley.core.Entity
get_entity
(String name, double timeout) Get the reference to an entity given its name and a timeout in seconds.com.badlogic.ashley.core.Entity
Get a focus object from the scene given its name.com.badlogic.ashley.core.Entity
get_focus_entity
(String name) Alias toget_focus(String)
.boolean
Gets the value of the force display label flag for the object identified by the givenname
.get_line_object
(String name) Get the line object identified by the givenname
.get_line_object
(String name, double timeout) Get the line object identified by the givenname
.get_object
(String name) Get an object from the scene graph byname
or id (HIP, TYC, Gaia SourceId).get_object
(String name, double timeout) Get an object byname
or id (HIP, TYC, Gaia SourceID), optionally waiting until the object is available, with a timeout.double[]
get_object_position
(String name) Get the current position of the object identified byname
in the internal coordinate system and internal units.double[]
get_object_position
(String name, String units) Get the current position of the object identified byname
in the internal coordinate system and the requested distance units.double[]
Get the predicted position of the object identified byname
in the internal coordinate system and internal units.double[]
get_object_predicted_position
(String name, String units) Get the predicted position of the object identified byname
in the internal coordinate system and the requested distance units.double
get_object_radius
(String name) Get the internal radius of the object identified by the givenname
, in km.double[]
Project the world space position of the object identified by the givenname
to screen coordinates.boolean
get_object_visibility
(String name) Get the visibility of a particular object.double[]
get_star_parameters
(String name) Return the star parameters given its identifier or name, if the star exists and it is loaded.long
Return the current maximum number of velocity vectors per star group.void
Event notification call.void
Force all orbits to refresh immediately.void
refresh_object_orbit
(String name) Force the refresh of the orbit of the object identified byname
.void
remove_object
(String name) Remove the model object identified by the given name from the internal scene graph model of Gaia Sky, if it exists.void
Remove the current coordinates provider from the object with the given name.void
set_component_type_visibility
(String key, boolean visible) Sets the component described by the given name visible or invisible.void
set_force_display_label
(String name, boolean force) Force the label of the object identified byname
to be displayed, ignoring the usual solid angle-based visibility rules.void
set_label_color
(String name, double[] color) Set the label color of the object identified by the givenname
.void
set_label_color
(String name, List<?> color) void
set_label_exclude_regexp
(String regexp) Set the global exclude regular expression for filtering labels.void
set_label_include_regexp
(String regexp) Set the global include regular expression for filtering labels.void
set_label_size_factor
(float factor) Set the global label size factor.void
set_label_size_factor
(int factor) void
set_line_width_factor
(float factor) Set the global line width factor.void
set_line_width_factor
(int factor) void
set_mute_label
(String name, boolean mute) Mute the label of the object identified byname
, ignoring the usual solid angle-based visibility rules.void
set_object_coordinates_provider
(String name, IPythonCoordinatesProvider provider) Set the coordinates provider for the object identified with the given name, if possible.void
set_object_posiiton
(com.badlogic.ashley.core.Entity object, double[] pos) Set the internal position of the given entity object.void
set_object_posiiton
(com.badlogic.ashley.core.Entity object, double[] pos, String units) Set the internal position of the given entity object.void
set_object_posiiton
(com.badlogic.ashley.core.Entity object, List<?> position) void
set_object_posiiton
(FocusView object, double[] pos) Set the internal position of the given entity object.void
set_object_posiiton
(FocusView object, double[] pos, String units) Set the internal position of the given entity object.void
set_object_posiiton
(FocusView object, List<?> position) void
set_object_posiiton
(FocusView object, List<?> position, String units) void
set_object_posiiton
(String name, double[] pos) Set the internal position of the object identified byname
.void
set_object_posiiton
(String name, double[] pos, String units) Set the internal position of the object identified byname
.void
set_object_posiiton
(String name, List<?> position) void
set_object_posiiton
(String name, List<?> position, String units) boolean
set_object_quaternion_nlerp_orientation
(String name, String path) Set the given quaternions file (CSV with times and quaternions) as the orientation provider for this object.boolean
set_object_quaternion_slerp_orientation
(String name, String path) Set the given quaternions file (CSV with times and quaternions) as the orientation provider for this object.void
set_object_size_scaling
(com.badlogic.ashley.core.Entity object, double scalingFactor) Version ofset_object_size_scaling(String, double)
but getting anEntity
reference instead of a name.void
set_object_size_scaling
(String name, double factor) Set the given size scaling factor to the object identified byname
.boolean
set_object_visibility
(String name, boolean visible) Set the visibility of a particular object.void
set_orbit_coordinates_scaling
(String name, double factor) Set the given orbit coordinates scaling factor to the orbit object identified byname
.void
set_unfiltered_velocity_vectors_number_factor
(float factor) Unfiltered version ofset_velocity_vectors_number_factor(float)
.void
set_velocity_vector_max_number
(long num) Set the maximum number of proper motion vectors to add per star group.void
set_velocity_vectors_arrowheads
(boolean enabled) Specify whether arrowheads should be displayed on velocity vectors.void
set_velocity_vectors_color_mode
(int mode) Set the color mode of the velocity vectors (proper motions).void
set_velocity_vectors_length_factor
(float factor) Set the length factor of the velocity vectors (proper motions), in [500,30000].void
set_velocity_vectors_length_factor
(int factor) void
set_velocity_vectors_number_factor
(float factor) Set the number factor of the velocity vectors (proper motions) that are visible.void
set_velocity_vectors_number_factor
(int factor)
-
Field Details
-
scene
-
-
Constructor Details
-
SceneModule
Create a new module with the given attributes.- Parameters:
api
- Reference to the API class.name
- Name of the module.
-
-
Method Details
-
get_object
Description copied from interface:SceneAPI
Get an object from the scene graph byname
or id (HIP, TYC, Gaia SourceId).- Specified by:
get_object
in interfaceSceneAPI
- Parameters:
name
- The name or id (HIP, TYC, Gaia SourceId) of the object.- Returns:
- The object as a
FocusView
, or null if it does not exist.
-
get_object
Description copied from interface:SceneAPI
Get an object byname
or id (HIP, TYC, Gaia SourceID), optionally waiting until the object is available, with a timeout.- Specified by:
get_object
in interfaceSceneAPI
- Parameters:
name
- The name or id (HIP, TYC, Gaia SourceId) of the object.timeout
- The timeout in seconds to wait until returning. If negative, it waits indefinitely.- Returns:
- The object if it exists, or null if it does not and block is false, or if block is true and the timeout has passed.
-
get_line_object
Description copied from interface:SceneAPI
Get the line object identified by the givenname
. The returned line object is of typeVerts
.Verts
represents objects that are rendered as primitives. Typically, they are either lines or points.- Specified by:
get_line_object
in interfaceSceneAPI
- Parameters:
name
- The name of the line object.- Returns:
- The line object as a
VertsView
instance, or null if it does not exist.
-
get_line_object
Description copied from interface:SceneAPI
Get the line object identified by the givenname
. The returned line object is of typeVerts
.Verts
represents objects that are rendered as primitives. Typically, they are either lines or points.Sometimes, adding objects to the internal scene graph incurs in a delay of a few frames. If one calls a method to add a line object, and then immediately calls this method, it may be that the object is still not available in the internal scene graph. That is why this version includes a timeout time, which is the maximum time that this method will wait for the object to become available. If the object becomes available before the timeout has passed, ti is returned. Otherwise, this call returns null.
- Specified by:
get_line_object
in interfaceSceneAPI
- Parameters:
name
- The name of the line object.timeout
- The timeout, in seconds, to wait for the object to be ready. If negative, it waits indefinitely.- Returns:
- The line object as a
VertsView
, or null if it does not exist.
-
get_entity
Description copied from interface:SceneAPI
Get the reference to an entity given its name.- Specified by:
get_entity
in interfaceSceneAPI
- Parameters:
name
- Entity name.
-
get_entity
Description copied from interface:SceneAPI
Get the reference to an entity given its name and a timeout in seconds. If the entity is not in the scene after the timeout has passed, ths method returns null.- Specified by:
get_entity
in interfaceSceneAPI
- Parameters:
name
- Entity name.timeout
- Timeout time, in seconds.
-
get_focus
Description copied from interface:SceneAPI
Get a focus object from the scene given its name. -
get_focus_entity
Alias toget_focus(String)
. -
get_star_parameters
Description copied from interface:SceneAPI
Return the star parameters given its identifier or name, if the star exists and it is loaded.- Specified by:
get_star_parameters
in interfaceSceneAPI
- Parameters:
name
- The star identifier or name.- Returns:
- An array with (ra [deg], dec [deg], parallax [mas], pmra [mas/yr], pmdec [mas/yr], radvel [km/s], appmag [mag], red [0,1], green [0,1], blue [0,1]) if the star exists and is loaded, null otherwise.
-
get_object_position
Description copied from interface:SceneAPI
Get the current position of the object identified byname
in the internal coordinate system and internal units. If the object does not exist, it returns null.- Specified by:
get_object_position
in interfaceSceneAPI
- Parameters:
name
- The name or id (HIP, TYC, sourceId) of the object.- Returns:
- A 3-vector with the object's position in internal units and the internal reference system.
-
get_object_position
Description copied from interface:SceneAPI
Get the current position of the object identified byname
in the internal coordinate system and the requested distance units. If the object does not exist, it returns null.- Specified by:
get_object_position
in interfaceSceneAPI
- Parameters:
name
- The name or id (HIP, TYC, sourceId) of the object.units
- The distance units to use. One of "m", "km", "au", "ly", "pc", "internal".- Returns:
- A 3-vector with the object's position in the requested units and internal reference system.
-
get_object_predicted_position
Description copied from interface:SceneAPI
Get the predicted position of the object identified byname
in the internal coordinate system and internal units. If the object does not exist, it returns null.The predicted position is the position of the object in the next update cycle, and may be useful to compute the camera state.
- Specified by:
get_object_predicted_position
in interfaceSceneAPI
- Parameters:
name
- The name or id (HIP, TYC, sourceId) of the object.- Returns:
- A 3-vector with the object's predicted position in the internal reference system.
-
get_object_predicted_position
Description copied from interface:SceneAPI
Get the predicted position of the object identified byname
in the internal coordinate system and the requested distance units. If the object does not exist, it returns null.The predicted position is the position of the object in the next update cycle, and may be useful to compute the camera state.
- Specified by:
get_object_predicted_position
in interfaceSceneAPI
- Parameters:
name
- The name or id (HIP, TYC, sourceId) of the object.units
- The distance units to use. One of "m", "km", "au", "ly", "pc", "internal".- Returns:
- A 3-vector with the object's predicted position in the requested units and in the internal reference system.
-
set_object_posiiton
Description copied from interface:SceneAPI
Set the internal position of the object identified byname
. Note that depending on the object type, the position may be already calculated and set elsewhere in the update stage, so use with care.- Specified by:
set_object_posiiton
in interfaceSceneAPI
- Parameters:
name
- The name of the object.pos
- The position in the internal reference system and internal units.
-
set_object_posiiton
Description copied from interface:SceneAPI
Set the internal position of the object identified byname
. Note that depending on the object type, the position may be already calculated and set elsewhere in the update stage, so use with care.- Specified by:
set_object_posiiton
in interfaceSceneAPI
- Parameters:
name
- The name of the object.pos
- The position in the internal reference system and the given units.units
- The distance units to use. One of "m", "km", "au", "ly", "pc", "internal".
-
set_object_posiiton
-
set_object_posiiton
-
set_object_posiiton
Description copied from interface:SceneAPI
Set the internal position of the given entity object. Note that depending on the object type, the position may be already calculated and set elsewhere in the update stage, so use with care.- Specified by:
set_object_posiiton
in interfaceSceneAPI
- Parameters:
object
- The object in a focus view wrapper.pos
- The position in the internal reference system and internal units.
-
set_object_posiiton
Description copied from interface:SceneAPI
Set the internal position of the given entity object. Note that depending on the object type, the position may be already calculated and set elsewhere in the update stage, so use with care.- Specified by:
set_object_posiiton
in interfaceSceneAPI
- Parameters:
object
- The object in a focus view wrapper.pos
- The position in the internal reference system and the given units.units
- The distance units to use. One of "m", "km", "au", "ly", "pc", "internal".
-
set_object_posiiton
-
set_object_posiiton
-
set_object_posiiton
public void set_object_posiiton(com.badlogic.ashley.core.Entity object, double[] pos) Description copied from interface:SceneAPI
Set the internal position of the given entity object. Note that depending on the object type, the position may be already calculated and set elsewhere in the update stage, so use with care.- Specified by:
set_object_posiiton
in interfaceSceneAPI
- Parameters:
object
- The object entity.pos
- The position in the internal reference system and internal units.
-
set_object_posiiton
Description copied from interface:SceneAPI
Set the internal position of the given entity object. Note that depending on the object type, the position may be already calculated and set elsewhere in the update stage, so use with care.- Specified by:
set_object_posiiton
in interfaceSceneAPI
- Parameters:
object
- The object entity.pos
- The position in the internal reference system and the given units.units
- The distance units to use. One of "m", "km", "au", "ly", "pc", "internal".
-
set_object_coordinates_provider
Description copied from interface:SceneAPI
Set the coordinates provider for the object identified with the given name, if possible. The provider object must implementIPythonCoordinatesProvider
, and in particular the methodIPythonCoordinatesProvider.getEquatorialCartesianCoordinates(Object, Object)
, which takes in a julian date and outputs the object coordinates in the internal cartesian system.- Specified by:
set_object_coordinates_provider
in interfaceSceneAPI
- Parameters:
name
- The name of the object.provider
- The coordinate provider instance.
-
remove_object_coordinates_provider
Description copied from interface:SceneAPI
Remove the current coordinates provider from the object with the given name. This method must be called before shutting down the gateway if the coordinates provider has been previously set for the given object from Python withSceneAPI.set_object_coordinates_provider(String, IPythonCoordinatesProvider)
. Otherwise, Gaia Sky will crash due to the missing connection to Python.- Specified by:
remove_object_coordinates_provider
in interfaceSceneAPI
- Parameters:
name
- The name of the object for which to remove the coordinate provider.
-
set_object_posiiton
-
set_component_type_visibility
Description copied from interface:SceneAPI
Sets the component described by the given name visible or invisible.The possible keys are listed below. They are passed in as a string:
-
element.stars
-
element.planets
-
element.moons
-
element.satellites
-
element.asteroids
-
element.clusters
-
element.milkyway
-
element.galaxies
-
element.nebulae
-
element.meshes
-
element.systems
-
element.labels
-
element.orbits
-
element.locations
-
element.countries
-
element.ruler
-
element.equatorial
-
element.ecliptic
-
element.galactic
-
element.recursivegrid
-
element.constellatios
-
element.boundaries
-
element.atmospheres
-
element.clouds
-
element.effects
-
element.axes
-
element.velocityvectors
-
element.keyframes
-
element.others
- Specified by:
set_component_type_visibility
in interfaceSceneAPI
- Parameters:
key
- The key of the component, as a string.ComponentTypes.ComponentType
.visible
- The visible value.
-
-
get_component_type_visibility
Description copied from interface:SceneAPI
Get the visibility of the component type described by the key. The possible keys are listed below. They are passed in as a string:-
element.stars
-
element.planets
-
element.moons
-
element.satellites
-
element.asteroids
-
element.clusters
-
element.milkyway
-
element.galaxies
-
element.nebulae
-
element.meshes
-
element.systems
-
element.labels
-
element.orbits
-
element.locations
-
element.countries
-
element.ruler
-
element.equatorial
-
element.ecliptic
-
element.galactic
-
element.recursivegrid
-
element.constellatios
-
element.boundaries
-
element.atmospheres
-
element.clouds
-
element.effects
-
element.axes
-
element.velocityvectors
-
element.keyframes
-
element.others
See
ComponentTypes.ComponentType
for more information.- Specified by:
get_component_type_visibility
in interfaceSceneAPI
- Parameters:
key
- The key of the component type to query.- Returns:
- The visibility of the component type.
-
-
get_object_screen_coordinates
Description copied from interface:SceneAPI
Project the world space position of the object identified by the givenname
to screen coordinates. It's the same as GLU'sgluProject()
with one small deviation: The viewport is assumed to span the whole screen. The screen coordinate system has its origin in the bottom left, with the y-axis pointing upwards and the x-axis pointing to the right. This makes it easily usable in conjunction with Batch and similar classes.This call only works if Gaia Sky is using the simple perspective projection mode. It does not work with any of the following modes:
- Panorama mode (all projections)
- Planetarium mode
- Orthosphere mode
- Stereoscopic (3D) mode
- Re-projection mode (all re-projection shaders)
- Specified by:
get_object_screen_coordinates
in interfaceSceneAPI
- Parameters:
name
- The name of the object to get the screen coordinates for.- Returns:
- An array with the x and y screen coordinates, in pixels, with the origin at the bottom-left. If the object with the given name does not exist, or it falls off-screen, it returns null.
-
set_object_visibility
Description copied from interface:SceneAPI
Set the visibility of a particular object. Use this method to hide individual objects. Changes to the individual object visibility are not persisted on restart.- Specified by:
set_object_visibility
in interfaceSceneAPI
- Parameters:
name
- The name of the object. Must be an instance ofIVisibilitySwitch
.visible
- The visible status to set. Set to false in order to hide the object. True to make it visible.- Returns:
- True if the visibility was set successfully, false if there were errors.
-
get_object_visibility
Description copied from interface:SceneAPI
Get the visibility of a particular object.- Specified by:
get_object_visibility
in interfaceSceneAPI
- Parameters:
name
- The name of the object. Must be an instance ofIVisibilitySwitch
.- Returns:
- The visibility status of the object, if it exists.
-
set_object_size_scaling
Description copied from interface:SceneAPI
Set the given size scaling factor to the object identified byname
. This method will only work with model objects such as planets, asteroids, satellites, etc. It will not work with orbits, stars or any other object types.Also, use this with caution, as scaling the size of objects can have unintended side effects, and remember to set the scaling back to 1.0 at the end of your script.
- Specified by:
set_object_size_scaling
in interfaceSceneAPI
- Parameters:
name
- The name or id of the object.factor
- The scaling factor to scale the size of that object.
-
set_object_size_scaling
public void set_object_size_scaling(com.badlogic.ashley.core.Entity object, double scalingFactor) Version ofset_object_size_scaling(String, double)
but getting anEntity
reference instead of a name.- Parameters:
object
- TheEntity
.scalingFactor
- The scaling factor.
-
set_orbit_coordinates_scaling
Description copied from interface:SceneAPI
Set the given orbit coordinates scaling factor to the orbit object identified byname
. The object must be attached to an orbit that extendsAbstractOrbitCoordinates
.For more information, check out
AbstractOrbitCoordinates
and its subclasses.Also, use this with caution, as scaling coordinates may have unintended side effects, and remember to set the scaling back to 1.0 at the end of your script. Additionally, use either
SceneAPI.refresh_all_orbits()
orSceneAPI.refresh_object_orbit(String)
right after this call in order to immediately refresh the scaled orbits.- Specified by:
set_orbit_coordinates_scaling
in interfaceSceneAPI
- Parameters:
name
- The name of the coordinates object (OrbitLintCoordinates, EclipticCoordinates, SaturnVSOP87, UranusVSOP87, EarthVSOP87, MercuryVSOP87, ..., PlutoCoordinates, HeliotropicOrbitCoordinates, MoonAACoordinates). Optionally, you can append ':objectName' to select a single object. For instance, both Gaia and JWST have heliotropic orbit coordinates. To only select the Gaia orbit provider, use "HeliotropicOrbitCoordinates:Gaia".factor
- The scaling factor.
-
refresh_all_orbits
public void refresh_all_orbits()Description copied from interface:SceneAPI
Force all orbits to refresh immediately. Some orbits need refreshing whenever the time changes. For instance, orbits of objects whose positions are based on VSOP87 need to be recomputed roughly once every loop. This method triggers an immediate refresh of all these orbits regardless of the position of the object in the orbit.- Specified by:
refresh_all_orbits
in interfaceSceneAPI
-
force_update_scene
public void force_update_scene()Description copied from interface:SceneAPI
Forcefully trigger an update of the internal scene graph, and the positions of all the objects. This method updates the internal state of all the entities in the scene graph.Useful to call after operations that modify the position of objects.
- Specified by:
force_update_scene
in interfaceSceneAPI
-
refresh_object_orbit
Description copied from interface:SceneAPI
Force the refresh of the orbit of the object identified byname
. This should generally be called after a call toSceneAPI.set_orbit_coordinates_scaling(String, double)
.- Specified by:
refresh_object_orbit
in interfaceSceneAPI
-
get_object_radius
Description copied from interface:SceneAPI
Get the internal radius of the object identified by the givenname
, in km.In some objects, such as stars, the radius is not the physical length from the center to the surface, but a representation of its absolute magnitude.
- Specified by:
get_object_radius
in interfaceSceneAPI
- Parameters:
name
- The name or ID (HIP, TYC, sourceId) of the object.- Returns:
- The radius of the object in km. If the object identified by name or ID (HIP, TYC, sourceId) does not exist, it returns a negative value.
-
set_object_quaternion_slerp_orientation
Description copied from interface:SceneAPI
Set the given quaternions file (CSV with times and quaternions) as the orientation provider for this object. This call removes the previous orientation model from the object (eitherRigidRotation
orAttitudeComponent
.The interpolation between quaternions is done using slerp (spherical linear interpolation).
- Specified by:
set_object_quaternion_slerp_orientation
in interfaceSceneAPI
- Parameters:
name
- The name of the object. The object must already have anOrientation
component.path
- The file path. The file is a CSV where each line has the time (ISO-8601) and the x, y, z and w components of the quaternion for that time. For instance, a valid line would be "2018-04-01T15:20:15Z,0.9237,0.3728,0.0358,0.0795
".- Returns:
- True if the object was found and could be updated.
-
set_object_quaternion_nlerp_orientation
Description copied from interface:SceneAPI
Set the given quaternions file (CSV with times and quaternions) as the orientation provider for this object. This call removes the previous orientation model from the object (eitherRigidRotation
orAttitudeComponent
.The interpolation between quaternions is done using nlerp (normalized linear interpolation).
- Specified by:
set_object_quaternion_nlerp_orientation
in interfaceSceneAPI
- Parameters:
name
- The name of the object. The object must already have anOrientation
component.path
- The file path. The file is a CSV where each line has the time (ISO-8601) and the x, y, z and w components of the quaternion for that time. For instance, a valid line would be "2018-04-01T15:20:15Z,0.9237,0.3728,0.0358,0.0795
".- Returns:
- True if the object was found and could be updated.
-
set_label_size_factor
public void set_label_size_factor(float factor) Description copied from interface:SceneAPI
Set the global label size factor. This is a multiplier that applies to all object labels.- Specified by:
set_label_size_factor
in interfaceSceneAPI
- Parameters:
factor
- Factor inConstants.MIN_LABEL_SIZE
andConstants.MAX_LABEL_SIZE
.
-
set_label_size_factor
public void set_label_size_factor(int factor) -
set_force_display_label
Description copied from interface:SceneAPI
Force the label of the object identified byname
to be displayed, ignoring the usual solid angle-based visibility rules. If called withforce = true
, the label for the given object is always rendered. Calling this method withfalse
does not cause the label to be muted. If you want to mute the label, useSceneAPI.set_mute_label(String, boolean)
instead.Note: This does not override the visibility of the object itself, nor the visibility settings of the
labels
component type.This setting is temporary and will not persist after a restart.
- Specified by:
set_force_display_label
in interfaceSceneAPI
- Parameters:
name
- The object name.force
- Whether to force the label to render for this object or not.
-
set_label_include_regexp
Description copied from interface:SceneAPI
Set the global include regular expression for filtering labels. Only labels that match this regular expression are rendered after this call. This call disables the global exclude regular expression (set withSceneAPI.set_label_exclude_regexp(String)
), if it is set.Java (like many other c-style languages) interprets backslashes (
'\'
) as escape characters. If you are calling the API programmatically (i.e. from Python), make sure to escape the backslashes in your source code; use"\\d+"
instead of"\d+"
.You clear all label-filtering regular expressions, effectively reverting the effects of this call, with
SceneAPI.clear_label_filter_regexps()
.The include regular expression is not persisted to the settings file, and never lives longer than the current Gaia Sky instance. It is cleared after a restart.
- Specified by:
set_label_include_regexp
in interfaceSceneAPI
- Parameters:
regexp
- The regular expression string, in Java format. SeePattern
for more information.
-
set_label_exclude_regexp
Description copied from interface:SceneAPI
Set the global exclude regular expression for filtering labels. Labels that match this regular expression are not rendered after this call. This call disables the global include regular expression (set withSceneAPI.set_label_include_regexp(String)
), if it is set.Java (like many other c-style languages) interprets backslashes (
'\'
) as escape characters. If you are calling the API programmatically (i.e. from Python), make sure to escape the backslashes in your source code; use"\\d+"
instead of"\d+"
.You clear all label-filtering regular expressions, effectively reverting the effects of this call, with
SceneAPI.clear_label_filter_regexps()
.The exclude regular expression is not persisted to the settings file, and never lives longer than the current Gaia Sky instance. It is cleared after a restart.
- Specified by:
set_label_exclude_regexp
in interfaceSceneAPI
- Parameters:
regexp
- The regular expression string, in Java format. SeePattern
for more information.
-
clear_label_filter_regexps
public void clear_label_filter_regexps()Description copied from interface:SceneAPI
Clears all label-filtering regular expressions currently in use, set withSceneAPI.set_label_exclude_regexp(String)
orSceneAPI.set_label_include_regexp(String)
, if any.After this call, the label include and exclude regular expressions, used to filter labels in and out, are cleared.
- Specified by:
clear_label_filter_regexps
in interfaceSceneAPI
-
set_mute_label
Description copied from interface:SceneAPI
Mute the label of the object identified byname
, ignoring the usual solid angle-based visibility rules. If called withmute = true
, the label for the given object is never rendered. Calling this method withfalse
does not cause the label to always display. If you want to force-display the label, useSceneAPI.set_force_display_label(String, boolean)
instead.Note: This does not override the visibility of the object itself, nor the visibility settings of the
labels
component type.This setting is temporary and will not persist after a restart.
- Specified by:
set_mute_label
in interfaceSceneAPI
- Parameters:
name
- The object name.mute
- Whether to mute the label for the object or not.
-
set_label_color
Description copied from interface:SceneAPI
Set the label color of the object identified by the givenname
. The label color must be an array of RGBA values in [0,1].- Specified by:
set_label_color
in interfaceSceneAPI
- Parameters:
name
- The object name.color
- The label color as an array of RGBA (red, green, blue, alpha) values in [0,1].
-
set_label_color
-
get_force_display_label
Description copied from interface:SceneAPI
Gets the value of the force display label flag for the object identified by the givenname
.- Specified by:
get_force_display_label
in interfaceSceneAPI
- Parameters:
name
- The name of the object.- Returns:
- The value of the force display label flag of the object, if it exists.
-
set_line_width_factor
public void set_line_width_factor(float factor) Description copied from interface:SceneAPI
Set the global line width factor. This is a multiplier that applies to all lines.- Specified by:
set_line_width_factor
in interfaceSceneAPI
- Parameters:
factor
- Factor inConstants.MIN_LINE_WIDTH
andConstants.MAX_LINE_WIDTH
.
-
set_line_width_factor
public void set_line_width_factor(int factor) -
set_velocity_vectors_number_factor
public void set_velocity_vectors_number_factor(float factor) Description copied from interface:SceneAPI
Set the number factor of the velocity vectors (proper motions) that are visible. In [1,100].This is just a factor, not an absolute number, as actual number of proper motion vectors depends on the stars currently in view.
- Specified by:
set_velocity_vectors_number_factor
in interfaceSceneAPI
- Parameters:
factor
- Factor in [1,100].
-
set_velocity_vectors_number_factor
public void set_velocity_vectors_number_factor(int factor) -
set_unfiltered_velocity_vectors_number_factor
public void set_unfiltered_velocity_vectors_number_factor(float factor) Unfiltered version ofset_velocity_vectors_number_factor(float)
. In this version, the user can submit a factor that extends beyond the bounds of [Constants.MIN_PM_NUM_FACTOR
,Constants.MAX_PM_NUM_FACTOR
].- Parameters:
factor
- The factor to set.
-
set_velocity_vectors_color_mode
public void set_velocity_vectors_color_mode(int mode) Description copied from interface:SceneAPI
Set the color mode of the velocity vectors (proper motions).- Specified by:
set_velocity_vectors_color_mode
in interfaceSceneAPI
- Parameters:
mode
- The color mode:- 0 - direction: the normalised cartesian velocity components XYZ are mapped to the color channels RGB.
- 1 - magnitude (speed): the magnitude of the velocity vector is mapped using a rainbow scheme (blue-green-yellow-red) with the color map limit at 100 Km/s.
- 2 - has radial velocity: blue for stars with radial velocity, red for stars without.
- 3 - redshift from Sun: blue stars have negative radial velocity (from the Sun), red stars have positive radial velocity (from the Sun). Blue is mapped to -100 Km/s, red is mapped to 100 Km/s.
- 4 - redshift from camera: blue stars have negative radial velocity (from the camera), red stars have positive radial velocity (from the camera). Blue is mapped to -100 Km/s, red is mapped to 100 Km/s.
- 5 - single color: same color for all velocity vectors.
-
set_velocity_vectors_arrowheads
public void set_velocity_vectors_arrowheads(boolean enabled) Description copied from interface:SceneAPI
Specify whether arrowheads should be displayed on velocity vectors.- Specified by:
set_velocity_vectors_arrowheads
in interfaceSceneAPI
- Parameters:
enabled
- Whether to show the velocity vectors with arrowheads.
-
set_velocity_vectors_length_factor
public void set_velocity_vectors_length_factor(float factor) Description copied from interface:SceneAPI
Set the length factor of the velocity vectors (proper motions), in [500,30000]. This is just a factor, not an absolute length measure.- Specified by:
set_velocity_vectors_length_factor
in interfaceSceneAPI
- Parameters:
factor
- Factor in [500,30000].
-
set_velocity_vectors_length_factor
public void set_velocity_vectors_length_factor(int factor) -
get_velocity_vector_max_number
public long get_velocity_vector_max_number()Description copied from interface:SceneAPI
Return the current maximum number of velocity vectors per star group. This is a global setting stored in the configuration file.- Specified by:
get_velocity_vector_max_number
in interfaceSceneAPI
- Returns:
- Max number of velocity vectors per star group.
-
set_velocity_vector_max_number
public void set_velocity_vector_max_number(long num) Description copied from interface:SceneAPI
Set the maximum number of proper motion vectors to add per star group. This modifies the global setting stored in the configuration file, and will be persisted when the application exits.- Specified by:
set_velocity_vector_max_number
in interfaceSceneAPI
- Parameters:
num
- The maximum number of proper motion vectors per star group.
-
add_trajectory_line
Description copied from interface:SceneAPI
Add a new trajectory object with the given name, points and color. The trajectory is rendered using the 'line renderer' setting in the preferences dialog. This is a very similar call toSceneAPI.add_polyline(String, double[], double[])
, but in this case the line can be rendered with higher quality polyline quadstrips.- Specified by:
add_trajectory_line
in interfaceSceneAPI
- Parameters:
name
- The name to identify the trajectory, to possibly remove it later.points
- The points of the trajectory. It is an array containing all the points as in [x0, y0, z0, x1, y1, z1, ..., xn, yn, zn] in the internal reference system.color
- The color of the trajectory as an array of RGBA (red, green, blue, alpha) values in [0,1].
-
add_trajectory_line
-
add_trajectory_line
Description copied from interface:SceneAPI
Add a new trajectory object with the given name, points and color. The trajectory is rendered using the 'line renderer' setting in the preferences' dialog. This is a very similar call toSceneAPI.add_polyline(String, double[], double[])
, but in this case the line can be rendered with higher quality polyline quadstrips.- Specified by:
add_trajectory_line
in interfaceSceneAPI
- Parameters:
name
- The name to identify the trajectory, to possibly remove it later.points
- The points of the trajectory. It is an array containing all the points as in [x0, y0, z0, x1, y1, z1, ..., xn, yn, zn] in the internal reference system.color
- The color of the trajectory as an array of RGBA (red, green, blue, alpha) values in [0,1].trail
- The bottom mapping position for the trail. The orbit trail assigns an opacity value to each point of the orbit, where 1 is the location of the last point in the points list, and 0 is the first one. This mapping parameter defines the location in the orbit (in [0,1]) where we map the opacity value of 0. Set to 0 to have a full trail. Set to 0.5 to have a trail that spans half the orbit. Set to 1 to have no orbit at all. Set to negative to disable the trail.
-
add_trajectory_line
-
add_polyline
Description copied from interface:SceneAPI
Add a new polyline with the given name, points and color. The polyline will be created with the 'Others' component type, so you need to enable the visibility of 'Others' in order to see it. The default primitive of GL_LINE_STRIP is used.- Specified by:
add_polyline
in interfaceSceneAPI
- Parameters:
name
- The name to identify the polyline, to possibly remove it later.points
- The points of the polyline. It is an array containing all the points as in [x0, y0, z0, x1, y1, z1, ..., xn, yn, zn] in the internal reference system.color
- The color of the polyline as an array of RGBA (red, green, blue, alpha) values in [0,1].
-
add_polyline
-
add_polyline
Description copied from interface:SceneAPI
Add a new polyline with the given name, points, color and line width. The polyline will be created with the 'Others' component type, so you need to enable the visibility of 'Others' in order to see it. The default primitive type of GL_LINE_STRIP is used.- Specified by:
add_polyline
in interfaceSceneAPI
- Parameters:
name
- The name to identify the polyline, to possibly remove it later.points
- The points of the polyline. It is an array containing all the points as in [x0, y0, z0, x1, y1, z1, ..., xn, yn, zn].color
- The color of the polyline as an array of RGBA (red, green, blue, alpha) values in [0,1].width
- The line width. Usually a value between 1 (default) and 10.
-
add_polyline
Description copied from interface:SceneAPI
Add a new polyline with the given name, points, color and line width. The polyline will be created with the 'Others' component type, so you need to enable the visibility of 'Others' in order to see it. The default primitive type of GL_LINE_STRIP is used. This version enables the addition of arrow caps. In the case arrow caps are enabled, the line will be rendered in CPU mode (no VBO), making it slightly slower, especially for lines with many points. The arrow cap is added at the first point in the series.- Specified by:
add_polyline
in interfaceSceneAPI
- Parameters:
name
- The name to identify the polyline, to possibly remove it later.points
- The points of the polyline. It is an array containing all the points as in [x0, y0, z0, x1, y1, z1, ..., xn, yn, zn].color
- The color of the polyline as an array of RGBA (red, green, blue, alpha) values in [0,1].width
- The line width. Usually a value between 1 (default) and 10.caps
- Whether to represent arrow caps. If enabled, the line is rendered in CPU mode, which is slower.
-
add_polyline
Description copied from interface:SceneAPI
Add a new polyline with the given name, points, color, line width and primitive. The polyline will be created with the 'Others' component type, so you need to enable the visibility of 'Others' in order to see it.- Specified by:
add_polyline
in interfaceSceneAPI
- Parameters:
name
- The name to identify the polyline, to possibly remove it later.points
- The points of the polyline. It is an array containing all the points as in [x0, y0, z0, x1, y1, z1, ..., xn, yn, zn].color
- The color of the polyline as an array of RGBA (red, green, blue, alpha) values in [0,1].width
- The line width. Usually a value between 1 (default) and 10.primitive
- The GL primitive:GL_LINES
=1,GL_LINE_LOOP
=2,GL_LINE_STRIP
=3
-
add_polyline
public void add_polyline(String name, double[] points, double[] color, double width, int primitive, boolean caps) Description copied from interface:SceneAPI
Add a new polyline with the given name, points, color, line width, primitive and arrow caps. The polyline will be created with the 'Others' component type, so you need to enable the visibility of 'Others' in order to see it. This version enables the addition of arrow caps. In the case arrow caps are enabled, the line will be rendered in CPU mode (no VBO), making it slightly slower, especially for lines with many points. The arrow cap is added at the first point in the series.- Specified by:
add_polyline
in interfaceSceneAPI
- Parameters:
name
- The name to identify the polyline, to possibly remove it later.points
- The points of the polyline. It is an array containing all the points as in [x0, y0, z0, x1, y1, z1, ..., xn, yn, zn].color
- The color of the polyline as an array of RGBA (red, green, blue, alpha) values in [0,1].width
- The line width. Usually a value between 1 (default) and 10.primitive
- The GL primitive:GL_LINES
=1,GL_LINE_LOOP
=2,GL_LINE_STRIP
=3caps
- Whether to represent arrow caps. If enabled, the line is rendered in CPU mode, which is slower.
-
add_polyline
-
add_polyline
public void add_polyline(String name, double[] points, double[] color, int lineWidth, int primitive) -
add_polyline
-
add_polyline
-
add_polyline
-
add_polyline
-
add_polyline
-
add_polyline
-
add_polyline
-
add_polyline
-
remove_object
Description copied from interface:SceneAPI
Remove the model object identified by the given name from the internal scene graph model of Gaia Sky, if it exists. If the object has children, they are removed recursively. Be careful with this function, as it can have unexpected side effects depending on what objects are removed. For example,gs.removeModelObject("Earth")
removes the Earth, the Moon, Gaia and any dependent object from Gaia Sky.
- Specified by:
remove_object
in interfaceSceneAPI
- Parameters:
name
- The name of the object to remove.
-
add_shape_around_object
public void add_shape_around_object(String name, String shapeType, String primitive, double size, String obj_name, float r, float g, float b, float a, boolean label, boolean track) Description copied from interface:SceneAPI
Add a shape object of the given type with the given size around the object with the given name and primitive.- Specified by:
add_shape_around_object
in interfaceSceneAPI
- Parameters:
name
- The name of the shape object.shapeType
- The shape type, one of- sphere
- icosphere
- octahedronsphere
- ring
- cylinder
- cone
primitive
- The primitive to use, one of- lines
- triangles
size
- The size of the object in kilometers.obj_name
- The name of the object to use as the position.r
- The red component of the color in [0,1].g
- The green component of the color in [0,1].b
- The blue component of the color in [0,1].a
- The alpha component of the color in [0,1].label
- Whether to show a label with the name of the shape.track
- Whether to track the object if/when it moves.
-
add_shape_around_object
public void add_shape_around_object(String name, String shapeType, String primitive, String ori, double size, String obj_name, float r, float g, float b, float a, boolean label, boolean track) Description copied from interface:SceneAPI
Add a shape object of the given type with the given size around the object with the given name, primitive and orientation.- Specified by:
add_shape_around_object
in interfaceSceneAPI
- Parameters:
name
- The name of the shape object.shapeType
- The shape type, one of- sphere
- icosphere
- octahedronsphere
- ring
- cylinder
- cone
primitive
- The primitive to use, one of- lines
- triangles
ori
- The orientation to use, one of- camera
- equatorial
- ecliptic
- galactic
size
- The size of the object in kilometers.obj_name
- The name of the object to use as the position.r
- The red component of the color in [0,1].g
- The green component of the color in [0,1].b
- The blue component of the color in [0,1].a
- The alpha component of the color in [0,1].label
- Whether to show a label with the name of the shape.track
- Whether to track the object if/when it moves.
-
notify
-