band_y_visible Function

private pure function band_y_visible(bd, j0, j1) result(vis)

Test whether band bd overlaps y window over models j0..j1.

Bands outside y window must not be emitted: linked into keyholed fill, their bridges would cross window, and cairo xlib backend does not confine giza's clip-and-stroke hatch to a zero-area keyhole clip, so hatch lines flood axes box on /xw.

Arguments

Type IntentOptional Attributes Name
type(band_t), intent(in) :: bd

Band to test.

integer(kind=int32), intent(in) :: j0

First model of visible stretch.

integer(kind=int32), intent(in) :: j1

Last model of visible stretch.

Return Value logical


Source Code

   pure function band_y_visible(bd, j0, j1) result(vis)
      !! Test whether band `bd` overlaps y window over models `j0`..`j1`.
      !!
      !! Bands outside y window must not be emitted: linked into keyholed fill, their bridges would
      !! cross window, and cairo xlib backend does not confine giza's clip-and-stroke hatch to a
      !! zero-area keyhole clip, so hatch lines flood axes box on /xw.
      ! Arguments
      type(band_t), intent(in) :: bd
         !! Band to test.
      integer(int32), intent(in) :: j0
         !! First model of visible stretch.
      integer(int32), intent(in) :: j1
         !! Last model of visible stretch.
      logical :: vis
      integer(int32) :: i, o
      real(real64) :: blo, bhi
      o = 1 - bd%i0
      blo = huge(1.d0); bhi = -huge(1.d0)
      do i = j0, j1
         blo = min(blo, bd%ylo(i + o))
         bhi = max(bhi, bd%yhi(i + o))
      end do
      vis = ytrans(bhi) >= ytrans2(st%ymin) .and. ytrans(blo) <= ytrans2(st%ymax)
   end function band_y_visible