vkf_shapes Module

Reference shapes, as OpenFrames' frames of the same names: CoordinateAxes (axis lines with tick marks), LatLonGrid (latitude and longitude lines on an ellipsoid), RadialPlane (a transparent disk with circles and radial lines) and cones (PolyhedralCone, and its EllipticCone and RectangularCone: e.g. sensor fields of view); and (not in OpenFrames) Polyhedron, any surface of polygons or triangles, or a grid of points (e.g. a tube of trajectories), fixed in its frame, lit or not, opaque or translucent.

Each is a frame drawing in its own coordinates. Its drawing is made when a window first shows it and made again when a setting changes (also while shown; the new nodes are compiled and swapped in). Lines are vkframes' double-precision lines (widths in window units); tick marks are markers (MarkerArtist's shapes); surfaces are unlit and transparent, seen from both sides, and write no depth (as OpenFrames'), except a Polyhedron's when lit. Surfaces are made by one routine (surface_node), as their lines (line_node) and points (marker_node).


Uses

  • module~~vkf_shapes~~UsesGraph module~vkf_shapes vkf_shapes iso_c_binding iso_c_binding module~vkf_shapes->iso_c_binding iso_fortran_env iso_fortran_env module~vkf_shapes->iso_fortran_env module~vkf_artists vkf_artists module~vkf_shapes->module~vkf_artists module~vkf_files vkf_files module~vkf_shapes->module~vkf_files module~vkf_frames vkf_frames module~vkf_shapes->module~vkf_frames module~vkf_layer vkf_layer module~vkf_shapes->module~vkf_layer module~vkf_math vkf_math module~vkf_shapes->module~vkf_math module~vkf_artists->iso_c_binding module~vkf_artists->module~vkf_frames module~vkf_artists->module~vkf_layer module~vkf_artists->module~vkf_math module~vkf_line_chain vkf_line_chain module~vkf_artists->module~vkf_line_chain module~vkf_pick vkf_pick module~vkf_artists->module~vkf_pick module~vkf_trajectory vkf_trajectory module~vkf_artists->module~vkf_trajectory module~vkf_frames->iso_c_binding module~vkf_frames->module~vkf_layer module~vkf_frames->module~vkf_math module~vkf_follower vkf_follower module~vkf_frames->module~vkf_follower module~vkf_geometry vkf_geometry module~vkf_frames->module~vkf_geometry module~vkf_frames->module~vkf_pick module~vkf_text vkf_text module~vkf_frames->module~vkf_text module~vkf_frames->module~vkf_trajectory module~vkf_layer->iso_c_binding module~vkf_math->iso_fortran_env module~vkf_follower->module~vkf_math module~vkf_follower->module~vkf_trajectory module~vkf_geometry->iso_c_binding module~vkf_geometry->module~vkf_layer module~vkf_geometry->module~vkf_math module~vkf_line_chain->iso_c_binding module~vkf_line_chain->module~vkf_layer module~vkf_line_chain->module~vkf_math module~vkf_pick->module~vkf_math module~vkf_text->iso_c_binding module~vkf_text->module~vkf_files module~vkf_text->module~vkf_layer module~vkf_text->module~vkf_math module~vkf_trajectory->iso_c_binding module~vkf_trajectory->iso_fortran_env module~vkf_trajectory->module~vkf_math

Used by

  • module~~vkf_shapes~~UsedByGraph module~vkf_shapes vkf_shapes module~vkframes vkframes module~vkframes->module~vkf_shapes

Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: CONE_ALL = 7

CONE_SIDES + CONE_EDGES + CONE_BASE_OUTLINE

integer, public, parameter :: CONE_BASE_OUTLINE = 4

What a cone draws (OpenFrames' PolyhedralCone::DrawMode; combine with ior).

integer, public, parameter :: CONE_EDGES = 2

What a cone draws (OpenFrames' PolyhedralCone::DrawMode; combine with ior).

integer, public, parameter :: CONE_NONE = 0

What a cone draws (OpenFrames' PolyhedralCone::DrawMode; combine with ior).

integer, public, parameter :: CONE_SIDES = 1

What a cone draws (OpenFrames' PolyhedralCone::DrawMode; combine with ior).

integer, public, parameter :: POLY_ALL = 7

POLY_FACES + POLY_EDGES + POLY_VERTICES

integer, public, parameter :: POLY_EDGES = 2

What a Polyhedron draws (combine with ior).

integer, public, parameter :: POLY_FACES = 1

What a Polyhedron draws (combine with ior).

integer, public, parameter :: POLY_NONE = 0

What a Polyhedron draws (combine with ior).

integer, public, parameter :: POLY_VERTICES = 4

What a Polyhedron draws (combine with ior).


Interfaces

public interface CoordinateAxes

The CoordinateAxes constructor: CoordinateAxes(...) makes one (see new_coordinate_axes for its arguments).

  • private function new_coordinate_axes(name, color) result(a)

    Coordinate axes named name, of color color ([r, g, b] or [r, g, b, a]), 1 long, with major ticks every 0.5 and minor every 0.25 (OpenFrames' defaults).

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: name

    the frame's name

    real(kind=wp), intent(in), optional :: color(:)

    [r, g, b] or [r, g, b, a] (0 to 1)

    Return Value type(CoordinateAxes)

public interface EllipticCone

The EllipticCone constructor: EllipticCone(...) makes one (see new_elliptic_cone for its arguments).

  • private function new_elliptic_cone(name, color) result(c)

    An elliptic cone named name, of color color (sides and base outline drawn).

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: name

    the frame's name

    real(kind=wp), intent(in), optional :: color(:)

    [r, g, b] or [r, g, b, a] (0 to 1)

    Return Value type(EllipticCone)

public interface LatLonGrid

The LatLonGrid constructor: LatLonGrid(...) makes one (see new_lat_lon_grid for its arguments).

  • private function new_lat_lon_grid(name, color) result(g)

    A latitude/longitude grid named name, of color color, on a unit sphere, every 30 degrees (OpenFrames' defaults).

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: name

    the frame's name

    real(kind=wp), intent(in), optional :: color(:)

    [r, g, b] or [r, g, b, a] (0 to 1)

    Return Value type(LatLonGrid)

public interface PolyhedralCone

The PolyhedralCone constructor: PolyhedralCone(...) makes one (see new_polyhedral_cone for its arguments).

  • private function new_polyhedral_cone(name, color) result(c)

    A polyhedral cone named name, of color color (its sides and lines): 3 vertices at clock angles 0, 120 and 240 degrees, cone angles 45 degrees, 1 long (OpenFrames' defaults).

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: name

    the frame's name

    real(kind=wp), intent(in), optional :: color(:)

    [r, g, b] or [r, g, b, a] (0 to 1)

    Return Value type(PolyhedralCone)

public interface Polyhedron

The Polyhedron constructor: Polyhedron(...) makes one (see new_polyhedron for its arguments).

  • private function new_polyhedron(name, color) result(p)

    A polyhedron named name, of color color (its faces, edges and vertices), with no faces yet (set_faces, set_triangles or set_grid).

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: name

    the frame's name

    real(kind=wp), intent(in), optional :: color(:)

    [r, g, b] or [r, g, b, a] (0 to 1)

    Return Value type(Polyhedron)

public interface RadialPlane

The RadialPlane constructor: RadialPlane(...) makes one (see new_radial_plane for its arguments).

  • private function new_radial_plane(name, color) result(p)

    A radial plane named name (decorations of color color): radius 1, circles every 0.5, radial lines every 30 degrees, light gray and transparent (OpenFrames' defaults).

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: name

    the frame's name

    real(kind=wp), intent(in), optional :: color(:)

    [r, g, b] or [r, g, b, a] (0 to 1)

    Return Value type(RadialPlane)

public interface RectangularCone

The RectangularCone constructor: RectangularCone(...) makes one (see new_rectangular_cone for its arguments).

  • private function new_rectangular_cone(name, color) result(c)

    A rectangular cone named name, of color color.

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: name

    the frame's name

    real(kind=wp), intent(in), optional :: color(:)

    [r, g, b] or [r, g, b, a] (0 to 1)

    Return Value type(RectangularCone)


Derived Types

type, public, extends(ReferenceFrame) ::  CoordinateAxes

Coordinate axes with tick marks (OpenFrames' CoordinateAxes): lines from the origin along x, y and z, major and minor tick marks at their spacings, in the frame's color. Tick marks shrink beyond the axis length from the camera (OpenFrames' tick attenuation). The frame's own axes (arrows) are moved to the lines' ends when the length is set (as OpenFrames'); move them after that with move_x_axis, ..., or, for axes on a body, hide them (show_axes(NO_AXES)) and show the body's, which start at its surface.

Components

Type Visibility Attributes Name Initial
integer, private :: drawn = ALL_AXES

axes drawn: an ior of X_AXIS, Y_AXIS, Z_AXIS

type(c_ptr), private :: image = c_null_ptr

tick image handle (null: none)

character(len=:), private, allocatable :: image_file

tick image file ('' for none)

real(kind=wp), private :: length_ = 1.0_wp

axis length (scene units; default 1)

real(kind=wp), private :: major = 0.5_wp

major tick spacing (scene units; 0: none)

real(kind=wp), private :: major_size = 8.0_wp

major tick size (window units)

real(kind=wp), private :: minor = 0.25_wp

minor tick spacing (scene units; 0: none)

real(kind=wp), private :: minor_size = 4.0_wp

minor tick size (window units)

type(ShapeNodes), private :: nodes

the drawing

integer, private :: shape_ = MARKER_DISK

tick shape: a MARKER_* shape

real(kind=wp), private :: width_ = 1.0_wp

axis lines' width (window units; default 1)

Constructor

The CoordinateAxes constructor: CoordinateAxes(...) makes one (see new_coordinate_axes for its arguments).

private function new_coordinate_axes (name, color)

Coordinate axes named name, of color color ([r, g, b] or [r, g, b, a]), 1 long, with major ticks every 0.5 and minor every 0.25 (OpenFrames' defaults).

Type-Bound Procedures

procedure, public :: add_child
procedure, public :: attitude
procedure, public :: axes_labels_shown
procedure, public :: axes_shown
procedure, public :: axis_label
procedure, public :: axis_length
procedure, public :: axis_width
procedure, public :: bound => axes_bound
procedure, public :: build_contents => axes_build_contents
procedure, public :: child
procedure, public :: child_index
procedure, public :: color
procedure, public :: contents_shown
procedure, public :: detach
procedure, public :: draw_axes
procedure, public :: follow
procedure, public :: follow_frame
procedure, public :: follower
procedure, public :: frame_info => axes_frame_info
procedure, public :: frame_string
procedure, public :: has_light_source
procedure, public :: is_following
procedure, public :: label_alignment
procedure, public :: label_font
procedure, public :: label_size
procedure, public :: late_update
procedure, public :: light_ambient
procedure, public :: light_diffuse
procedure, public :: light_source_enabled
procedure, public :: light_specular
procedure, public :: local_matrix
procedure, public :: local_matrix_at
procedure, public :: motion_key
procedure, public :: move_x_axis
procedure, public :: move_y_axis
procedure, public :: move_z_axis
procedure, public :: name
procedure, public :: name_label_on_top
procedure, public :: name_label_shown
procedure, public :: node
procedure, public :: num_children
procedure, public :: num_parents
procedure, public :: parent
procedure, public :: parent_index
procedure, public :: pick
procedure, public :: pickable
procedure, public :: position
procedure, public :: position_of
procedure, public :: realize
procedure, public :: remove_child
procedure, public :: reposition_axes
procedure, public :: set_attitude
procedure, public :: set_axis_length
procedure, public :: set_axis_width
procedure, public :: set_color => axes_set_color
procedure, public :: set_draw_axes
procedure, public :: set_label_alignment
procedure, public :: set_label_font
procedure, public :: set_label_size
procedure, public :: set_light_ambient
procedure, public :: set_light_diffuse
procedure, public :: set_light_source_enabled
procedure, public :: set_light_specular
procedure, public :: set_name
procedure, public :: set_name_label_on_top
procedure, public :: set_pickable
procedure, public :: set_position
procedure, public :: set_tick_image
procedure, public :: set_tick_shape
procedure, public :: set_tick_size
procedure, public :: set_tick_spacing
procedure, public :: set_x_label
procedure, public :: set_y_label
procedure, public :: set_z_label
procedure, public :: show_axes
procedure, public :: show_axes_labels
procedure, public :: show_contents
procedure, public :: show_decorations
procedure, public :: show_name_label
procedure, public :: sync
procedure, public :: tick_image
procedure, public :: tick_shape
procedure, public :: tick_size
procedure, public :: tick_spacing
procedure, public :: unfollow
procedure, public :: update
procedure, public :: world_matrix
procedure, public :: world_matrix_at

type, public, extends(PolyhedralCone) ::  EllipticCone

An elliptic cone (OpenFrames' EllipticCone): half-angles a along x and b along y (set_primary_angles; default 60 and 30 degrees).

Components

Type Visibility Attributes Name Initial
real(kind=wp), private :: a = 60.0_wp*pi/180.0_wp

half-angle along x (radians)

real(kind=wp), private :: b = 30.0_wp*pi/180.0_wp

half-angle along y (radians)

Constructor

The EllipticCone constructor: EllipticCone(...) makes one (see new_elliptic_cone for its arguments).

private function new_elliptic_cone (name, color)

An elliptic cone named name, of color color (sides and base outline drawn).

Type-Bound Procedures

procedure, public :: add_child
procedure, public :: attitude
procedure, public :: axes_labels_shown
procedure, public :: axes_shown
procedure, public :: axis_label
procedure, public :: bound => cone_bound
procedure, public :: build_contents => cone_build_contents
procedure, public :: child
procedure, public :: child_index
procedure, public :: clock_angles
procedure, public :: color
procedure, public :: cone_angles
procedure, public :: cone_color
procedure, public :: cone_length
procedure, public :: contents_shown
procedure, public :: detach
procedure, public :: draw_mode
procedure, public :: follow
procedure, public :: follow_frame
procedure, public :: follower
procedure, public :: frame_info => elliptic_frame_info
procedure, public :: frame_string
procedure, public :: has_light_source
procedure, public :: is_following
procedure, public :: is_visible => elliptic_is_visible
procedure, public :: label_alignment
procedure, public :: label_font
procedure, public :: label_size
procedure, public :: late_update
procedure, public :: light_ambient
procedure, public :: light_diffuse
procedure, public :: light_source_enabled
procedure, public :: light_specular
procedure, public :: line_color => cone_line_color
procedure, public :: local_matrix
procedure, public :: local_matrix_at
procedure, public :: make_cone_look_at
procedure, public :: motion_key
procedure, public :: move_x_axis
procedure, public :: move_y_axis
procedure, public :: move_z_axis
procedure, public :: name
procedure, public :: name_label_on_top
procedure, public :: name_label_shown
procedure, public :: node
procedure, public :: num_children
procedure, public :: num_parents
procedure, public :: parent
procedure, public :: parent_index
procedure, public :: pick
procedure, public :: pickable
procedure, public :: position
procedure, public :: position_of
procedure, public :: primary_angles => elliptic_primary_angles
procedure, public :: realize
procedure, public :: remove_child
procedure, public :: reposition_axes
procedure, public :: set_attitude
procedure, public :: set_color
procedure, public :: set_cone_color
procedure, public :: set_cone_length
procedure, public :: set_draw_mode
procedure, public :: set_label_alignment
procedure, public :: set_label_font
procedure, public :: set_label_size
procedure, public :: set_light_ambient
procedure, public :: set_light_diffuse
procedure, public :: set_light_source_enabled
procedure, public :: set_light_specular
procedure, public :: set_line_color => cone_set_line_color
procedure, public :: set_name
procedure, public :: set_name_label_on_top
procedure, public :: set_pickable
procedure, public :: set_position
procedure, public :: set_primary_angles => elliptic_set_primary_angles
procedure, public :: set_vertex_angles
procedure, public :: set_x_label
procedure, public :: set_y_label
procedure, public :: set_z_label
procedure, public :: show_axes
procedure, public :: show_axes_labels
procedure, public :: show_contents
procedure, public :: show_decorations
procedure, public :: show_name_label
procedure, public :: sync
procedure, public :: unfollow
procedure, public :: update
procedure, public :: world_matrix
procedure, public :: world_matrix_at

type, public, extends(ReferenceFrame) ::  LatLonGrid

Latitude and longitude lines on an ellipsoid (OpenFrames' LatLonGrid): at geodetic latitudes (matching a Sphere's texture), every lat_spacing from the equator and every lon_spacing from the prime meridian (the equator and prime meridian thicker), in the frame's color.

Components

Type Visibility Attributes Name Initial
real(kind=wp), private :: lat_spacing = 30.0_wp*pi/180.0_wp

between latitude lines (radians; 0: none)

real(kind=wp), private :: lon_spacing = 30.0_wp*pi/180.0_wp

between meridians (radians; 0: none)

real(kind=wp), private :: main_width = 3.0_wp

equator's and prime meridian's width (window units)

type(ShapeNodes), private :: nodes

the drawing

real(kind=wp), private :: radii_(3) = 1.0_wp

the ellipsoid's semi-axes (scene units)

real(kind=wp), private :: width_ = 1.0_wp

grid lines' width (window units)

Constructor

The LatLonGrid constructor: LatLonGrid(...) makes one (see new_lat_lon_grid for its arguments).

private function new_lat_lon_grid (name, color)

A latitude/longitude grid named name, of color color, on a unit sphere, every 30 degrees (OpenFrames' defaults).

Type-Bound Procedures

procedure, public :: add_child
procedure, public :: attitude
procedure, public :: axes_labels_shown
procedure, public :: axes_shown
procedure, public :: axis_label
procedure, public :: bound => grid_bound
procedure, public :: build_contents => grid_build_contents
procedure, public :: child
procedure, public :: child_index
procedure, public :: color
procedure, public :: contents_shown
procedure, public :: detach
procedure, public :: follow
procedure, public :: follow_frame
procedure, public :: follower
procedure, public :: frame_info => grid_frame_info
procedure, public :: frame_string
procedure, public :: has_light_source
procedure, public :: is_following
procedure, public :: label_alignment
procedure, public :: label_font
procedure, public :: label_size
procedure, public :: late_update
procedure, public :: light_ambient
procedure, public :: light_diffuse
procedure, public :: light_source_enabled
procedure, public :: light_specular
procedure, public :: line_widths
procedure, public :: local_matrix
procedure, public :: local_matrix_at
procedure, public :: motion_key
procedure, public :: move_x_axis
procedure, public :: move_y_axis
procedure, public :: move_z_axis
procedure, public :: name
procedure, public :: name_label_on_top
procedure, public :: name_label_shown
procedure, public :: node
procedure, public :: num_children
procedure, public :: num_parents
procedure, public :: parameters => grid_parameters
procedure, public :: parent
procedure, public :: parent_index
procedure, public :: pick
procedure, public :: pickable
procedure, public :: position
procedure, public :: position_of
procedure, public :: realize
procedure, public :: remove_child
procedure, public :: reposition_axes
procedure, public :: set_attitude
procedure, public :: set_color => grid_set_color
procedure, public :: set_label_alignment
procedure, public :: set_label_font
procedure, public :: set_label_size
procedure, public :: set_light_ambient
procedure, public :: set_light_diffuse
procedure, public :: set_light_source_enabled
procedure, public :: set_light_specular
procedure, public :: set_line_widths
procedure, public :: set_name
procedure, public :: set_name_label_on_top
procedure, public :: set_parameters => grid_set_parameters
procedure, public :: set_pickable
procedure, public :: set_position
procedure, public :: set_x_label
procedure, public :: set_y_label
procedure, public :: set_z_label
procedure, public :: show_axes
procedure, public :: show_axes_labels
procedure, public :: show_contents
procedure, public :: show_decorations
procedure, public :: show_name_label
procedure, public :: sync
procedure, public :: unfollow
procedure, public :: update
procedure, public :: world_matrix
procedure, public :: world_matrix_at

type, public, extends(ReferenceFrame) ::  PolyhedralCone

A cone of polygonal cross-section (OpenFrames' PolyhedralCone), with its apex at the origin and boresight along -z: vertex i at clock angle clock(i) (from +x toward +y) and cone angle cone(i) (from the boresight), cone_length along the boresight. Drawn as transparent sides, edges from the apex and the base outline (set_draw_mode).

Components

Type Visibility Attributes Name Initial
real(kind=wp), private, allocatable :: clock(:)

vertices' clock angles (radians, from +x toward +y)

real(kind=wp), private, allocatable :: cone(:)

vertices' cone angles (radians, from the boresight)

real(kind=wp), private :: cone_color_(4) = 1.0_wp

sides' color [r, g, b, a]

real(kind=wp), private :: length_ = 1.0_wp

length along the boresight (scene units)

real(kind=wp), private :: line_color_(4) = 1.0_wp

edges' and base outline's color [r, g, b, a]

integer, private :: mode = CONE_ALL

an ior of CONE_SIDES, CONE_EDGES, CONE_BASE_OUTLINE

type(ShapeNodes), private :: nodes

the drawing

real(kind=wp), private :: width_ = 1.0_wp

edges' and base outline's width (window units)

Constructor

The PolyhedralCone constructor: PolyhedralCone(...) makes one (see new_polyhedral_cone for its arguments).

private function new_polyhedral_cone (name, color)

A polyhedral cone named name, of color color (its sides and lines): 3 vertices at clock angles 0, 120 and 240 degrees, cone angles 45 degrees, 1 long (OpenFrames' defaults).

Type-Bound Procedures

procedure, public :: add_child
procedure, public :: attitude
procedure, public :: axes_labels_shown
procedure, public :: axes_shown
procedure, public :: axis_label
procedure, public :: bound => cone_bound
procedure, public :: build_contents => cone_build_contents
procedure, public :: child
procedure, public :: child_index
procedure, public :: clock_angles
procedure, public :: color
procedure, public :: cone_angles
procedure, public :: cone_color
procedure, public :: cone_length
procedure, public :: contents_shown
procedure, public :: detach
procedure, public :: draw_mode
procedure, public :: follow
procedure, public :: follow_frame
procedure, public :: follower
procedure, public :: frame_info => cone_frame_info
procedure, public :: frame_string
procedure, public :: has_light_source
procedure, public :: is_following
procedure, public :: is_visible => cone_is_visible
procedure, public :: label_alignment
procedure, public :: label_font
procedure, public :: label_size
procedure, public :: late_update
procedure, public :: light_ambient
procedure, public :: light_diffuse
procedure, public :: light_source_enabled
procedure, public :: light_specular
procedure, public :: line_color => cone_line_color
procedure, public :: local_matrix
procedure, public :: local_matrix_at
procedure, public :: make_cone_look_at
procedure, public :: motion_key
procedure, public :: move_x_axis
procedure, public :: move_y_axis
procedure, public :: move_z_axis
procedure, public :: name
procedure, public :: name_label_on_top
procedure, public :: name_label_shown
procedure, public :: node
procedure, public :: num_children
procedure, public :: num_parents
procedure, public :: parent
procedure, public :: parent_index
procedure, public :: pick
procedure, public :: pickable
procedure, public :: position
procedure, public :: position_of
procedure, public :: realize
procedure, public :: remove_child
procedure, public :: reposition_axes
procedure, public :: set_attitude
procedure, public :: set_color
procedure, public :: set_cone_color
procedure, public :: set_cone_length
procedure, public :: set_draw_mode
procedure, public :: set_label_alignment
procedure, public :: set_label_font
procedure, public :: set_label_size
procedure, public :: set_light_ambient
procedure, public :: set_light_diffuse
procedure, public :: set_light_source_enabled
procedure, public :: set_light_specular
procedure, public :: set_line_color => cone_set_line_color
procedure, public :: set_name
procedure, public :: set_name_label_on_top
procedure, public :: set_pickable
procedure, public :: set_position
procedure, public :: set_vertex_angles
procedure, public :: set_x_label
procedure, public :: set_y_label
procedure, public :: set_z_label
procedure, public :: show_axes
procedure, public :: show_axes_labels
procedure, public :: show_contents
procedure, public :: show_decorations
procedure, public :: show_name_label
procedure, public :: sync
procedure, public :: unfollow
procedure, public :: update
procedure, public :: world_matrix
procedure, public :: world_matrix_at

type, public, extends(ReferenceFrame) ::  Polyhedron

A surface fixed in its frame (not in OpenFrames): vertices and faces, given as polygons (set_faces: e.g. a polyhedron's), triangles (set_triangles) or a grid of points (set_grid: e.g. a tube of trajectories, an invariant manifold). Drawn as faces, edges (the polygons' outlines, the triangles' sides, or the grid's lines) and vertices (set_draw_mode).

Read more…

Components

Type Visibility Attributes Name Initial
integer, private, allocatable :: edge(:,:)

edges (2, k), vertex numbers

real(kind=wp), private :: face_color_(4) = 1.0_wp

faces' color [r, g, b, a]

real(kind=wp), private :: line_color_(4) = 1.0_wp

edges' color

logical, private :: lit_ = .true.

lit by the scene's lights (else unlit, transparent)

integer, private :: mode = ior(POLY_FACES, POLY_EDGES)

an ior of POLY_FACES, POLY_EDGES, POLY_VERTICES

type(ShapeNodes), private :: nodes

the drawing

real(kind=wp), private :: opacity_ = 1.0_wp

the faces' (times their colors' alpha)

real(kind=wp), private :: point_color_(4) = 1.0_wp

vertices' color

real(kind=wp), private :: point_size_ = 6.0_wp

vertices' size (window units)

logical, private :: smooth_ = .false.

normals smooth across the vertices (else flat faces)

integer, private, allocatable :: tri(:,:)

triangles (3, m), vertex numbers (1-based)

logical, private :: two_sided_ = .true.

both sides drawn (and lit)

real(kind=wp), private, allocatable :: v(:,:)

vertices (3, n), frame coordinates

real(kind=wp), private, allocatable :: vertex_colors_(:,:)

a color per vertex (4, n) (none: the face color)

real(kind=wp), private :: width_ = 1.0_wp

edges' width (window units)

Constructor

The Polyhedron constructor: Polyhedron(...) makes one (see new_polyhedron for its arguments).

private function new_polyhedron (name, color)

A polyhedron named name, of color color (its faces, edges and vertices), with no faces yet (set_faces, set_triangles or set_grid).

Type-Bound Procedures

procedure, public :: add_child
procedure, public :: attitude
procedure, public :: axes_labels_shown
procedure, public :: axes_shown
procedure, public :: axis_label
procedure, public :: bound => poly_bound
procedure, public :: build_contents => poly_build_contents
procedure, public :: child
procedure, public :: child_index
procedure, public :: color
procedure, public :: contents_shown
procedure, public :: detach
procedure, public :: draw_mode => poly_draw_mode
procedure, public :: face_color
procedure, public :: follow
procedure, public :: follow_frame
procedure, public :: follower
procedure, public :: frame_info => poly_frame_info
procedure, public :: frame_string
procedure, public :: has_light_source
procedure, public :: has_vertex_colors
procedure, public :: is_following
procedure, public :: label_alignment
procedure, public :: label_font
procedure, public :: label_size
procedure, public :: late_update
procedure, public :: light_ambient
procedure, public :: light_diffuse
procedure, public :: light_source_enabled
procedure, public :: light_specular
procedure, public :: line_color => poly_line_color
procedure, public :: line_width => poly_line_width
procedure, public :: lit
procedure, public :: local_matrix
procedure, public :: local_matrix_at
procedure, public :: motion_key
procedure, public :: move_x_axis
procedure, public :: move_y_axis
procedure, public :: move_z_axis
procedure, public :: name
procedure, public :: name_label_on_top
procedure, public :: name_label_shown
procedure, public :: node
procedure, public :: num_children
procedure, public :: num_edges
procedure, public :: num_parents
procedure, public :: num_triangles
procedure, public :: num_vertices
procedure, public :: opacity => poly_opacity
procedure, public :: parent
procedure, public :: parent_index
procedure, public :: pick
procedure, public :: pickable
procedure, public :: point_color
procedure, public :: point_size
procedure, public :: position
procedure, public :: position_of
procedure, public :: realize
procedure, public :: remove_child
procedure, public :: remove_vertex_colors
procedure, public :: reposition_axes
procedure, public :: set_attitude
procedure, public :: set_color
procedure, public :: set_draw_mode => poly_set_draw_mode
procedure, public :: set_edges
procedure, public :: set_face_color
procedure, public :: set_faces
procedure, public :: set_grid
procedure, public :: set_label_alignment
procedure, public :: set_label_font
procedure, public :: set_label_size
procedure, public :: set_light_ambient
procedure, public :: set_light_diffuse
procedure, public :: set_light_source_enabled
procedure, public :: set_light_specular
procedure, public :: set_line_color => poly_set_line_color
procedure, public :: set_line_width => poly_set_line_width
procedure, public :: set_lit
procedure, public :: set_name
procedure, public :: set_name_label_on_top
procedure, public :: set_opacity => poly_set_opacity
procedure, public :: set_pickable
procedure, public :: set_point_color
procedure, public :: set_point_size
procedure, public :: set_position
procedure, public :: set_smooth
procedure, public :: set_triangles
procedure, public :: set_two_sided
procedure, public :: set_vertex_colors
procedure, public :: set_vertices
procedure, public :: set_x_label
procedure, public :: set_y_label
procedure, public :: set_z_label
procedure, public :: show_axes
procedure, public :: show_axes_labels
procedure, public :: show_contents
procedure, public :: show_decorations
procedure, public :: show_name_label
procedure, public :: smooth
procedure, public :: sync
procedure, public :: two_sided
procedure, public :: unfollow
procedure, public :: update
procedure, public :: world_matrix
procedure, public :: world_matrix_at

type, public, extends(ReferenceFrame) ::  RadialPlane

A plane disk in the xy plane (OpenFrames' RadialPlane): transparent, with circles every radial_spacing and radial lines every lon_spacing (the one along +x thicker).

Components

Type Visibility Attributes Name Initial
real(kind=wp), private :: line_color_(4) = [1.0_wp, 1.0_wp, 1.0_wp, 0.2_wp]

circles' and radial lines' color [r, g, b, a]

real(kind=wp), private :: lon_spacing = 30.0_wp*pi/180.0_wp

between radial lines (radians; 0: none)

type(ShapeNodes), private :: nodes

the drawing

real(kind=wp), private :: plane_color_(4) = [0.8_wp, 0.8_wp, 0.8_wp, 0.2_wp]

the disk's color [r, g, b, a]

real(kind=wp), private :: radial_spacing = 0.5_wp

between circles (scene units; 0: none)

real(kind=wp), private :: radius_ = 1.0_wp

the disk's radius (scene units)

Constructor

The RadialPlane constructor: RadialPlane(...) makes one (see new_radial_plane for its arguments).

private function new_radial_plane (name, color)

A radial plane named name (decorations of color color): radius 1, circles every 0.5, radial lines every 30 degrees, light gray and transparent (OpenFrames' defaults).

Type-Bound Procedures

procedure, public :: add_child
procedure, public :: attitude
procedure, public :: axes_labels_shown
procedure, public :: axes_shown
procedure, public :: axis_label
procedure, public :: bound => plane_bound
procedure, public :: build_contents => plane_build_contents
procedure, public :: child
procedure, public :: child_index
procedure, public :: color
procedure, public :: contents_shown
procedure, public :: detach
procedure, public :: follow
procedure, public :: follow_frame
procedure, public :: follower
procedure, public :: frame_info => plane_frame_info
procedure, public :: frame_string
procedure, public :: has_light_source
procedure, public :: is_following
procedure, public :: label_alignment
procedure, public :: label_font
procedure, public :: label_size
procedure, public :: late_update
procedure, public :: light_ambient
procedure, public :: light_diffuse
procedure, public :: light_source_enabled
procedure, public :: light_specular
procedure, public :: line_color => plane_line_color
procedure, public :: local_matrix
procedure, public :: local_matrix_at
procedure, public :: motion_key
procedure, public :: move_x_axis
procedure, public :: move_y_axis
procedure, public :: move_z_axis
procedure, public :: name
procedure, public :: name_label_on_top
procedure, public :: name_label_shown
procedure, public :: node
procedure, public :: num_children
procedure, public :: num_parents
procedure, public :: parameters => plane_parameters
procedure, public :: parent
procedure, public :: parent_index
procedure, public :: pick
procedure, public :: pickable
procedure, public :: plane_color
procedure, public :: position
procedure, public :: position_of
procedure, public :: realize
procedure, public :: remove_child
procedure, public :: reposition_axes
procedure, public :: set_attitude
procedure, public :: set_color
procedure, public :: set_label_alignment
procedure, public :: set_label_font
procedure, public :: set_label_size
procedure, public :: set_light_ambient
procedure, public :: set_light_diffuse
procedure, public :: set_light_source_enabled
procedure, public :: set_light_specular
procedure, public :: set_line_color => plane_set_line_color
procedure, public :: set_name
procedure, public :: set_name_label_on_top
procedure, public :: set_parameters => plane_set_parameters
procedure, public :: set_pickable
procedure, public :: set_plane_color
procedure, public :: set_position
procedure, public :: set_x_label
procedure, public :: set_y_label
procedure, public :: set_z_label
procedure, public :: show_axes
procedure, public :: show_axes_labels
procedure, public :: show_contents
procedure, public :: show_decorations
procedure, public :: show_name_label
procedure, public :: sync
procedure, public :: unfollow
procedure, public :: update
procedure, public :: world_matrix
procedure, public :: world_matrix_at

type, public, extends(PolyhedralCone) ::  RectangularCone

A rectangular cone (OpenFrames' RectangularCone): half-angles x and y (set_primary_angles; default 60 and 30 degrees).

Components

Type Visibility Attributes Name Initial
real(kind=wp), private :: x = 60.0_wp*pi/180.0_wp

half-angle along x (radians)

real(kind=wp), private :: y = 30.0_wp*pi/180.0_wp

half-angle along y (radians)

Constructor

The RectangularCone constructor: RectangularCone(...) makes one (see new_rectangular_cone for its arguments).

private function new_rectangular_cone (name, color)

A rectangular cone named name, of color color.

Type-Bound Procedures

procedure, public :: add_child
procedure, public :: attitude
procedure, public :: axes_labels_shown
procedure, public :: axes_shown
procedure, public :: axis_label
procedure, public :: bound => cone_bound
procedure, public :: build_contents => cone_build_contents
procedure, public :: child
procedure, public :: child_index
procedure, public :: clock_angles
procedure, public :: color
procedure, public :: cone_angles
procedure, public :: cone_color
procedure, public :: cone_length
procedure, public :: contents_shown
procedure, public :: detach
procedure, public :: draw_mode
procedure, public :: follow
procedure, public :: follow_frame
procedure, public :: follower
procedure, public :: frame_info => rect_frame_info
procedure, public :: frame_string
procedure, public :: has_light_source
procedure, public :: is_following
procedure, public :: is_visible => cone_is_visible
procedure, public :: label_alignment
procedure, public :: label_font
procedure, public :: label_size
procedure, public :: late_update
procedure, public :: light_ambient
procedure, public :: light_diffuse
procedure, public :: light_source_enabled
procedure, public :: light_specular
procedure, public :: line_color => cone_line_color
procedure, public :: local_matrix
procedure, public :: local_matrix_at
procedure, public :: make_cone_look_at
procedure, public :: motion_key
procedure, public :: move_x_axis
procedure, public :: move_y_axis
procedure, public :: move_z_axis
procedure, public :: name
procedure, public :: name_label_on_top
procedure, public :: name_label_shown
procedure, public :: node
procedure, public :: num_children
procedure, public :: num_parents
procedure, public :: parent
procedure, public :: parent_index
procedure, public :: pick
procedure, public :: pickable
procedure, public :: position
procedure, public :: position_of
procedure, public :: primary_angles => rect_primary_angles
procedure, public :: realize
procedure, public :: remove_child
procedure, public :: reposition_axes
procedure, public :: set_attitude
procedure, public :: set_color
procedure, public :: set_cone_color
procedure, public :: set_cone_length
procedure, public :: set_draw_mode
procedure, public :: set_label_alignment
procedure, public :: set_label_font
procedure, public :: set_label_size
procedure, public :: set_light_ambient
procedure, public :: set_light_diffuse
procedure, public :: set_light_source_enabled
procedure, public :: set_light_specular
procedure, public :: set_line_color => cone_set_line_color
procedure, public :: set_name
procedure, public :: set_name_label_on_top
procedure, public :: set_pickable
procedure, public :: set_position
procedure, public :: set_primary_angles => rect_set_primary_angles
procedure, public :: set_vertex_angles
procedure, public :: set_x_label
procedure, public :: set_y_label
procedure, public :: set_z_label
procedure, public :: show_axes
procedure, public :: show_axes_labels
procedure, public :: show_contents
procedure, public :: show_decorations
procedure, public :: show_name_label
procedure, public :: sync
procedure, public :: unfollow
procedure, public :: update
procedure, public :: world_matrix
procedure, public :: world_matrix_at

type, private ::  ShapeNodes

A shape's nodes: made under the frame's contents, replaced when the shape changes.

Components

Type Visibility Attributes Name Initial
type(c_ptr), public :: contents = c_null_ptr

the frame's contents group (null until built)

type(c_ptr), public :: shape = c_null_ptr

the switch now shown (null: none)

logical, public :: shown = .false.

built for a window: rebuilt nodes are compiled

Type-Bound Procedures

procedure, public :: replace

Functions

private function axes_frame_info(self) result(info)

What kind of frame this is: 'CoordinateAxes'.

Arguments

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

Return Value character(len=:), allocatable

private pure function axis_length(self)

The axes' length (scene units).

Arguments

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

Return Value real(kind=wp)

private pure function axis_width(self)

The axis lines' width (window units).

Arguments

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

Return Value real(kind=wp)

private pure function clock_angles(self) result(a)

The vertices' clock angles (radians).

Arguments

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

Return Value real(kind=wp), allocatable, (:)

private pure function closed_segments(p) result(s)

Points along a closed curve, as separate segments: pairs (p(i), p(i+1)).

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: p(:,:)

(3, n) points of the curve

Return Value real(kind=wp), (3,2*size(p,2))

private pure function cone_angles(self) result(a)

The vertices' cone angles (radians).

Arguments

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

Return Value real(kind=wp), allocatable, (:)

private pure function cone_color(self) result(c)

The sides' color [r, g, b, a].

Arguments

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

Return Value real(kind=wp), (4)

private function cone_frame_info(self) result(info)

What kind of frame this is: 'PolyhedralCone'.

Arguments

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

Return Value character(len=:), allocatable

private function cone_is_visible(self, point, min_distance, max_distance) result(visible)

Whether point (in the cone's frame) is inside the cone, between distances min_distance and max_distance along the boresight (defaults 0 and unlimited): inside the polygon of the vertices' directions (OpenFrames' isVisible; its PolyhedralCone always answers false).

Arguments

Type IntentOptional Attributes Name
class(PolyhedralCone), intent(in) :: self
real(kind=wp), intent(in) :: point(3)

in the cone's frame (scene units)

real(kind=wp), intent(in), optional :: min_distance

along the boresight (scene units)

real(kind=wp), intent(in), optional :: max_distance

along the boresight (scene units)

Return Value logical

private pure function cone_length(self)

The cone's length along the boresight (scene units).

Arguments

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

Return Value real(kind=wp)

private pure function cone_line_color(self) result(c)

The edges' and base outline's color [r, g, b, a].

Arguments

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

Return Value real(kind=wp), (4)

private pure function draw_axes(self)

Which axes are drawn: an ior of X_AXIS, Y_AXIS, Z_AXIS.

Arguments

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

Return Value integer

private pure function draw_mode(self)

What is drawn: an ior of CONE_SIDES, CONE_EDGES, CONE_BASE_OUTLINE.

Arguments

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

Return Value integer

private function elliptic_frame_info(self) result(info)

What kind of frame this is: 'EllipticCone'.

Arguments

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

Return Value character(len=:), allocatable

private function elliptic_is_visible(self, point, min_distance, max_distance) result(visible)

Inside the elliptic cone (exactly; OpenFrames' EllipticCone::isVisible).

Arguments

Type IntentOptional Attributes Name
class(EllipticCone), intent(in) :: self
real(kind=wp), intent(in) :: point(3)

in the cone's frame (scene units)

real(kind=wp), intent(in), optional :: min_distance

along the boresight (scene units)

real(kind=wp), intent(in), optional :: max_distance

along the boresight (scene units)

Return Value logical

private pure function face_color(self) result(c)

The faces' color [r, g, b, a].

Arguments

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

Return Value real(kind=wp), (4)

private function grid_frame_info(self) result(info)

What kind of frame this is: 'LatLonGrid'.

Arguments

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

Return Value character(len=:), allocatable

private pure function has_vertex_colors(self)

Whether the faces have a color per vertex.

Arguments

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

Return Value logical

private pure function in_range(point, min_distance, max_distance)

Along the boresight (-z) between the distances (a point ahead of the apex).

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: point(3)

in the cone's frame (scene units)

real(kind=wp), intent(in), optional :: min_distance

along the boresight (scene units)

real(kind=wp), intent(in), optional :: max_distance

along the boresight (scene units)

Return Value logical

private function line_node(xyz, rgba, width, segments) result(node)

A line node through points xyz(3, n): a strip, or separate segments (points 1-2, 3-4, ...).

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: xyz(:,:)

(3, n) points

real(kind=wp), intent(in) :: rgba(4)

color [r, g, b, a] (0 to 1)

real(kind=wp), intent(in) :: width

line width (window units)

logical, intent(in) :: segments

separate segments (else a strip)

Return Value type(c_ptr)

private pure function lit(self)

Whether the faces are lit.

Arguments

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

Return Value logical

private function marker_node(xyz, rgba, px, shape, radius, image) result(node)

A marker node at points xyz(3, n), px window units (MarkerArtist's shapes and attenuation).

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: xyz(:,:)

(3, n) points

real(kind=wp), intent(in) :: rgba(4)

color [r, g, b, a] (0 to 1)

real(kind=wp), intent(in) :: px

marker size (window units)

integer, intent(in) :: shape

a MARKER_* shape

real(kind=wp), intent(in) :: radius

markers shrink beyond this camera distance (scene units)

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

image for MARKER_IMAGE (null: none)

Return Value type(c_ptr)

private function new_coordinate_axes(name, color) result(a)

Coordinate axes named name, of color color ([r, g, b] or [r, g, b, a]), 1 long, with major ticks every 0.5 and minor every 0.25 (OpenFrames' defaults).

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

the frame's name

real(kind=wp), intent(in), optional :: color(:)

[r, g, b] or [r, g, b, a] (0 to 1)

Return Value type(CoordinateAxes)

private function new_elliptic_cone(name, color) result(c)

An elliptic cone named name, of color color (sides and base outline drawn).

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

the frame's name

real(kind=wp), intent(in), optional :: color(:)

[r, g, b] or [r, g, b, a] (0 to 1)

Return Value type(EllipticCone)

private function new_lat_lon_grid(name, color) result(g)

A latitude/longitude grid named name, of color color, on a unit sphere, every 30 degrees (OpenFrames' defaults).

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

the frame's name

real(kind=wp), intent(in), optional :: color(:)

[r, g, b] or [r, g, b, a] (0 to 1)

Return Value type(LatLonGrid)

private function new_polyhedral_cone(name, color) result(c)

A polyhedral cone named name, of color color (its sides and lines): 3 vertices at clock angles 0, 120 and 240 degrees, cone angles 45 degrees, 1 long (OpenFrames' defaults).

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

the frame's name

real(kind=wp), intent(in), optional :: color(:)

[r, g, b] or [r, g, b, a] (0 to 1)

Return Value type(PolyhedralCone)

private function new_polyhedron(name, color) result(p)

A polyhedron named name, of color color (its faces, edges and vertices), with no faces yet (set_faces, set_triangles or set_grid).

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

the frame's name

real(kind=wp), intent(in), optional :: color(:)

[r, g, b] or [r, g, b, a] (0 to 1)

Return Value type(Polyhedron)

private function new_radial_plane(name, color) result(p)

A radial plane named name (decorations of color color): radius 1, circles every 0.5, radial lines every 30 degrees, light gray and transparent (OpenFrames' defaults).

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

the frame's name

real(kind=wp), intent(in), optional :: color(:)

[r, g, b] or [r, g, b, a] (0 to 1)

Return Value type(RadialPlane)

private function new_rectangular_cone(name, color) result(c)

A rectangular cone named name, of color color.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

the frame's name

real(kind=wp), intent(in), optional :: color(:)

[r, g, b] or [r, g, b, a] (0 to 1)

Return Value type(RectangularCone)

private pure function num_edges(self)

The number of edges.

Arguments

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

Return Value integer

private pure function num_triangles(self)

The number of triangles drawn (polygons: as fans).

Arguments

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

Return Value integer

private pure function num_vertices(self)

The number of vertices.

Arguments

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

Return Value integer

private pure function open_segments(p) result(s)

Points along an open curve, as separate segments.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: p(:,:)

(3, n) points of the curve

Return Value real(kind=wp), (3,2*(size(p,2)-1))

private pure function plane_color(self) result(c)

The plane's color [r, g, b, a].

Arguments

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

Return Value real(kind=wp), (4)

private function plane_frame_info(self) result(info)

What kind of frame this is: 'RadialPlane'.

Arguments

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

Return Value character(len=:), allocatable

private pure function plane_line_color(self) result(c)

The lines' color [r, g, b, a].

Arguments

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

Return Value real(kind=wp), (4)

private pure function point_color(self) result(c)

The vertices' color [r, g, b, a].

Arguments

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

Return Value real(kind=wp), (4)

private pure function point_size(self)

The vertices' size (window units).

Arguments

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

Return Value real(kind=wp)

private pure function poly_draw_mode(self)

What is drawn: an ior of POLY_FACES, POLY_EDGES, POLY_VERTICES.

Arguments

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

Return Value integer

private function poly_frame_info(self) result(info)

What kind of frame this is: 'Polyhedron'.

Arguments

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

Return Value character(len=:), allocatable

private pure function poly_line_color(self) result(c)

The edges' color [r, g, b, a].

Arguments

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

Return Value real(kind=wp), (4)

private pure function poly_line_width(self)

The edges' width (window units).

Arguments

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

Return Value real(kind=wp)

private pure function poly_opacity(self)

The faces' opacity.

Arguments

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

Return Value real(kind=wp)

private function rect_frame_info(self) result(info)

What kind of frame this is: 'RectangularCone'.

Arguments

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

Return Value character(len=:), allocatable

private function set_tick_image(self, file) result(ok)

Draw the ticks as an image (OpenFrames' setTickImage; found with find_data_file; '' for disks again). False if it cannot be read.

Arguments

Type IntentOptional Attributes Name
class(CoordinateAxes), intent(inout) :: self
character(len=*), intent(in) :: file

image file ('' for disks)

Return Value logical

private pure function side(a, b, q)

Which side of the line from a to b q is on: > 0 left, < 0 right, 0 on it (twice the signed area of the triangle a, b, q).

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: a(2)

the line's two points, and the point tested

real(kind=wp), intent(in) :: b(2)

the line's two points, and the point tested

real(kind=wp), intent(in) :: q(2)

the line's two points, and the point tested

Return Value real(kind=wp)

private pure function smooth(self)

Whether the shading is smooth.

Arguments

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

Return Value logical

private function surface_node(xyz, idx, rgba, normals, colors, two_sided, sphere) result(node)

A surface of triangles idx(3, m) (1-based) through points xyz(3, n), of color rgba: unlit and transparent (seen from both sides, writing no depth: planes, cones' sides), or, given normals, lit by the scene's lights: opaque, or translucent if an alpha is below 1 (drawn after the opaque scene, sorted by depth by the bounding sphere sphere); two_sided: both faces drawn and lit. colors: a color per vertex (4, n), times rgba.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: xyz(:,:)

(3, n) vertices

integer, intent(in) :: idx(:,:)

(3, m) triangles, vertex numbers (1-based)

real(kind=wp), intent(in) :: rgba(4)

color [r, g, b, a] (0 to 1)

real(kind=wp), intent(in), optional :: normals(:,:)

(3, n): lit

real(kind=wp), intent(in), optional :: colors(:,:)

(4, n)

logical, intent(in), optional :: two_sided

(lit) both faces (default: front only)

real(kind=wp), intent(in), optional :: sphere(4)

(lit, translucent) center and radius

Return Value type(c_ptr)

private pure function surface_point(r, lat, lon) result(p)

The point at geodetic latitude lat and longitude lon on the ellipsoid (OpenFrames' LatLonGrid formula: the surface point whose normal has those angles).

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: r(3)

semi-axes (scene units)

real(kind=wp), intent(in) :: lat

radians

real(kind=wp), intent(in) :: lon

radians

Return Value real(kind=wp), (3)

private function tick_image(self) result(file)

The tick image file ('' for none).

Arguments

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

Return Value character(len=:), allocatable

private pure function tick_shape(self)

Tick shape: a MARKER_* shape.

Arguments

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

Return Value integer

private pure function two_sided(self)

Whether both sides are drawn.

Arguments

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

Return Value logical

private function unique_edges(pairs, n) result(edges)

Edges (2, k) of vertex numbers (1 to n), each once whichever its direction (sorted by their smaller vertex, then the larger).

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: pairs(:,:)

(2, k) vertex numbers, in either order

integer, intent(in) :: n

the number of vertices

Return Value integer, allocatable, (:,:)

private pure function unit_normal(a, b, c) result(n)

A triangle's unit normal (counterclockwise: its front), or +z if it has no area.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: a(3)

the triangle's vertices

real(kind=wp), intent(in) :: b(3)

the triangle's vertices

real(kind=wp), intent(in) :: c(3)

the triangle's vertices

Return Value real(kind=wp), (3)

private pure function vertex_normals(v, tri) result(normals)

Normals per vertex: the faces' around it, weighted by their areas.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: v(:,:)

(3, n) vertices

integer, intent(in) :: tri(:,:)

(3, m) triangles, vertex numbers (1-based)

Return Value real(kind=wp), (3,size(v,2))


Subroutines

private subroutine add(group, child)

Add child to group (its handle is not kept).

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: group

the group, and a node to add to it

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

the group, and a node to add to it

private pure subroutine append(a, b)

Append points b to a (allocatable, (3, n)).

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(inout), allocatable :: a(:,:)

(3, n) points (unallocated: none)

real(kind=wp), intent(in) :: b(:,:)

(3, m) points to append

private subroutine axes_bound(self, center, radius)

The bounding sphere: the origin, radius the axis length.

Arguments

Type IntentOptional Attributes Name
class(CoordinateAxes), intent(in) :: self
real(kind=wp), intent(out) :: center(3)

the bounding sphere, frame coordinates (scene units)

real(kind=wp), intent(out) :: radius

the bounding sphere, frame coordinates (scene units)

private subroutine axes_build_contents(self, viewer, group)

Draw the axes under group (the contents); with a window's viewer, later drawings are compiled.

Arguments

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

a window's viewer (null: headless)

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

the frame's contents group

private subroutine axes_set_color(self, color)

The axes' color (lines and ticks).

Arguments

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

[r, g, b] or [r, g, b, a] (0 to 1)

private subroutine cone_bound(self, center, radius)

The bound of the apex and the base.

Arguments

Type IntentOptional Attributes Name
class(PolyhedralCone), intent(in) :: self
real(kind=wp), intent(out) :: center(3)

the bounding sphere, frame coordinates (scene units)

real(kind=wp), intent(out) :: radius

the bounding sphere, frame coordinates (scene units)

private subroutine cone_build_contents(self, viewer, group)

Draw the cone under group (the contents); with a window's viewer, later drawings are compiled.

Arguments

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

a window's viewer (null: headless)

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

the frame's contents group

private subroutine cone_set_line_color(self, color)

The edges' and base outline's color.

Arguments

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

[r, g, b] or [r, g, b, a] (0 to 1)

private subroutine drop_colors(self)

No colors per vertex.

Arguments

Type IntentOptional Attributes Name
type(Polyhedron), intent(inout) :: self

private pure subroutine elliptic_primary_angles(self, a, b)

The half-angles along x (a) and y (b), radians.

Arguments

Type IntentOptional Attributes Name
class(EllipticCone), intent(in) :: self
real(kind=wp), intent(out) :: a

radians

real(kind=wp), intent(out) :: b

radians

private subroutine elliptic_set_primary_angles(self, a, b)

The half-angles along x (a) and y (b), radians (0 to 90 degrees).

Arguments

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

radians

real(kind=wp), intent(in) :: b

radians

private subroutine elliptic_vertices(self)

120 vertices (every 3 degrees), cone angle a b / sqrt(b^2 cos^2 + a^2 sin^2) (OpenFrames' createEllipticCone).

Arguments

Type IntentOptional Attributes Name
type(EllipticCone), intent(inout) :: self

private subroutine grid_bound(self, center, radius)

The bounding sphere: the origin, radius the largest semi-axis.

Arguments

Type IntentOptional Attributes Name
class(LatLonGrid), intent(in) :: self
real(kind=wp), intent(out) :: center(3)

the bounding sphere, frame coordinates (scene units)

real(kind=wp), intent(out) :: radius

the bounding sphere, frame coordinates (scene units)

private subroutine grid_build_contents(self, viewer, group)

Draw the grid under group (the contents); with a window's viewer, later drawings are compiled.

Arguments

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

a window's viewer (null: headless)

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

the frame's contents group

private pure subroutine grid_parameters(self, radius_x, radius_y, radius_z, lat_spacing, lon_spacing)

The ellipsoid's semi-axes and the line spacings, as OpenFrames' getParameters.

Arguments

Type IntentOptional Attributes Name
class(LatLonGrid), intent(in) :: self
real(kind=wp), intent(out) :: radius_x

scene units

real(kind=wp), intent(out) :: radius_y

scene units

real(kind=wp), intent(out) :: radius_z

scene units

real(kind=wp), intent(out) :: lat_spacing

radians

real(kind=wp), intent(out) :: lon_spacing

radians

private subroutine grid_set_color(self, color)

The lines' color.

Arguments

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

[r, g, b] or [r, g, b, a] (0 to 1)

private subroutine grid_set_parameters(self, radius_x, radius_y, radius_z, lat_spacing, lon_spacing)

The ellipsoid's semi-axes (> 0; e.g. a Sphere's radii, a little larger to draw above its surface) and the line spacings (radians; 0 for no latitude or longitude lines), as OpenFrames' setParameters.

Arguments

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

scene units (<= 0: unchanged)

real(kind=wp), intent(in) :: radius_y

scene units (<= 0: unchanged)

real(kind=wp), intent(in) :: radius_z

scene units (<= 0: unchanged)

real(kind=wp), intent(in) :: lat_spacing

radians (< 0: unchanged)

real(kind=wp), intent(in) :: lon_spacing

radians (< 0: unchanged)

private pure subroutine line_widths(self, width, main_width)

Widths of the grid lines and of the equator and prime meridian (window units).

Arguments

Type IntentOptional Attributes Name
class(LatLonGrid), intent(in) :: self
real(kind=wp), intent(out) :: width

window units

real(kind=wp), intent(out) :: main_width

window units

private subroutine make_axes(self)

Make the axes' lines and tick marks, in place of the old (nothing before build_contents).

Arguments

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

private subroutine make_cone(self)

Make the sides, edges and base outline (those the draw mode says), in place of the old.

Arguments

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

private subroutine make_cone_look_at(self, apex, dir, up)

Place the cone's apex at apex (in the parent frame) with its boresight along dir and its +y axis toward up (OpenFrames' makeConeLookAt).

Arguments

Type IntentOptional Attributes Name
class(PolyhedralCone), intent(inout) :: self
real(kind=wp), intent(in) :: apex(3)

parent frame coordinates (scene units)

real(kind=wp), intent(in) :: dir(3)

boresight direction (any length > 0)

real(kind=wp), intent(in) :: up(3)

toward the cone's +y axis (any length)

private subroutine make_grid(self)

Make the grid's lines (circles in 1 degree steps, meridians in 0.5 degree steps), in place of the old.

Arguments

Type IntentOptional Attributes Name
type(LatLonGrid), intent(inout) :: self

private subroutine make_plane(self)

Make the disk, its circles and its radial lines (1 degree steps), in place of the old.

Arguments

Type IntentOptional Attributes Name
type(RadialPlane), intent(inout) :: self

private subroutine make_polyhedron(self)

The polyhedron's nodes, made again (if shown).

Arguments

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

private subroutine place_axes(self, length)

The frame's own axes (arrows) at length along x, y and z, half as long.

Arguments

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

scene units

private subroutine place_grid_axes(self)

The frame's own axes (arrows) at the ellipsoid's semi-axes, half as long.

Arguments

Type IntentOptional Attributes Name
type(LatLonGrid), intent(inout) :: self

private subroutine plane_bound(self, center, radius)

The bounding sphere: the origin, radius the plane's radius.

Arguments

Type IntentOptional Attributes Name
class(RadialPlane), intent(in) :: self
real(kind=wp), intent(out) :: center(3)

the bounding sphere, frame coordinates (scene units)

real(kind=wp), intent(out) :: radius

the bounding sphere, frame coordinates (scene units)

private subroutine plane_build_contents(self, viewer, group)

Draw the plane under group (the contents); with a window's viewer, later drawings are compiled.

Arguments

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

a window's viewer (null: headless)

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

the frame's contents group

private pure subroutine plane_parameters(self, radius, radial_spacing, lon_spacing)

The plane's radius, circle spacing and radial line spacing, as OpenFrames' getParameters.

Arguments

Type IntentOptional Attributes Name
class(RadialPlane), intent(in) :: self
real(kind=wp), intent(out) :: radius

scene units

real(kind=wp), intent(out) :: radial_spacing

scene units

real(kind=wp), intent(out) :: lon_spacing

radians

private subroutine plane_set_line_color(self, color)

The lines' color (default white, 0.2 opaque).

Arguments

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

[r, g, b] or [r, g, b, a] (0 to 1)

private subroutine plane_set_parameters(self, radius, radial_spacing, lon_spacing)

The plane's radius (> 0), circle spacing and radial line spacing (radians; 0 for none), as OpenFrames' setParameters.

Arguments

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

scene units (<= 0: unchanged)

real(kind=wp), intent(in) :: radial_spacing

scene units (< 0: unchanged)

real(kind=wp), intent(in) :: lon_spacing

radians (< 0: unchanged)

private subroutine poly_bound(self, center, radius)

The bounding sphere: about the vertices' box's center.

Arguments

Type IntentOptional Attributes Name
class(Polyhedron), intent(in) :: self
real(kind=wp), intent(out) :: center(3)

the bounding sphere, frame coordinates (scene units)

real(kind=wp), intent(out) :: radius

the bounding sphere, frame coordinates (scene units)

private subroutine poly_build_contents(self, viewer, group)

Arguments

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

a window's viewer (null: headless)

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

the frame's contents group

private subroutine poly_set_draw_mode(self, mode)

What to draw: an ior of POLY_FACES, POLY_EDGES, POLY_VERTICES (default faces and edges).

Arguments

Type IntentOptional Attributes Name
class(Polyhedron), intent(inout) :: self
integer, intent(in) :: mode

an ior of POLY_FACES, POLY_EDGES, POLY_VERTICES

private subroutine poly_set_line_color(self, color)

The edges' color.

Arguments

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

[r, g, b] or [r, g, b, a] (0 to 1)

private subroutine poly_set_line_width(self, width)

The edges' width (window units; default 1).

Arguments

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

window units

private subroutine poly_set_opacity(self, opacity)

The faces' opacity (0 to 1; default 1, opaque): below 1 translucent.

Arguments

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

0 to 1 (1: opaque)

private pure subroutine rect_primary_angles(self, x, y)

The half-angles along x and y, radians.

Arguments

Type IntentOptional Attributes Name
class(RectangularCone), intent(in) :: self
real(kind=wp), intent(out) :: x

radians

real(kind=wp), intent(out) :: y

radians

private subroutine rect_set_primary_angles(self, x, y)

The half-angles along x and y, radians (0 to 90 degrees).

Arguments

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

radians

real(kind=wp), intent(in) :: y

radians

private subroutine rect_vertices(self)

The 4 corners (OpenFrames' createRectangularCone).

Arguments

Type IntentOptional Attributes Name
type(RectangularCone), intent(inout) :: self

private subroutine remove_vertex_colors(self)

The face color again, for every vertex.

Arguments

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

private subroutine replace(self, new)

Show new (a switch made by the shape) in place of the shape's current nodes; compiled first if the window already runs.

Arguments

Type IntentOptional Attributes Name
class(ShapeNodes), intent(inout) :: self
type(c_ptr), intent(in) :: new

a switch made by the shape (null: none)

private subroutine set_axis_length(self, length)

The axes' length (scene units, >= 0; default 1); the frame's own axes are moved to the lines' ends.

Arguments

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

scene units (< 0: ignored)

private subroutine set_axis_width(self, width)

The axis lines' width (window units; default 1).

Arguments

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

window units (<= 0: ignored)

private subroutine set_cone_color(self, color)

The sides' color ([r, g, b] or [r, g, b, a]; their alpha makes them transparent).

Arguments

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

[r, g, b] or [r, g, b, a] (0 to 1)

private subroutine set_cone_length(self, length)

The cone's length along the boresight (> 0; default 1).

Arguments

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

scene units (<= 0: ignored)

private subroutine set_draw_axes(self, axes)

Which axes to draw: an ior of X_AXIS, Y_AXIS, Z_AXIS.

Arguments

Type IntentOptional Attributes Name
class(CoordinateAxes), intent(inout) :: self
integer, intent(in) :: axes

an ior of X_AXIS, Y_AXIS, Z_AXIS

private subroutine set_draw_mode(self, mode)

What to draw: an ior of CONE_SIDES, CONE_EDGES, CONE_BASE_OUTLINE.

Arguments

Type IntentOptional Attributes Name
class(PolyhedralCone), intent(inout) :: self
integer, intent(in) :: mode

an ior of CONE_SIDES, CONE_EDGES, CONE_BASE_OUTLINE

private subroutine set_edges(self, edges)

The edges drawn (2, k) (vertex numbers), in place of the faces' (after set_faces, set_triangles or set_grid).

Arguments

Type IntentOptional Attributes Name
class(Polyhedron), intent(inout) :: self
integer, intent(in) :: edges(:,:)

(2, k) vertex numbers (1-based)

private subroutine set_face_color(self, color)

The faces' color (the alpha times the opacity).

Arguments

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

[r, g, b] or [r, g, b, a] (0 to 1)

private subroutine set_faces(self, vertices, faces, sizes)

Faces given as polygons: faces the vertex numbers (1-based) of each polygon in turn, sizes how many each has (>= 3; convex, or at least star-shaped from its first vertex: drawn as a fan of triangles from it); the edges are the polygons' sides. E.g. a cube: 8 vertices, 6 faces of 4. A face's front: its vertices counterclockwise.

Arguments

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

(3, n), frame coordinates

integer, intent(in) :: faces(:)

(sum(sizes)) vertex numbers

integer, intent(in) :: sizes(:)

each face's number of vertices

private subroutine set_grid(self, points, closed_u, closed_v, lines)

Faces given as a grid of points (3, nu, nv): quadrilaterals between neighbours (two triangles each), joined around if closed_u (the last point i to the first, for each j; e.g. a tube's circumference) or closed_v. The edges: the grid's lines, those of constant i (along j) every lines(1) and of constant j (along i) every lines(2) (default: every one; 0 for none).

Arguments

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

(3, nu, nv), frame coordinates

logical, intent(in), optional :: closed_u

joined around in i, in j (default false)

logical, intent(in), optional :: closed_v

joined around in i, in j (default false)

integer, intent(in), optional :: lines(2)

edges every lines(1) in i, lines(2) in j (default 1; 0: none)

private subroutine set_line_widths(self, width, main_width)

Widths of the grid lines and of the equator and prime meridian (window units; defaults 1 and 3).

Arguments

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

window units (<= 0: unchanged)

real(kind=wp), intent(in) :: main_width

window units (<= 0: unchanged)

private subroutine set_lit(self, lit)

Faces lit by the scene's lights (the default), or unlit (their color as is, transparent as a cone's sides: writing no depth).

Arguments

Type IntentOptional Attributes Name
class(Polyhedron), intent(inout) :: self
logical, intent(in) :: lit

true: lit; false: unlit and transparent

private subroutine set_plane_color(self, color)

The plane's color ([r, g, b] or [r, g, b, a]; default 0.8 gray, 0.2 opaque).

Arguments

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

[r, g, b] or [r, g, b, a] (0 to 1)

private subroutine set_point_color(self, color)

The vertices' color (POLY_VERTICES).

Arguments

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

[r, g, b] or [r, g, b, a] (0 to 1)

private subroutine set_point_size(self, size_)

The vertices' size (window units; default 6).

Arguments

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

window units

private subroutine set_smooth(self, smooth)

Shading smooth across the vertices (normals averaged over the faces around each: a curved surface, e.g. a grid's), or flat faces (the default: a polyhedron's).

Arguments

Type IntentOptional Attributes Name
class(Polyhedron), intent(inout) :: self
logical, intent(in) :: smooth

true: smooth shading; false: flat faces

private subroutine set_tick_shape(self, shape)

Tick shape: a MARKER_* shape (default MARKER_DISK; OpenFrames' setTickShader with its marker shaders).

Arguments

Type IntentOptional Attributes Name
class(CoordinateAxes), intent(inout) :: self
integer, intent(in) :: shape

a MARKER_* shape

private subroutine set_tick_size(self, major, minor)

Major and minor tick sizes (window units; default 8 and 4).

Arguments

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

window units (<= 0: unchanged)

real(kind=wp), intent(in) :: minor

window units (<= 0: unchanged)

private subroutine set_tick_spacing(self, major, minor)

Major and minor tick spacings (>= 0; 0 for none).

Arguments

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

scene units (< 0: unchanged)

real(kind=wp), intent(in) :: minor

scene units (< 0: unchanged)

private subroutine set_triangles(self, vertices, triangles)

Faces given as triangles (3, m) of vertex numbers (1-based); the edges are their sides (each once).

Arguments

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

(3, n), frame coordinates

integer, intent(in) :: triangles(:,:)

(3, m)

private subroutine set_two_sided(self, two_sided)

Both sides of the faces drawn and lit (the default: open surfaces), or only their fronts (a closed surface, its faces counterclockwise seen from outside: translucent, its far side isn't drawn through it).

Arguments

Type IntentOptional Attributes Name
class(Polyhedron), intent(inout) :: self
logical, intent(in) :: two_sided

true: both sides; false: fronts only

private subroutine set_vertex_angles(self, clock, cone)

The vertices: clock angles (from +x toward +y) and cone angles (from the boresight, -z; below 90 degrees), radians, the same number of each (>= 3).

Arguments

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

radians

real(kind=wp), intent(in) :: cone(:)

radians

private subroutine set_vertex_colors(self, colors)

A color per vertex (4, n) or (3, n) ([r, g, b(, a)], 0 to 1), for the faces, blended across them (in place of the face color; the opacity still applies). Dropped when the faces are set again.

Arguments

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

(4, n) or (3, n): [r, g, b(, a)] (0 to 1)

private subroutine set_vertices(self, vertices)

Move the vertices (3, n), keeping the faces and edges (as many as before; e.g. a surface changing in time).

Arguments

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

(3, n), frame coordinates (as many as before)

private pure subroutine sort_keys(a)

Sort keys, increasing (a bottom-up merge sort).

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(inout) :: a(:)

the keys

private pure subroutine tick_size(self, major, minor)

Major and minor tick sizes (window units).

Arguments

Type IntentOptional Attributes Name
class(CoordinateAxes), intent(in) :: self
real(kind=wp), intent(out) :: major

window units

real(kind=wp), intent(out) :: minor

window units

private pure subroutine tick_spacing(self, major, minor)

Major and minor tick spacings.

Arguments

Type IntentOptional Attributes Name
class(CoordinateAxes), intent(in) :: self
real(kind=wp), intent(out) :: major

scene units

real(kind=wp), intent(out) :: minor

scene units

private pure subroutine vertices_sphere(v, center, radius)

A sphere around points v (3, n): their box's center, out to the farthest (zero for none).

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: v(:,:)

(3, n) points

real(kind=wp), intent(out) :: center(3)

the sphere's center and radius

real(kind=wp), intent(out) :: radius

the sphere's center and radius