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).
Faces: lit by the scene's lights (the default; flat, or smooth across the vertices with set_smooth) or unlit (as a cone's sides); in the face color, or a color per vertex (set_vertex_colors); opaque, or translucent (set_opacity, or the colors' alpha: drawn after the opaque scene, sorted by depth, writing none); seen from both sides (the default, for open surfaces; set_two_sided(.false.) for a closed one, whose back faces are then not drawn through it).
Vertices are single precision on the GPU, relative to the frame: for a shape far from the frame's origin, put it in a frame placed near it.
| 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) |
The Polyhedron constructor: Polyhedron(...) makes one (see new_polyhedron for its
arguments).
A polyhedron named name, of color color (its faces, edges and
vertices), with no faces yet (set_faces, set_triangles or set_grid).
| Type | Intent | Optional | 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) |
Add child to this frame's children. Returns false (and does nothing)
for this frame itself or an ancestor of it; true if it is already a child.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout), | target | :: | self | ||
| class(ReferenceFrame), | intent(inout), | target | :: | child |
the frame to add (not owned) |
Attitude relative to the parent frame, a quaternion [x, y, z, w].
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self |
Which axes labels are shown (as axes_shown).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self |
Which axes vectors are shown (NO_AXES, or X_AXIS, Y_AXIS, Z_AXIS combined).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self |
The label text of axis X_AXIS, Y_AXIS or Z_AXIS.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self | |||
| integer, | intent(in) | :: | axis |
X_AXIS, Y_AXIS or Z_AXIS (else: '') |
The bounding sphere: about the vertices' box's center.
| Type | Intent | Optional | 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) |
| Type | Intent | Optional | 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 |
Child i (1 to num_children).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self | |||
| integer, | intent(in) | :: | i |
1 to num_children |
Index of frame among the children, or 0.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self | |||
| class(ReferenceFrame), | intent(in), | target | :: | frame |
the frame to find |
The color of the frame's decorations, [r, g, b, a] (0 to 1).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self |
Whether what the frame draws is shown (show_contents).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self |
Remove this frame from all its parents and children (before it goes out of scope or is deallocated while in a tree).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout), | target | :: | self |
What is drawn: an ior of POLY_FACES, POLY_EDGES, POLY_VERTICES.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Polyhedron), | intent(in) | :: | self |
The faces' color [r, g, b, a].
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Polyhedron), | intent(in) | :: | self |
Follow traj (in addition to trajectories already followed, if add
is true), with what to follow (data: FOLLOW_POSITION and/or
FOLLOW_ATTITUDE; default both) and how (mode: FOLLOW_LOOP, the
default, or FOLLOW_LIMIT). traj must stay alive while followed.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout) | :: | self | |||
| type(Trajectory), | intent(in), | target | :: | traj |
the trajectory to follow (not owned) |
|
| integer, | intent(in), | optional | :: | data |
FOLLOW_POSITION/FOLLOW_ATTITUDE; FOLLOW_LOOP/FOLLOW_LIMIT |
|
| integer, | intent(in), | optional | :: | mode |
FOLLOW_POSITION/FOLLOW_ATTITUDE; FOLLOW_LOOP/FOLLOW_LIMIT |
|
| logical, | intent(in), | optional | :: | add |
(true: in addition to those followed (default false)) |
|
| class(ReferenceFrame), | intent(in), | optional, | target | :: | data_frame |
the frame the data are in (default: the parent) |
The frame the followed data are in (follow's data_frame; null:
the parent).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self |
The frame's trajectory follower, for finer control (data sources, time offset, ...).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in), | target | :: | self |
What kind of frame this is: 'Polyhedron'.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Polyhedron), | intent(in) | :: | self |
The tree below this frame, one line per frame ("name (info)"), in OpenFrames' createFrameString format: children are prefixed "|-->".
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self | |||
| character(len=*), | intent(in), | optional | :: | prefix |
before this frame's line (default ' ') |
Whether this frame or one of its descendants has a light source enabled.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self |
Whether the faces have a color per vertex.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Polyhedron), | intent(in) | :: | self |
Whether the frame follows trajectories (at least one, since follow).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self |
The labels' alignment (ALIGN_*).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self |
The labels' font as set ('' for the renderer's default).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self |
The labels' size in pixels.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self |
After the whole tree's update for time t (all frames at their positions for t): for contents that depend on other frames' positions, e.g. CustomLineSegments between spacecraft. Here, only the descendants'.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | t |
simulation time |
The light source's ambient color [r, g, b].
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self |
The light source's diffuse color [r, g, b].
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self |
Whether this frame carries a light source.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self |
The light source's specular color [r, g, b].
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self |
The edges' color [r, g, b, a].
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Polyhedron), | intent(in) | :: | self |
The edges' width (window units).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Polyhedron), | intent(in) | :: | self |
Whether the faces are lit.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Polyhedron), | intent(in) | :: | self |
The transform from this frame to its parent (4x4).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self |
The transform from this frame to its parent at simulation time t: its
fixed position and attitude, with what it follows at time t (the
followed trajectories' state then, in the parent's coordinates). The
same as local_matrix after update at time t, for any t, without
changing anything.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self | |||
| real(kind=wp), | intent(in) | :: | t |
simulation time |
What the frame's motion depends on, for drawings that depend on it to
know when to redraw: stamp, the latest change of the motion of it and
its ancestors (through first parents), and of the frames their followed
data are in (poses set, parents changed, what is followed and how); and
data, the followed trajectories' revisions summed. Either changes
when the frame's motion over time changes.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self | |||
| integer, | intent(out) | :: | stamp |
the latest change; the followed data's revisions |
||
| integer, | intent(out) | :: | data |
the latest change; the followed data's revisions |
Place the x axis vector: from base, length long, with a head of
head_ratio of the length (default 0.3) and body and head radii (default
0.05 and 0.1 of the length); its label is at the tip, 0.4 of the length
tall (at most label_size pixels). As OpenFrames' moveXAxis. Set before
the frame is first shown.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | base(3) |
(base: frame's coordinates) |
||
| real(kind=wp), | intent(in) | :: | length |
(base: frame's coordinates) |
||
| real(kind=wp), | intent(in), | optional | :: | head_ratio |
defaults: 0.3; 0.05 and 0.1 of the length |
|
| real(kind=wp), | intent(in), | optional | :: | body_radius |
defaults: 0.3; 0.05 and 0.1 of the length |
|
| real(kind=wp), | intent(in), | optional | :: | head_radius |
defaults: 0.3; 0.05 and 0.1 of the length |
Place the y axis vector (as move_x_axis; OpenFrames' moveYAxis).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | base(3) |
(base: frame's coordinates) |
||
| real(kind=wp), | intent(in) | :: | length |
(base: frame's coordinates) |
||
| real(kind=wp), | intent(in), | optional | :: | head_ratio |
defaults: 0.3; 0.05 and 0.1 of the length |
|
| real(kind=wp), | intent(in), | optional | :: | body_radius |
defaults: 0.3; 0.05 and 0.1 of the length |
|
| real(kind=wp), | intent(in), | optional | :: | head_radius |
defaults: 0.3; 0.05 and 0.1 of the length |
Place the z axis vector (as move_x_axis; OpenFrames' moveZAxis).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | base(3) |
(base: frame's coordinates) |
||
| real(kind=wp), | intent(in) | :: | length |
(base: frame's coordinates) |
||
| real(kind=wp), | intent(in), | optional | :: | head_ratio |
defaults: 0.3; 0.05 and 0.1 of the length |
|
| real(kind=wp), | intent(in), | optional | :: | body_radius |
defaults: 0.3; 0.05 and 0.1 of the length |
|
| real(kind=wp), | intent(in), | optional | :: | head_radius |
defaults: 0.3; 0.05 and 0.1 of the length |
The frame's name ('' if none).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self |
Whether the name label is drawn on top of the scene (set_name_label_on_top).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self |
Whether the name label is shown.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self |
The frame's transform node (null until realized).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self |
Number of children.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self |
The number of edges.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Polyhedron), | intent(in) | :: | self |
Number of parents.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self |
The number of triangles drawn (polygons: as fans).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Polyhedron), | intent(in) | :: | self |
The number of vertices.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Polyhedron), | intent(in) | :: | self |
The faces' opacity.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Polyhedron), | intent(in) | :: | self |
Parent i (1 to num_parents).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self | |||
| integer, | intent(in) | :: | i |
1 to num_parents |
Index of frame among the parents, or 0.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self | |||
| class(ReferenceFrame), | intent(in), | target | :: | frame |
the frame to find |
Pick what the frame draws (see the module documentation): to_root
is its transform to the root frame; hits are added to hits(1:n). A
plain frame: its origin, if it shows axes or its name label.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in), | target | :: | self | ||
| type(PickCamera), | intent(in) | :: | cam |
the cursor's ray and the pick's settings |
||
| real(kind=wp), | intent(in) | :: | to_root(4,4) |
the frame's transform to the root frame |
||
| type(PickHit), | intent(inout), | allocatable | :: | hits(:) |
hits so far (grown as needed) |
|
| integer, | intent(inout) | :: | n |
number of hits in hits |
Whether pick tests what this frame draws (set_pickable).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self |
The vertices' color [r, g, b, a].
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Polyhedron), | intent(in) | :: | self |
The vertices' size (window units).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Polyhedron), | intent(in) | :: | self |
Position relative to the parent frame.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self |
The origin of other (a frame of the same tree) in this frame's
coordinates, from both frames' transforms to the root (through their
first parents).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self |
(other: a frame of the same tree) |
||
| class(ReferenceFrame), | intent(in) | :: | other |
(other: a frame of the same tree) |
Create the render nodes of this frame and its descendants (once; for
viewer, a window's viewer handle, which some contents need while they
are built (not kept); null: headless).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout) | :: | self | |||
| type(c_ptr), | intent(in) | :: | viewer |
a window's viewer handle (null: headless) |
Remove child from this frame's children. Returns false if it is not one.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout), | target | :: | self | ||
| class(ReferenceFrame), | intent(inout), | target | :: | child |
the child to remove |
The face color again, for every vertex.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Polyhedron), | intent(inout) | :: | self |
Place the axes for what the frame draws, when it is first shown (unless move_*_axis was called): at its bound's surface, half the bound's radius long (as OpenFrames' Sphere and Model do); at the origin, 1 long, for a frame that draws nothing.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout) | :: | self |
Attitude relative to the parent frame, a quaternion [x, y, z, w] (normalized here; overridden by a followed trajectory).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | q(4) |
attitude quaternion [x, y, z, w] (normalized here) |
The color of the frame's decorations: [r, g, b] (alpha unchanged) or [r, g, b, a].
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | color(:) |
[r, g, b] (alpha unchanged) or [r, g, b, a] (0 to 1) |
What to draw: an ior of POLY_FACES, POLY_EDGES, POLY_VERTICES (default faces and edges).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Polyhedron), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | mode |
an ior of POLY_FACES, POLY_EDGES, POLY_VERTICES |
The edges drawn (2, k) (vertex numbers), in place of the faces' (after set_faces, set_triangles or set_grid).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Polyhedron), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | edges(:,:) |
(2, k) vertex numbers (1-based) |
The faces' color (the alpha times the opacity).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Polyhedron), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | color(:) |
[r, g, b] or [r, g, b, a] (0 to 1) |
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.
| Type | Intent | Optional | 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 |
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).
| Type | Intent | Optional | 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) |
The alignment of the labels relative to their positions (ALIGN_*; default ALIGN_LEFT_BASE_LINE).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | alignment |
ALIGN_* (default ALIGN_LEFT_BASE_LINE) |
The font of the labels: a font file name (found on the data search path) or a full path; default: the renderer's default font.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout) | :: | self | |||
| character(len=*), | intent(in) | :: | font |
a font file name (on the data search path) or a full path |
The size of the labels in pixels (default 20): the name label's size, and the maximum size of the axes labels (which shrink with distance).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | size |
pixels (default 20) |
The light source's ambient, diffuse and specular colors ([r, g, b], 0 to 1; defaults 0.05, 0.8 and 0.05 gray).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | rgb(3) |
ambient color [r, g, b] (0 to 1; default 0.05 gray) |
The light source's diffuse color (see set_light_ambient).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | rgb(3) |
diffuse color [r, g, b] (0 to 1; default 0.8 gray) |
Whether this frame carries a light source: a point light at its origin (e.g. the Sun), not dimmed with distance (default false; OpenFrames' setLightSourceEnabled). While any frame of a window's scene has one, the window's own light (WindowProxy%set_light_*) is off.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout) | :: | self | |||
| logical, | intent(in) | :: | enable |
(true: a point light at the frame's origin) |
The light source's specular color (see set_light_ambient).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | rgb(3) |
specular color [r, g, b] (0 to 1; default 0.05 gray) |
The edges' color.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Polyhedron), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | color(:) |
[r, g, b] or [r, g, b, a] (0 to 1) |
The edges' width (window units; default 1).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Polyhedron), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | width |
window units |
Faces lit by the scene's lights (the default), or unlit (their color as is, transparent as a cone's sides: writing no depth).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Polyhedron), | intent(inout) | :: | self | |||
| logical, | intent(in) | :: | lit |
true: lit; false: unlit and transparent |
The frame's name, shown by its name label (also once shown: e.g. a readout that follows the frame).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout) | :: | self | |||
| character(len=*), | intent(in) | :: | name |
the name (shown by the name label) |
Draw the name label on top of the scene (true: not hidden by bodies in front of it, as HUD text; e.g. a readout) or depth-tested (false, the default, as OpenFrames').
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout) | :: | self | |||
| logical, | intent(in) | :: | on_top |
(true: drawn on top of the scene; false: depth-tested) |
The faces' opacity (0 to 1; default 1, opaque): below 1 translucent.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Polyhedron), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | opacity |
0 to 1 (1: opaque) |
Whether pick tests what this frame draws (default true; e.g. false for an overlay such as a selection marker). Its children are picked or not by their own setting.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout) | :: | self | |||
| logical, | intent(in) | :: | pickable |
(true: tested by pick) |
The vertices' color (POLY_VERTICES).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Polyhedron), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | color(:) |
[r, g, b] or [r, g, b, a] (0 to 1) |
The vertices' size (window units; default 6).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Polyhedron), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | size_ |
window units |
Position relative to the parent frame (overridden by a followed trajectory).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | position(3) |
parent frame's coordinates |
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).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Polyhedron), | intent(inout) | :: | self | |||
| logical, | intent(in) | :: | smooth |
true: smooth shading; false: flat faces |
Faces given as triangles (3, m) of vertex numbers (1-based); the edges are their sides (each once).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Polyhedron), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | vertices(:,:) |
(3, n), frame coordinates |
||
| integer, | intent(in) | :: | triangles(:,:) |
(3, m) |
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).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Polyhedron), | intent(inout) | :: | self | |||
| logical, | intent(in) | :: | two_sided |
true: both sides; false: fronts only |
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.
| Type | Intent | Optional | 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) |
Move the vertices (3, n), keeping the faces and edges (as many as before; e.g. a surface changing in time).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Polyhedron), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | vertices(:,:) |
(3, n), frame coordinates (as many as before) |
The text of the x-axis label (default 'X').
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout) | :: | self | |||
| character(len=*), | intent(in) | :: | text |
the x-axis label (default 'X') |
The text of the y-axis label (default 'Y').
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout) | :: | self | |||
| character(len=*), | intent(in) | :: | text |
the y-axis label (default 'Y') |
The text of the z-axis label (default 'Z').
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout) | :: | self | |||
| character(len=*), | intent(in) | :: | text |
the z-axis label (default 'Z') |
Which axes vectors to show: NO_AXES, or X_AXIS, Y_AXIS, Z_AXIS combined with ior.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | axes |
NO_AXES, or X_AXIS, Y_AXIS, Z_AXIS combined with ior |
Which axes labels to show (as show_axes).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | labels |
NO_AXES, or X_AXIS, Y_AXIS, Z_AXIS combined with ior |
Show or hide what the frame draws (its sphere, model, ...), but not its axes, labels or children.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout) | :: | self | |||
| logical, | intent(in) | :: | show |
(true: shown) |
Show (true) or hide all the frame's decorations at once: its axes, their labels and its name label (show_axes, show_axes_labels, show_name_label).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout) | :: | self | |||
| logical, | intent(in) | :: | show |
true: all axes, axes labels and the name label |
Show or hide the name label (at the frame's origin; default shown).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout) | :: | self | |||
| logical, | intent(in) | :: | show |
(true: shown) |
Whether the shading is smooth.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Polyhedron), | intent(in) | :: | self |
Copy the positions and attitudes of this frame and its descendants to their transform nodes (only those that changed since the last sync).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout) | :: | self |
Whether both sides are drawn.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Polyhedron), | intent(in) | :: | self |
Stop following trajectories (the frame keeps its last position and attitude).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout) | :: | self |
Update this frame and its descendants for simulation time t (followed
trajectories set positions and attitudes).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(inout), | target | :: | self | ||
| real(kind=wp), | intent(in) | :: | t |
simulation time |
The transform from this frame to the root of its tree, through the first parent at each level.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self |
The transform from this frame to the root of its tree at simulation
time t (through the first parent at each level): each frame's
local_matrix_at time t. The same as world_matrix after the tree's
update at time t, for any t, without changing anything.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self | |||
| real(kind=wp), | intent(in) | :: | t |
simulation time |
type, extends(ReferenceFrame), public :: Polyhedron private real(wp), allocatable :: v(:,:) !! vertices (3, n), frame coordinates integer, allocatable :: tri(:,:) !! triangles (3, m), vertex numbers (1-based) integer, allocatable :: edge(:,:) !! edges (2, k), vertex numbers real(wp), allocatable :: vertex_colors_(:,:) !! a color per vertex (4, n) (none: the face color) real(wp) :: face_color_(4) = 1.0_wp !! faces' color [r, g, b, a] real(wp) :: line_color_(4) = 1.0_wp !! edges' color real(wp) :: point_color_(4) = 1.0_wp !! vertices' color real(wp) :: opacity_ = 1.0_wp !! the faces' (times their colors' alpha) real(wp) :: width_ = 1.0_wp !! edges' width (window units) real(wp) :: point_size_ = 6.0_wp !! vertices' size (window units) integer :: mode = ior(POLY_FACES, POLY_EDGES) !! an ior of POLY_FACES, POLY_EDGES, POLY_VERTICES logical :: lit_ = .true. !! lit by the scene's lights (else unlit, transparent) logical :: smooth_ = .false. !! normals smooth across the vertices (else flat faces) logical :: two_sided_ = .true. !! both sides drawn (and lit) type(ShapeNodes) :: nodes !! the drawing contains procedure :: set_faces, set_triangles, set_grid, set_edges, set_vertices procedure :: num_vertices, num_triangles, num_edges procedure :: set_vertex_colors, remove_vertex_colors, has_vertex_colors procedure :: set_face_color, face_color procedure :: set_line_color => poly_set_line_color, line_color => poly_line_color procedure :: set_point_color, point_color procedure :: set_opacity => poly_set_opacity, opacity => poly_opacity procedure :: set_line_width => poly_set_line_width, line_width => poly_line_width procedure :: set_point_size, point_size procedure :: set_draw_mode => poly_set_draw_mode, draw_mode => poly_draw_mode procedure :: set_lit, lit, set_smooth, smooth, set_two_sided, two_sided procedure :: frame_info => poly_frame_info procedure :: bound => poly_bound procedure :: build_contents => poly_build_contents end type Polyhedron