Class SceneModule

java.lang.Object
gaiasky.script.v2.impl.APIModule
gaiasky.script.v2.impl.SceneModule
All Implemented Interfaces:
IObserver, SceneAPI

public class SceneModule extends APIModule implements IObserver, SceneAPI
The scene module contains methods and calls that modify and query the internal scene in Gaia Sky.
  • Field Details

    • scene

      public Scene scene
      Reference to the main Scene object in Gaia Sky.
  • Constructor Details

    • SceneModule

      public SceneModule(EventManager em, APIv2 api, String name)
      Create a new module with the given attributes.
      Parameters:
      api - Reference to the API class.
      name - Name of the module.
  • Method Details

    • get_object

      public FocusView get_object(String name)
      Description copied from interface: SceneAPI
      Get an object from the scene graph by name or id (HIP, TYC, Gaia SourceId).
      Specified by:
      get_object in interface SceneAPI
      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

      public FocusView get_object(String name, double timeout)
      Description copied from interface: SceneAPI
      Get an object by name or id (HIP, TYC, Gaia SourceID), optionally waiting until the object is available, with a timeout.
      Specified by:
      get_object in interface SceneAPI
      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

      public VertsView get_line_object(String name)
      Description copied from interface: SceneAPI
      Get the line object identified by the given name. The returned line object is of type Verts. Verts represents objects that are rendered as primitives. Typically, they are either lines or points.
      Specified by:
      get_line_object in interface SceneAPI
      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

      public VertsView get_line_object(String name, double timeout)
      Description copied from interface: SceneAPI
      Get the line object identified by the given name. The returned line object is of type Verts. 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 interface SceneAPI
      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

      public com.badlogic.ashley.core.Entity get_entity(String name)
      Description copied from interface: SceneAPI
      Get the reference to an entity given its name.
      Specified by:
      get_entity in interface SceneAPI
      Parameters:
      name - Entity name.
    • get_entity

      public com.badlogic.ashley.core.Entity get_entity(String name, double timeout)
      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 interface SceneAPI
      Parameters:
      name - Entity name.
      timeout - Timeout time, in seconds.
    • get_focus

      public com.badlogic.ashley.core.Entity get_focus(String name)
      Description copied from interface: SceneAPI
      Get a focus object from the scene given its name.
      Specified by:
      get_focus in interface SceneAPI
      Parameters:
      name - The name of the focus object.
      Returns:
      The reference to the object if it exists, null otherwise.
    • get_focus_entity

      public com.badlogic.ashley.core.Entity get_focus_entity(String name)
    • get_star_parameters

      public double[] get_star_parameters(String name)
      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 interface SceneAPI
      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

      public double[] get_object_position(String name)
      Description copied from interface: SceneAPI
      Get the current position of the object identified by name in the internal coordinate system and internal units. If the object does not exist, it returns null.
      Specified by:
      get_object_position in interface SceneAPI
      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

      public double[] get_object_position(String name, String units)
      Description copied from interface: SceneAPI
      Get the current position of the object identified by name 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 interface SceneAPI
      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

      public double[] get_object_predicted_position(String name)
      Description copied from interface: SceneAPI
      Get the predicted position of the object identified by name 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 interface SceneAPI
      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

      public double[] get_object_predicted_position(String name, String units)
      Description copied from interface: SceneAPI
      Get the predicted position of the object identified by name 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 interface SceneAPI
      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

      public void set_object_posiiton(String name, double[] pos)
      Description copied from interface: SceneAPI
      Set the internal position of the object identified by name. 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 interface SceneAPI
      Parameters:
      name - The name of the object.
      pos - The position in the internal reference system and internal units.
    • set_object_posiiton

      public void set_object_posiiton(String name, double[] pos, String units)
      Description copied from interface: SceneAPI
      Set the internal position of the object identified by name. 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 interface SceneAPI
      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

      public void set_object_posiiton(String name, List<?> position)
    • set_object_posiiton

      public void set_object_posiiton(String name, List<?> position, String units)
    • set_object_posiiton

      public void set_object_posiiton(FocusView 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 interface SceneAPI
      Parameters:
      object - The object in a focus view wrapper.
      pos - The position in the internal reference system and internal units.
    • set_object_posiiton

      public void set_object_posiiton(FocusView object, double[] pos, String units)
      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 interface SceneAPI
      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

      public void set_object_posiiton(FocusView object, List<?> position)
    • set_object_posiiton

      public void set_object_posiiton(FocusView object, List<?> position, String units)
    • 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 interface SceneAPI
      Parameters:
      object - The object entity.
      pos - The position in the internal reference system and internal units.
    • set_object_posiiton

      public void set_object_posiiton(com.badlogic.ashley.core.Entity object, double[] pos, String units)
      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 interface SceneAPI
      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

      public void set_object_coordinates_provider(String name, IPythonCoordinatesProvider provider)
      Description copied from interface: SceneAPI
      Set the coordinates provider for the object identified with the given name, if possible. The provider object must implement IPythonCoordinatesProvider, and in particular the method IPythonCoordinatesProvider.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 interface SceneAPI
      Parameters:
      name - The name of the object.
      provider - The coordinate provider instance.
    • remove_object_coordinates_provider

      public void remove_object_coordinates_provider(String name)
      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 with SceneAPI.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 interface SceneAPI
      Parameters:
      name - The name of the object for which to remove the coordinate provider.
    • set_object_posiiton

      public void set_object_posiiton(com.badlogic.ashley.core.Entity object, List<?> position)
    • set_component_type_visibility

      public void set_component_type_visibility(String key, boolean visible)
      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 interface SceneAPI
      Parameters:
      key - The key of the component, as a string. ComponentTypes.ComponentType.
      visible - The visible value.
    • get_component_type_visibility

      public boolean get_component_type_visibility(String key)
      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 interface SceneAPI
      Parameters:
      key - The key of the component type to query.
      Returns:
      The visibility of the component type.
    • get_object_screen_coordinates

      public double[] get_object_screen_coordinates(String name)
      Description copied from interface: SceneAPI
      Project the world space position of the object identified by the given name to screen coordinates. It's the same as GLU's gluProject() 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 interface SceneAPI
      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

      public boolean set_object_visibility(String name, boolean visible)
      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 interface SceneAPI
      Parameters:
      name - The name of the object. Must be an instance of IVisibilitySwitch.
      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

      public boolean get_object_visibility(String name)
      Description copied from interface: SceneAPI
      Get the visibility of a particular object.
      Specified by:
      get_object_visibility in interface SceneAPI
      Parameters:
      name - The name of the object. Must be an instance of IVisibilitySwitch.
      Returns:
      The visibility status of the object, if it exists.
    • set_object_size_scaling

      public void set_object_size_scaling(String name, double factor)
      Description copied from interface: SceneAPI
      Set the given size scaling factor to the object identified by name. 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 interface SceneAPI
      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 of set_object_size_scaling(String, double) but getting an Entity reference instead of a name.
      Parameters:
      object - The Entity.
      scalingFactor - The scaling factor.
    • set_orbit_coordinates_scaling

      public void set_orbit_coordinates_scaling(String name, double factor)
      Description copied from interface: SceneAPI
      Set the given orbit coordinates scaling factor to the orbit object identified by name. The object must be attached to an orbit that extends AbstractOrbitCoordinates.

      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() or SceneAPI.refresh_object_orbit(String) right after this call in order to immediately refresh the scaled orbits.

      Specified by:
      set_orbit_coordinates_scaling in interface SceneAPI
      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 interface SceneAPI
    • 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 interface SceneAPI
    • refresh_object_orbit

      public void refresh_object_orbit(String name)
      Description copied from interface: SceneAPI
      Force the refresh of the orbit of the object identified by name. This should generally be called after a call to SceneAPI.set_orbit_coordinates_scaling(String, double).
      Specified by:
      refresh_object_orbit in interface SceneAPI
    • get_object_radius

      public double get_object_radius(String name)
      Description copied from interface: SceneAPI
      Get the internal radius of the object identified by the given name, 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 interface SceneAPI
      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

      public boolean set_object_quaternion_slerp_orientation(String name, String path)
      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 (either RigidRotation or AttitudeComponent.

      The interpolation between quaternions is done using slerp (spherical linear interpolation).

      Specified by:
      set_object_quaternion_slerp_orientation in interface SceneAPI
      Parameters:
      name - The name of the object. The object must already have an Orientation 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

      public boolean set_object_quaternion_nlerp_orientation(String name, String path)
      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 (either RigidRotation or AttitudeComponent.

      The interpolation between quaternions is done using nlerp (normalized linear interpolation).

      Specified by:
      set_object_quaternion_nlerp_orientation in interface SceneAPI
      Parameters:
      name - The name of the object. The object must already have an Orientation 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 interface SceneAPI
      Parameters:
      factor - Factor in Constants.MIN_LABEL_SIZE and Constants.MAX_LABEL_SIZE.
    • set_label_size_factor

      public void set_label_size_factor(int factor)
    • set_force_display_label

      public void set_force_display_label(String name, boolean force)
      Description copied from interface: SceneAPI
      Force the label of the object identified by name to be displayed, ignoring the usual solid angle-based visibility rules. If called with force = true, the label for the given object is always rendered. Calling this method with false does not cause the label to be muted. If you want to mute the label, use SceneAPI.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 interface SceneAPI
      Parameters:
      name - The object name.
      force - Whether to force the label to render for this object or not.
    • set_label_include_regexp

      public void set_label_include_regexp(String 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 with SceneAPI.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 interface SceneAPI
      Parameters:
      regexp - The regular expression string, in Java format. See Pattern for more information.
    • set_label_exclude_regexp

      public void set_label_exclude_regexp(String 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 with SceneAPI.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 interface SceneAPI
      Parameters:
      regexp - The regular expression string, in Java format. See Pattern 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 with SceneAPI.set_label_exclude_regexp(String) or SceneAPI.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 interface SceneAPI
    • set_mute_label

      public void set_mute_label(String name, boolean mute)
      Description copied from interface: SceneAPI
      Mute the label of the object identified by name, ignoring the usual solid angle-based visibility rules. If called with mute = true, the label for the given object is never rendered. Calling this method with false does not cause the label to always display. If you want to force-display the label, use SceneAPI.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 interface SceneAPI
      Parameters:
      name - The object name.
      mute - Whether to mute the label for the object or not.
    • set_label_color

      public void set_label_color(String name, double[] color)
      Description copied from interface: SceneAPI
      Set the label color of the object identified by the given name. The label color must be an array of RGBA values in [0,1].
      Specified by:
      set_label_color in interface SceneAPI
      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

      public void set_label_color(String name, List<?> color)
    • get_force_display_label

      public boolean get_force_display_label(String name)
      Description copied from interface: SceneAPI
      Gets the value of the force display label flag for the object identified by the given name.
      Specified by:
      get_force_display_label in interface SceneAPI
      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 interface SceneAPI
      Parameters:
      factor - Factor in Constants.MIN_LINE_WIDTH and Constants.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 interface SceneAPI
      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 of set_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 interface SceneAPI
      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 interface SceneAPI
      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 interface SceneAPI
      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 interface SceneAPI
      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 interface SceneAPI
      Parameters:
      num - The maximum number of proper motion vectors per star group.
    • add_trajectory_line

      public void add_trajectory_line(String name, double[] points, double[] color)
      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 to SceneAPI.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 interface SceneAPI
      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

      public void add_trajectory_line(String name, List<?> points, List<?> color)
    • add_trajectory_line

      public void add_trajectory_line(String name, double[] points, double[] color, double trail)
      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 to SceneAPI.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 interface SceneAPI
      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

      public void add_trajectory_line(String name, List<?> points, List<?> color, double trailMap)
    • add_polyline

      public void add_polyline(String name, double[] points, double[] color)
      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 interface SceneAPI
      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

      public void add_polyline(String name, List<?> points, List<?> color)
    • add_polyline

      public void add_polyline(String name, double[] points, double[] color, double width)
      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 interface SceneAPI
      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

      public void add_polyline(String name, double[] points, double[] color, double width, boolean caps)
      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 interface SceneAPI
      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

      public void add_polyline(String name, double[] points, double[] color, double width, int primitive)
      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 interface SceneAPI
      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 interface SceneAPI
      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
      caps - Whether to represent arrow caps. If enabled, the line is rendered in CPU mode, which is slower.
    • add_polyline

      public void add_polyline(String name, double[] points, double[] color, int lineWidth)
    • add_polyline

      public void add_polyline(String name, double[] points, double[] color, int lineWidth, int primitive)
    • add_polyline

      public void add_polyline(String name, List<?> points, List<?> color, float lineWidth)
    • add_polyline

      public void add_polyline(String name, List<?> points, List<?> color, float lineWidth, boolean arrowCaps)
    • add_polyline

      public void add_polyline(String name, List<?> points, List<?> color, float lineWidth, int primitive)
    • add_polyline

      public void add_polyline(String name, List<?> points, List<?> color, float lineWidth, int primitive, boolean arrowCaps)
    • add_polyline

      public void add_polyline(String name, List<?> points, List<?> color, int lineWidth)
    • add_polyline

      public void add_polyline(String name, List<?> points, List<?> color, int lineWidth, boolean arrowCaps)
    • add_polyline

      public void add_polyline(String name, List<?> points, List<?> color, int lineWidth, int primitive)
    • add_polyline

      public void add_polyline(String name, List<?> points, List<?> color, int lineWidth, int primitive, boolean arrowCaps)
    • remove_object

      public void remove_object(String name)
      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 interface SceneAPI
      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 interface SceneAPI
      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
      . Use 'lines' to create a wireframe shape, use 'triangles' for a solid shape.
      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 interface SceneAPI
      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
      . Use 'lines' to create a wireframe shape, use 'triangles' for a solid shape.
      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

      public void notify(Event event, Object source, Object... data)
      Description copied from interface: IObserver
      Event notification call.
      Specified by:
      notify in interface IObserver
      Parameters:
      event - The event type.
      source - The source object, if any.
      data - The data associated with this event.