The points written as the trajectory changed: the chain made again if its colors are drawn now or no longer (its first colors, or the setting), then the points new since the last written (and the last one again: set_optional; and those whose colors came since), or all of them on a redraw (cleared, a new trajectory or data sources). False if the chain isn't built.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ChainArtist), | intent(inout) | :: | self | |||
| logical, | intent(out) | :: | changed |
points written (or the chain emptied) |
logical function write_changed(self, changed) result(built) class(ChainArtist), intent(inout) :: self logical, intent(out) :: changed !! points written (or the chain emptied) integer :: n, i1 logical :: redraw changed = .false. built = self%chain%is_built() if (.not. built) return n = self%points() if (uses_colors(self) .neqv. self%chain%is_colored()) then call self%chain%detach() call self%init_chain() call self%apply_style() self%seen_generation = -1 end if changed = data_changed(self, redraw) if (redraw .or. .not. associated(self%traj)) then self%n_written = 0 self%n_colored = 0 end if if (changed) then i1 = max(1, min(self%n_written, n)) ! from the last point written (set_optional) if (self%chain%is_colored()) i1 = max(1, min(i1, self%n_colored)) ! (and colors added since) call self%chain%reserve(chain_points_per_point(self) * n) if (n >= i1) call self%write_points(i1, n) self%n_written = n end if end function write_changed