state(3f) - [M_pixel] print graphics state of M_pixel graphics module
(LICENSE:PD)
definition:
recursive subroutine state(string)
character(len=*),intent(in),optional :: string
Print the state of the M_pixel graphics module. This is primarily
used in debugging during program development and is not currently in
the M_draw library.
STRING can have the following values
o all
o default
o colormap
Sample program:
program demo_state
use M_pixel
implicit none
call prefsize(640,400)
call vinit()
call state()
call vexit()
end program demo_state
Results:
VINIT CALLED: T
PREFSIZE: WIDTH= 640 HEIGHT= 400
CURRENT POSITION: X= 0.00000000 Y= 0.00000000
LINE WIDTH: 1
FONT: SIMPLEX
COLOR NUMBER: 1
CIRCLE PRECISION: 60
TEXT: HEIGHT= 10.000 WIDTH= 7.0000 ANGLE= 0.0000
TEXT JUSTIFICATION: X_CENTER= F Y_CENTER= F
VIEWPORT: LEFT= 0.0000 RIGHT= 639.00 BOTTOM= 399.00 TOP= 0.0000
WINDOW: LEFT= 0.0000 RIGHT= 640.00 BOTTOM= 0.0000 TOP= 400.00
John S. Urban
Public Domain
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in), | optional | :: | string |
recursive subroutine state(string)
! ident_52="@(#) M_pixel state(3f) print graphics state of M_pixel graphics module"
character(len=*),intent(in),optional :: string
character(len=40) :: string_local
character(len=*),parameter :: g='(*(g0))'
integer :: i
if(present(string))then
string_local=string
else
string_local='all'
endif
!-----------------------------------------------------------------------------------------------------------------------------------
select case(trim(string))
!-----------------------------------------------------------------------------------------------------------------------------------
case ('all')
call state('colormap')
call state('default')
!-----------------------------------------------------------------------------------------------------------------------------------
case ('colormap','color')
write(*,g)'COLOR MAP: ',new_line('n'),(i,P_COLORMAP(:,i),new_line('n'),i=0,255)
!-----------------------------------------------------------------------------------------------------------------------------------
case default
write(*,g)'VINIT CALLED: ',P_VINIT_CALLED
write(*,g)'PREFSIZE: WIDTH= ',P_VIEWPORT_WIDTH,' HEIGHT=',P_VIEWPORT_HEIGHT
write(*,g)'CURRENT POSITION: X=',P_X,' Y=',P_Y
write(*,g)'LINE WIDTH: ',P_WIDTH
write(*,g)'FONT: ',P_FONT
write(*,g)'COLOR NUMBER: ',P_COLOR_INDEX
write(*,g)'CIRCLE PRECISION: ',P_NSEGS
write(*,g)'TEXT: ','HEIGHT=',P_TEXT_HEIGHT,'WIDTH=',P_TEXT_WIDTH,'ANGLE=',P_TEXT_ANGLE
write(*,g)'TEXT JUSTIFICATION: ','X_CENTER=',P_X_CENTERTEXT,'Y_CENTER=',P_Y_CENTERTEXT
write(*,g)'VIEWPORT: ','LEFT=',P_VIEWPORT_LEFT,'RIGHT=',P_VIEWPORT_RIGHT,'BOTTOM=',P_VIEWPORT_BOTTOM,'TOP=',P_VIEWPORT_TOP
write(*,g)'WINDOW: ','LEFT=',P_WINDOW_LEFT,'RIGHT=',P_WINDOW_RIGHT,'BOTTOM=',P_WINDOW_BOTTOM,'TOP=',P_WINDOW_TOP
!-----------------------------------------------------------------------------------------------------------------------------------
end select
!-----------------------------------------------------------------------------------------------------------------------------------
end subroutine state