TrajectoryArtist Derived Type

type, public, abstract :: TrajectoryArtist

The base of the trajectory artists (OpenFrames' TrajectoryArtist).


Inherits

type~~trajectoryartist~~InheritsGraph type~trajectoryartist TrajectoryArtist type~referenceframe ReferenceFrame type~trajectoryartist->type~referenceframe shown_in, data_frame, seen_data_frame type~trajectory Trajectory type~trajectoryartist->type~trajectory traj type~referenceframe->type~referenceframe follow_frame_ c_ptr c_ptr type~referenceframe->c_ptr light_node, light_switch, node_, contents_node, axis_node, axis_label_node, axis_arrow, axis_text, name_label_node, name_text type~framepointer FramePointer type~referenceframe->type~framepointer children, parents type~trajectoryfollower TrajectoryFollower type~referenceframe->type~trajectoryfollower follower_ type~framepointer->type~referenceframe p type~datasource DataSource type~trajectoryfollower->type~datasource sources_ type~trajectorypointer TrajectoryPointer type~trajectoryfollower->type~trajectorypointer trajs type~trajectorypointer->type~trajectory p

Inherited by

type~~trajectoryartist~~InheritedByGraph type~trajectoryartist TrajectoryArtist type~artistpointer ArtistPointer type~artistpointer->type~trajectoryartist p type~chainartist ChainArtist type~chainartist->type~trajectoryartist type~markerartist MarkerArtist type~markerartist->type~trajectoryartist type~segmentartist SegmentArtist type~segmentartist->type~trajectoryartist type~curveartist CurveArtist type~curveartist->type~chainartist type~drawabletrajectory DrawableTrajectory type~drawabletrajectory->type~artistpointer artists type~ribbonartist RibbonArtist type~ribbonartist->type~chainartist

Components

Type Visibility Attributes Name Initial
class(ReferenceFrame), private, pointer :: data_frame => null()

the frame the data are in (null: shown_in's)

logical, private :: pickable_ = .true.

picked (pick)

class(ReferenceFrame), private, pointer :: seen_data_frame => null()

the data frame drawn for

integer, private :: seen_generation = -1

trajectory generation and revision drawn (-1: none)

integer, private :: seen_motion(4) = -1

both frames' motion keys drawn for (-1: not transformed)

integer, private :: seen_revision = -1

trajectory generation and revision drawn (-1: none)

class(ReferenceFrame), private, pointer :: shown_in => null()

the DrawableTrajectory drawing it (its points' coordinates)

logical, private :: trace = .false.

trace mode: drawn up to the current time

type(Trajectory), private, pointer :: traj => null()

the trajectory drawn (not owned; null if none)


Type-Bound Procedures

procedure(artist_build), public, deferred :: build

  • subroutine artist_build(self, viewer, group) Prototype

    Create the artist's render nodes under group. viewer (may be null) compiles the nodes it creates later.

    Arguments

    Type IntentOptional Attributes Name
    class(TrajectoryArtist), intent(inout) :: self
    type(c_ptr), intent(in) :: viewer

    compiles nodes made later (may be null); the parent group

    type(c_ptr), intent(in) :: group

    compiles nodes made later (may be null); the parent group

procedure, public :: get_trajectory

  • private function get_trajectory(self) result(traj)

    The trajectory drawn (null if none).

    Arguments

    Type IntentOptional Attributes Name
    class(TrajectoryArtist), intent(in) :: self

    Return Value type(Trajectory), pointer

procedure, public :: pickable => artist_pickable

  • private pure function artist_pickable(self)

    Whether pick tests what this artist draws.

    Arguments

    Type IntentOptional Attributes Name
    class(TrajectoryArtist), intent(in) :: self

    Return Value logical

procedure, public :: release => artist_release

  • private subroutine artist_release(self)

    Forget the render nodes (after the artist's group was removed from the scene): build starts again.

    Arguments

    Type IntentOptional Attributes Name
    class(TrajectoryArtist), intent(inout) :: self

procedure, public :: set_pickable => artist_set_pickable

  • private subroutine artist_set_pickable(self, pickable)

    Whether pick tests what this artist draws (default true; e.g. false for a spacecraft's marker beside its orbit's curve).

    Arguments

    Type IntentOptional Attributes Name
    class(TrajectoryArtist), intent(inout) :: self
    logical, intent(in) :: pickable

    true: picked (default)

procedure, public :: set_trace_mode

  • private subroutine set_trace_mode(self, enabled)

    Draw only the part up to the current time (see the module documentation).

    Arguments

    Type IntentOptional Attributes Name
    class(TrajectoryArtist), intent(inout) :: self
    logical, intent(in) :: enabled

    true: draw only up to the current time

procedure, public :: set_trajectory

  • private subroutine set_trajectory(self, traj)

    Draw traj (it must stay alive while drawn).

    Arguments

    Type IntentOptional Attributes Name
    class(TrajectoryArtist), intent(inout) :: self
    type(Trajectory), intent(in), target :: traj

    the trajectory to draw (not owned)

procedure, public :: trace_mode

  • private pure function trace_mode(self)

    Whether only the part up to the current time is drawn.

    Arguments

    Type IntentOptional Attributes Name
    class(TrajectoryArtist), intent(in) :: self

    Return Value logical

procedure(artist_update), public, deferred :: update

  • subroutine artist_update(self, t) Prototype

    Bring the drawing up to date with the trajectory at simulation time t.

    Arguments

    Type IntentOptional Attributes Name
    class(TrajectoryArtist), intent(inout) :: self
    real(kind=wp), intent(in) :: t

    the current time

Source Code

    type, abstract, public :: TrajectoryArtist
        private
        type(Trajectory), pointer :: traj => null()  !! the trajectory drawn (not owned; null if none)
        logical :: trace = .false.                  !! trace mode: drawn up to the current time
        logical :: pickable_ = .true.               !! picked ([[WindowProxy:pick]])
        ! the frames (set by the DrawableTrajectory drawing it, when it updates or picks)
        class(ReferenceFrame), pointer :: shown_in => null()    !! the DrawableTrajectory drawing it (its points' coordinates)
        class(ReferenceFrame), pointer :: data_frame => null()  !! the frame the data are in (null: shown_in's)
        ! what was drawn
        integer :: seen_generation = -1, seen_revision = -1  !! trajectory generation and revision drawn (-1: none)
        integer :: seen_motion(4) = -1                      !! both frames' motion keys drawn for (-1: not transformed)
        class(ReferenceFrame), pointer :: seen_data_frame => null()  !! the data frame drawn for
    contains
        procedure :: set_trajectory, get_trajectory
        procedure :: set_trace_mode, trace_mode
        procedure :: set_pickable => artist_set_pickable, pickable => artist_pickable
        procedure :: release => artist_release
        procedure(artist_build), deferred :: build
        procedure(artist_update), deferred :: update
    end type TrajectoryArtist