A chain of point buffers (see the module documentation).
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(LineChunk), | private, | allocatable | :: | chunks(:) |
(capacity): the chunks, in chain order |
||
| real(kind=c_float), | private | :: | color(4) | = | 1.0_c_float |
[r, g, b, a] (0 to 1) |
|
| logical, | private | :: | colored | = | .false. |
(lines, markers: a color per point (color_slice)) |
|
| logical, | private | :: | compile_new | = | .false. |
chunks made from now on are compiled (the group is shown) |
|
| real(kind=wp), | private | :: | dash_length | = | 0.0_wp |
(2: the pattern's length, scene units; 0 from the first view) |
|
| integer, | private | :: | dash_mode | = | 0 |
(lines: 0 anchored, 1 screen-locked, 2 fixed length) |
|
| type(c_ptr), | private | :: | group | = | c_null_ptr |
the group node the chunks are under (null: not built) |
|
| real(kind=c_float), | private | :: | highlight(12) | = | [1.0_c_float, 1.0_c_float, 1.0_c_float, 1.0_c_float, 0.0_c_float, 40.0_c_float, 50.0_c_float, 12.0_c_float, 1.5_c_float, 0.0_c_float, 0.0_c_float, 0.0_c_float] |
(lines: highlight, see vkf_line_set_highlight) |
|
| type(c_ptr), | private | :: | image | = | c_null_ptr |
(markers: the image (shape 10)) |
|
| integer, | private | :: | kind | = | CHAIN_STRIP |
what is drawn: a CHAIN_* constant |
|
| logical, | private | :: | lod | = | .true. |
(strips: level of detail (else every point drawn)) |
|
| integer, | private | :: | n_chunks | = | 0 |
number of chunks |
|
| integer, | private | :: | pattern | = | int(z'FFFF') |
(lines: 16-bit dash pattern (z'FFFF': solid)) |
|
| integer, | private | :: | pattern_factor | = | 1 |
(lines: dash pattern (see line_set_pattern)) |
|
| real(kind=c_float), | private | :: | radius | = | 0.0_c_float |
(markers: attenuation radius) |
|
| integer, | private | :: | shape | = | 0 |
markers |
|
| real(kind=c_float), | private | :: | trail(20) | = | 0.0_c_float |
(strips: the trail, see vkf_line_set_trail; z = 0: none) |
|
| real(kind=c_float), | private | :: | width | = | 1.0_c_float |
line width, or marker size |
Chunk j's points (strips: first .. first + n - 1 of the chain) and the bounding box of them (n = 0 if none are measured yet), e.g. to skip a chunk when picking.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(LineChain), | intent(in) | :: | self | |||
| integer, | intent(in) | :: | j |
the chunk |
||
| integer, | intent(out) | :: | first |
its first point (chain index), and points written (0: none) |
||
| integer, | intent(out) | :: | n |
its first point (chain index), and points written (0: none) |
||
| real(kind=wp), | intent(out) | :: | lo(3) |
the bounding box's corners |
||
| real(kind=wp), | intent(out) | :: | hi(3) |
the bounding box's corners |
As slice, for the colors of a colored chain: c(rgba, point) of points lo .. hi of chunk j (null if not colored or nothing there).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(LineChain), | intent(in) | :: | self | |||
| integer, | intent(in) | :: | j |
the chunk, and points i1 .. i2 (chain indices) |
||
| integer, | intent(in) | :: | i1 |
the chunk, and points i1 .. i2 (chain indices) |
||
| integer, | intent(in) | :: | i2 |
the chunk, and points i1 .. i2 (chain indices) |
||
| integer, | intent(out) | :: | lo |
chain indices (lo > hi: none) |
||
| integer, | intent(out) | :: | hi |
chain indices (lo > hi: none) |
||
| real(kind=c_float), | intent(out), | dimension(:,:), pointer | :: | c |
(4, hi-lo+1): [r, g, b, a] |
The dashes' layout (set_dash_mode).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(LineChain), | intent(in) | :: | self |
Draw points i1 .. i2 only (chain indices; none if i2 < i1): e.g. a trace of decreasing times, its last points.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(LineChain), | intent(in) | :: | self | |||
| integer, | intent(in) | :: | i1 |
first and last points drawn (chain indices) |
||
| integer, | intent(in) | :: | i2 |
first and last points drawn (chain indices) |
Draw under group (a CHAIN_* kind; markers with image, a
vkf_image_read handle, for the image shape). Chunks made later are
compiled once set_compile says so.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(LineChain), | intent(inout) | :: | self | |||
| type(c_ptr), | intent(in) | :: | group |
the group node to draw under |
||
| integer, | intent(in) | :: | kind |
a CHAIN_* constant |
||
| type(c_ptr), | intent(in), | optional | :: | image |
(markers: a vkf_image_read handle) |
|
| logical, | intent(in), | optional | :: | colored |
(lines, markers: a color per point (color_slice)) |
For lines and markers, whether each point has its own color (init's colored).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(LineChain), | intent(in) | :: | self |
Chunk j's error bounds: how far the points skipped can be from the segments drawn at stride 2^k (k = 1 .. lod_levels; 0 where not known).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(LineChain), | intent(in) | :: | self | |||
| integer, | intent(in) | :: | j |
the chunk (outside 1 to the chunks: zeros) |
Number of chunks.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(LineChain), | intent(in) | :: | self |
The color of point i of a colored chain, as stored (rgba; white if not colored).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(LineChain), | intent(in) | :: | self | |||
| integer, | intent(in) | :: | i |
chain index |
Compile chunks made from now on (for the windows running): once the group is shown (not while building, when they are compiled with it).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(LineChain), | intent(inout) | :: | self | |||
| logical, | intent(in) | :: | compile |
true: compile new chunks (once the group is shown) |
For lines, how the dashes are laid out: 0 anchored to the line (the
default), 1 screen-locked (a constant length in pixels, following the
line on screen), 2 a fixed length of the line (strips): length scene
units for the pattern, or if 0 its length on screen when first drawn.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(LineChain), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | mode |
0 anchored, 1 screen-locked, 2 fixed length |
||
| real(kind=wp), | intent(in) | :: | length |
(2) the pattern's length (scene units; 0: from the first view) |
For lines, the highlight (see shaders/line.vert): flags (1 pulse, 2
arrows; 0 none), its color (rgba), the arrows' spacing and speed (window
units, and per second), the band's width (window units) and the pulse's
period (s).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(LineChain), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | flags |
1 pulse + 2 arrows (0: none) |
||
| real(kind=wp), | intent(in) | :: | color(4) |
[r, g, b, a] (0 to 1) |
||
| real(kind=wp), | intent(in) | :: | spacing |
between arrows (window units) |
||
| real(kind=wp), | intent(in) | :: | speed |
of the arrows (window units per second) |
||
| real(kind=wp), | intent(in) | :: | band |
width of the band the arrows are drawn in (window units) |
||
| real(kind=wp), | intent(in) | :: | period |
of the pulse (s) |
Level of detail on (the default: seen from far away, a strip is drawn from fewer points, within half a pixel of all of them) or off (every point drawn).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(LineChain), | intent(inout) | :: | self | |||
| logical, | intent(in) | :: | enabled |
level of detail on (false: every point drawn) |
For markers, the color (rgba), size (window units), shape (shaders/marker.frag) and attenuation radius (scene units, 0 for none).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(LineChain), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | color(4) |
[r, g, b, a] (0 to 1) |
||
| real(kind=wp), | intent(in) | :: | size |
(window units) |
||
| integer, | intent(in) | :: | shape |
marker shape (shaders/marker.frag) |
||
| real(kind=wp), | intent(in) | :: | radius |
attenuation radius (scene units; 0: none) |
For lines, a dash pattern (see line_set_pattern; z'FFFF' solid).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(LineChain), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | factor |
repeat count of each bit of the pattern |
||
| integer, | intent(in) | :: | pattern |
16-bit dash pattern (z'FFFF': solid) |
Color (rgba) and width (window units) of the whole chain.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(LineChain), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | color(4) |
[r, g, b, a] (0 to 1) |
||
| real(kind=wp), | intent(in) | :: | width |
(window units) |
For strips, the trail (see vkf_line_set_trail: 20 values; the third 0: none), given to every chunk (changed every frame the time does: a few floats per chunk uploaded).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(LineChain), | intent(inout) | :: | self | |||
| real(kind=c_float), | intent(in) | :: | values(20) |
the trail (see vkf_line_set_trail) |
The part lo .. hi of points i1 .. i2 that chunk j holds, and its buffer p(xyz and distance, high/low, lo:hi) (null if none).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(LineChain), | intent(in) | :: | self | |||
| integer, | intent(in) | :: | j |
the chunk, and points i1 .. i2 (chain indices) |
||
| integer, | intent(in) | :: | i1 |
the chunk, and points i1 .. i2 (chain indices) |
||
| integer, | intent(in) | :: | i2 |
the chunk, and points i1 .. i2 (chain indices) |
||
| integer, | intent(out) | :: | lo |
chain indices (lo > hi: none) |
||
| integer, | intent(out) | :: | hi |
chain indices (lo > hi: none) |
||
| real(kind=c_float), | intent(out), | dimension(:,:,:), pointer | :: | p |
(4, 2, hi-lo+1) |
Give the chain's style to line, a node not in the chain (e.g. a
curve's trace-mode tail, drawn as part of it).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(LineChain), | intent(in) | :: | self | |||
| type(c_ptr), | intent(in) | :: | line |
node to style (not in the chain) |
Points i1 .. i2 were written: measure a strip's distances along it (from
the distance at point i1-1), update its level of detail, and upload the
chunks holding them. x: the points in double precision, x(:, i) for
chain point i (at least i1-1 .. i2), to measure from; without it, from
the floats written. (i2 is the last point written in the chain.)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(LineChain), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | i1 |
points written (chain indices) |
||
| integer, | intent(in) | :: | i2 |
points written (chain indices) |
||
| real(kind=wp), | intent(in), | optional | :: | x(:,:) |
(3, at least i1-1 .. i2): the points |
type, public :: LineChain private type(c_ptr) :: group = c_null_ptr !! the group node the chunks are under (null: not built) logical :: compile_new = .false. !! chunks made from now on are compiled (the group is shown) type(LineChunk), allocatable :: chunks(:) !! (capacity): the chunks, in chain order integer :: n_chunks = 0 !! number of chunks integer :: kind = CHAIN_STRIP !! what is drawn: a CHAIN_* constant type(c_ptr) :: image = c_null_ptr !! (markers: the image (shape 10)) logical :: colored = .false. !! (lines, markers: a color per point (color_slice)) ! style real(c_float) :: color(4) = 1.0_c_float !! [r, g, b, a] (0 to 1) real(c_float) :: width = 1.0_c_float !! line width, or marker size integer :: shape = 0 !! markers real(c_float) :: radius = 0.0_c_float !! (markers: attenuation radius) integer :: pattern_factor = 1 !! (lines: dash pattern (see line_set_pattern)) integer :: pattern = int(z'FFFF') !! (lines: 16-bit dash pattern (z'FFFF': solid)) logical :: lod = .true. !! (strips: level of detail (else every point drawn)) real(c_float) :: highlight(12) = [1.0_c_float, 1.0_c_float, 1.0_c_float, 1.0_c_float, & 0.0_c_float, 40.0_c_float, 50.0_c_float, 12.0_c_float, & 1.5_c_float, 0.0_c_float, 0.0_c_float, 0.0_c_float] !! (lines: highlight, see vkf_line_set_highlight) real(c_float) :: trail(20) = 0.0_c_float !! (strips: the trail, see vkf_line_set_trail; z = 0: none) integer :: dash_mode = 0 !! (lines: 0 anchored, 1 screen-locked, 2 fixed length) real(wp) :: dash_length = 0.0_wp !! (2: the pattern's length, scene units; 0 from the first view) contains procedure :: init, set_compile, is_built, is_colored, release, detach procedure :: reserve, slice, color_slice, written, draw, draw_range procedure :: set_style, set_pattern, set_marker_style, set_highlight, set_trail, set_dash_mode, style_node procedure :: dash_mode_of, point, point_color, distance, num_chunks procedure :: set_lod, lod_error, chunk_bounds end type LineChain