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 TypeMethodDescriptionvoidadd_polyline(String name, double[] points, double[] color) Add a new polyline with the given name, points and color.voidadd_polyline(String name, double[] points, double[] color, double width) Add a new polyline with the given name, points, color and line width.voidadd_polyline(String name, double[] points, double[] color, double width, boolean caps) Add a new polyline with the given name, points, color and line width.voidadd_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.voidadd_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.voidadd_polyline(String name, double[] points, double[] color, int lineWidth) voidadd_polyline(String name, double[] points, double[] color, int lineWidth, int primitive) voidadd_polyline(String name, List<?> points, List<?> color) voidadd_polyline(String name, List<?> points, List<?> color, float lineWidth) voidadd_polyline(String name, List<?> points, List<?> color, float lineWidth, boolean arrowCaps) voidadd_polyline(String name, List<?> points, List<?> color, float lineWidth, int primitive) voidadd_polyline(String name, List<?> points, List<?> color, float lineWidth, int primitive, boolean arrowCaps) voidadd_polyline(String name, List<?> points, List<?> color, int lineWidth) voidadd_polyline(String name, List<?> points, List<?> color, int lineWidth, boolean arrowCaps) voidadd_polyline(String name, List<?> points, List<?> color, int lineWidth, int primitive) voidadd_polyline(String name, List<?> points, List<?> color, int lineWidth, int primitive, boolean arrowCaps) voidadd_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.voidadd_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.voidadd_trajectory_line(String name, double[] points, double[] color) Add a new trajectory object with the given name, points and color.voidadd_trajectory_line(String name, double[] points, double[] color, double trail) Add a new trajectory object with the given name, points and color.voidadd_trajectory_line(String name, List<?> points, List<?> color) voidadd_trajectory_line(String name, List<?> points, List<?> color, double trailMap) voidClears all label-filtering regular expressions currently in use, set withSceneAPI.set_label_exclude_regexp(String)orSceneAPI.set_label_include_regexp(String), if any.Pair<com.badlogic.ashley.core.Entity, com.badlogic.ashley.core.Entity> createNewProceduralGalaxy(String name, double radius, Vector3Q pos, GalaxyGenerator.GalaxyMorphology morphology) Creates a new procedural galaxy entity and sets up the billboard datasets.voidForcefully trigger an update of the internal scene graph, and the positions of all the objects.booleanGet the visibility of the component type described by the key.com.badlogic.ashley.core.Entityget_entity(String name) Get the reference to an entity given its name using the internal index.com.badlogic.ashley.core.Entityget_entity(String name, double timeout) Get the reference to an entity given its name and a timeout in seconds.com.badlogic.ashley.core.EntityGet a focus object from the scene given its name.com.badlogic.ashley.core.Entityget_focus_entity(String name) Alias toget_focus(String).booleanGets 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.com.badlogic.ashley.core.Entityget_non_index_entity(String name) Gets the reference to an entity given its name without using the index.com.badlogic.ashley.core.Entityget_non_index_entity(String name, double timeout) Get the reference to an entity given its name and a timeout in seconds, without using the index.get_object(String name) Get an object from the scene graph bynameor id (HIP, TYC, Gaia SourceId).get_object(String name, double timeout) Get an object bynameor 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 bynamein the internal coordinate system and internal units.double[]get_object_position(String name, String units) Get the current position of the object identified bynamein the internal coordinate system and the requested distance units.double[]Get the predicted position of the object identified bynamein the internal coordinate system and internal units.double[]get_object_predicted_position(String name, String units) Get the predicted position of the object identified bynamein the internal coordinate system and the requested distance units.doubleget_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 givennameto screen coordinates.booleanget_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.longReturn the current maximum number of velocity vectors per star group.voidEvent notification call.voidForce all orbits to refresh immediately.voidrefresh_object_orbit(String name) Force the refresh of the orbit of the object identified byname.voidremove_object(String name) Remove the model object identified by the given name from the internal scene graph model of Gaia Sky, if it exists.voidRemove the current coordinates provider from the object with the given name.voidset_component_type_visibility(String key, boolean visible) Sets the component described by the given name visible or invisible.voidset_force_display_label(String name, boolean force) Force the label of the object identified bynameto be displayed, ignoring the usual solid angle-based visibility rules.voidset_label_color(String name, double[] color) Set the label color of the object identified by the givenname.voidset_label_color(String name, List<?> color) voidset_label_exclude_regexp(String regexp) Set the global exclude regular expression for filtering labels.voidset_label_include_regexp(String regexp) Set the global include regular expression for filtering labels.voidset_label_size_factor(float factor) Set the global label size factor.voidset_label_size_factor(int factor) voidset_line_width_factor(float factor) Set the global line width factor.voidset_line_width_factor(int factor) voidset_mute_label(String name, boolean mute) Mute the label of the object identified byname, ignoring the usual solid angle-based visibility rules.voidset_object_coordinates_provider(String name, IPythonCoordinatesProvider provider) Set the coordinates provider for the object identified with the given name, if possible.voidset_object_posiiton(com.badlogic.ashley.core.Entity object, double[] pos) Set the internal position of the given entity object.voidset_object_posiiton(com.badlogic.ashley.core.Entity object, double[] pos, String units) Set the internal position of the given entity object.voidset_object_posiiton(com.badlogic.ashley.core.Entity object, List<?> position) voidset_object_posiiton(FocusView object, double[] pos) Set the internal position of the given entity object.voidset_object_posiiton(FocusView object, double[] pos, String units) Set the internal position of the given entity object.voidset_object_posiiton(FocusView object, List<?> position) voidset_object_posiiton(FocusView object, List<?> position, String units) voidset_object_posiiton(String name, double[] pos) Set the internal position of the object identified byname.voidset_object_posiiton(String name, double[] pos, String units) Set the internal position of the object identified byname.voidset_object_posiiton(String name, List<?> position) voidset_object_posiiton(String name, List<?> position, String units) booleanset_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.booleanset_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.voidset_object_size_scaling(com.badlogic.ashley.core.Entity object, double scalingFactor) Version ofset_object_size_scaling(String, double)but getting anEntityreference instead of a name.voidset_object_size_scaling(String name, double factor) Set the given size scaling factor to the object identified byname.booleanset_object_visibility(String name, boolean visible) Set the visibility of a particular object.voidset_orbit_coordinates_scaling(String name, double factor) Set the given orbit coordinates scaling factor to the orbit object identified byname.voidset_unfiltered_velocity_vectors_number_factor(float factor) Unfiltered version ofset_velocity_vectors_number_factor(float).voidset_velocity_vector_max_number(long num) Set the maximum number of proper motion vectors to add per star group.voidset_velocity_vectors_arrowheads(boolean enabled) Specify whether arrowheads should be displayed on velocity vectors.voidset_velocity_vectors_color_mode(int mode) Set the color mode of the velocity vectors (proper motions).voidset_velocity_vectors_length_factor(float factor) Set the length factor of the velocity vectors (proper motions), in [500,30000].voidset_velocity_vectors_length_factor(int factor) voidset_velocity_vectors_number_factor(float factor) Set the number factor of the velocity vectors (proper motions) that are visible.voidset_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:SceneAPIGet an object from the scene graph bynameor id (HIP, TYC, Gaia SourceId).- Specified by:
get_objectin 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:SceneAPIGet an object bynameor id (HIP, TYC, Gaia SourceID), optionally waiting until the object is available, with a timeout.- Specified by:
get_objectin 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:SceneAPIGet the line object identified by the givenname. The returned line object is of typeVerts.Vertsrepresents objects that are rendered as primitives. Typically, they are either lines or points.- Specified by:
get_line_objectin interfaceSceneAPI- Parameters:
name- The name of the line object.- Returns:
- The line object as a
VertsViewinstance, or null if it does not exist.
-
get_line_object
Description copied from interface:SceneAPIGet the line object identified by the givenname. The returned line object is of typeVerts.Vertsrepresents 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_objectin 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:SceneAPIGet the reference to an entity given its name using the internal index. This method returns proper scene entities only. If you need any other kind of entity (datasets, hooks, etc.), useSceneAPI.get_non_index_entity(String, double).- Specified by:
get_entityin interfaceSceneAPI- Parameters:
name- Entity name.- Returns:
- Reference to the entity.
-
get_entity
Description copied from interface:SceneAPIGet the reference to an entity given its name and a timeout in seconds. This method returns proper scene entities only. If you need any other kind of entity (datasets, hooks, etc.), useSceneAPI.get_non_index_entity(String)If the entity is not in the scene after the timeout has passed, ths method returns null.- Specified by:
get_entityin interfaceSceneAPI- Parameters:
name- Entity name.timeout- Timeout time, in seconds.- Returns:
- Reference to the entity.
-
get_non_index_entity
Description copied from interface:SceneAPIGets the reference to an entity given its name without using the index. This method is slower than its indexed counterpart (SceneAPI.get_entity(String), but it can get any type of entity.- Specified by:
get_non_index_entityin interfaceSceneAPI- Parameters:
name- Entity name.- Returns:
- Reference to the entity.
-
get_non_index_entity
Description copied from interface:SceneAPIGet the reference to an entity given its name and a timeout in seconds, without using the index. This method is slower than its indexed counterpart (SceneAPI.get_entity(String, double), but it can get non-indexed entities.If the entity is not in the scene after the timeout has passed, ths method returns null.
- Specified by:
get_non_index_entityin interfaceSceneAPI- Parameters:
name- Entity name.timeout- Timeout time, in seconds.- Returns:
- Reference to the entity.
-
get_focus
Description copied from interface:SceneAPIGet a focus object from the scene given its name. -
get_focus_entity
Alias toget_focus(String). -
get_star_parameters
Description copied from interface:SceneAPIReturn the star parameters given its identifier or name, if the star exists and it is loaded.- Specified by:
get_star_parametersin 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:SceneAPIGet the current position of the object identified bynamein the internal coordinate system and internal units. If the object does not exist, it returns null.- Specified by:
get_object_positionin 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:SceneAPIGet the current position of the object identified bynamein the internal coordinate system and the requested distance units. If the object does not exist, it returns null.- Specified by:
get_object_positionin 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:SceneAPIGet the predicted position of the object identified bynamein 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_positionin 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:SceneAPIGet the predicted position of the object identified bynamein 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_positionin 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:SceneAPISet 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_posiitonin 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:SceneAPISet 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_posiitonin 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:SceneAPISet 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_posiitonin 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:SceneAPISet 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_posiitonin 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:SceneAPISet 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_posiitonin interfaceSceneAPI- Parameters:
object- The object entity.pos- The position in the internal reference system and internal units.
-
set_object_posiiton
Description copied from interface:SceneAPISet 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_posiitonin 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:SceneAPISet 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_providerin interfaceSceneAPI- Parameters:
name- The name of the object.provider- The coordinate provider instance.
-
remove_object_coordinates_provider
Description copied from interface:SceneAPIRemove 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_providerin 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:SceneAPISets 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_visibilityin 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:SceneAPIGet 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.ComponentTypefor more information.- Specified by:
get_component_type_visibilityin 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:SceneAPIProject the world space position of the object identified by the givennameto 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_coordinatesin 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:SceneAPISet 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_visibilityin 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:SceneAPIGet the visibility of a particular object.- Specified by:
get_object_visibilityin 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:SceneAPISet 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_scalingin 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 anEntityreference instead of a name.- Parameters:
object- TheEntity.scalingFactor- The scaling factor.
-
set_orbit_coordinates_scaling
Description copied from interface:SceneAPISet 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
AbstractOrbitCoordinatesand 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_scalingin 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:SceneAPIForce 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_orbitsin interfaceSceneAPI
-
force_update_scene
public void force_update_scene()Description copied from interface:SceneAPIForcefully 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_scenein interfaceSceneAPI
-
refresh_object_orbit
Description copied from interface:SceneAPIForce 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_orbitin interfaceSceneAPI
-
get_object_radius
Description copied from interface:SceneAPIGet 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_radiusin 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:SceneAPISet 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 (eitherRigidRotationorAttitudeComponent.The interpolation between quaternions is done using slerp (spherical linear interpolation).
- Specified by:
set_object_quaternion_slerp_orientationin interfaceSceneAPI- Parameters:
name- The name of the object. The object must already have anOrientationcomponent.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:SceneAPISet 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 (eitherRigidRotationorAttitudeComponent.The interpolation between quaternions is done using nlerp (normalized linear interpolation).
- Specified by:
set_object_quaternion_nlerp_orientationin interfaceSceneAPI- Parameters:
name- The name of the object. The object must already have anOrientationcomponent.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:SceneAPISet the global label size factor. This is a multiplier that applies to all object labels.- Specified by:
set_label_size_factorin interfaceSceneAPI- Parameters:
factor- Factor inConstants.MIN_LABEL_SIZEandConstants.MAX_LABEL_SIZE.
-
set_label_size_factor
public void set_label_size_factor(int factor) -
set_force_display_label
Description copied from interface:SceneAPIForce the label of the object identified bynameto 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 withfalsedoes 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
labelscomponent type.This setting is temporary and will not persist after a restart.
- Specified by:
set_force_display_labelin 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:SceneAPISet 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_regexpin interfaceSceneAPI- Parameters:
regexp- The regular expression string, in Java format. SeePatternfor more information.
-
set_label_exclude_regexp
Description copied from interface:SceneAPISet 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_regexpin interfaceSceneAPI- Parameters:
regexp- The regular expression string, in Java format. SeePatternfor more information.
-
clear_label_filter_regexps
public void clear_label_filter_regexps()Description copied from interface:SceneAPIClears 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_regexpsin interfaceSceneAPI
-
set_mute_label
Description copied from interface:SceneAPIMute 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 withfalsedoes 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
labelscomponent type.This setting is temporary and will not persist after a restart.
- Specified by:
set_mute_labelin interfaceSceneAPI- Parameters:
name- The object name.mute- Whether to mute the label for the object or not.
-
set_label_color
Description copied from interface:SceneAPISet 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_colorin 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:SceneAPIGets the value of the force display label flag for the object identified by the givenname.- Specified by:
get_force_display_labelin 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:SceneAPISet the global line width factor. This is a multiplier that applies to all lines.- Specified by:
set_line_width_factorin interfaceSceneAPI- Parameters:
factor- Factor inConstants.MIN_LINE_WIDTHandConstants.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:SceneAPISet 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_factorin 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:SceneAPISet the color mode of the velocity vectors (proper motions).- Specified by:
set_velocity_vectors_color_modein 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:SceneAPISpecify whether arrowheads should be displayed on velocity vectors.- Specified by:
set_velocity_vectors_arrowheadsin 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:SceneAPISet 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_factorin 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:SceneAPIReturn 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_numberin 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:SceneAPISet 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_numberin interfaceSceneAPI- Parameters:
num- The maximum number of proper motion vectors per star group.
-
add_trajectory_line
Description copied from interface:SceneAPIAdd 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_linein 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:SceneAPIAdd 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_linein 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:SceneAPIAdd 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_polylinein 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:SceneAPIAdd 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_polylinein 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:SceneAPIAdd 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_polylinein 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:SceneAPIAdd 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_polylinein 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:SceneAPIAdd 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_polylinein 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:SceneAPIRemove 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_objectin 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:SceneAPIAdd 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_objectin 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:SceneAPIAdd 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_objectin 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.
-
createNewProceduralGalaxy
public Pair<com.badlogic.ashley.core.Entity, com.badlogic.ashley.core.Entity> createNewProceduralGalaxy(String name, double radius, Vector3Q pos, GalaxyGenerator.GalaxyMorphology morphology) Creates a new procedural galaxy entity and sets up the billboard datasets. The galaxy is split into two separate entities, one for the full-resolution channel (stars, HII, label), and one for the half-resolution channel (gas, dust, bulge).- Parameters:
name- The name of the entity.radius- The radius of the galaxy in internal units.pos- The position of the galaxy.- Returns:
- The full- and half-resolution entities that conform the galaxy, in a pair. The first one is the full-resolution, and the second one is the half-resolution.
-
notify
-