~ubuntu-branches/debian/jessie/eso-midas/jessie

« back to all changes in this revision

Viewing changes to applic/proc/perspec.prg

  • Committer: Package Import Robot
  • Author(s): Ole Streicher
  • Date: 2014-04-22 14:44:58 UTC
  • Revision ID: package-import@ubuntu.com-20140422144458-okiwi1assxkkiz39
Tags: upstream-13.09pl1.2+dfsg
ImportĀ upstreamĀ versionĀ 13.09pl1.2+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
! @(#)perspec.prg       19.1 (ES0-DMD) 02/25/03 13:20:16
 
2
! +++++++++++++++++++++++++++++++++++++++++++++++++
 
3
!
 
4
! MIDAS procedure perspec.prg to provide perspective view
 
5
! K. Banse      920103, 920109, 940318
 
6
!
 
7
! execute as
 
8
! @a perspec inframe outframe rot_ang,tilt_ang plane_nos load_flag
 
9
!
 
10
! with rot_ang in [0,360] degrees and tilt_ang in [0,90] degrees:
 
11
!      0 degrees tilt means no tilt, i.e. normal view 
 
12
!      90 degrees tilt shows side of plane, i.e. single line closest to viewer
 
13
!      defaulted to 30.,60.
 
14
!
 
15
!      plane_nos = plane1,plane2,...,planez, e.g. 1,2,5
 
16
!      with each plane_no in [1,NPIX(3) of inframe]
 
17
!      or ALL, if all planes should be shown; defaulted to ALL
 
18
!
 
19
!      load_flag = Y(es) or N(o) for loading or not loading the resframe
 
20
!      defaulted to Yes
 
21
 
22
!  the result frame does not contain the plotted lines, to redraw those
 
23
!  lines on top of the displayed result frame, use  @a perspec,draw
 
24
!
 
25
! +++++++++++++++++++++++++++++++++++++++++++++++++
 
26
!
 
27
define/param p1 ?     ima "Enter input frame: "
 
28
define/param p2 ?     ima "Enter output frame: "
 
29
define/param p3 30.,60. n "Enter rot_angle,tilt_angle in degrees: "
 
30
define/param p4 all   c   "Enter plane no's.: "
 
31
define/param p5 y   c   "Enter load_flag: "
 
32
!
 
33
write/keyw in_a 'p1'
 
34
write/keyw out_a 'p2'
 
35
write/keyw inputr 'p3'
 
36
write/keyw inputc 'p4'
 
37
!
 
38
run APP_EXE:perspec
 
39
write/descr {out_a} history/c/1/80 -
 
40
"created via: @a perspec {p1} {p2} {p3} {p4} "
 
41
 
42
if p5(1:1) .eq. "Y" then
 
43
   load/image {out_a}
 
44
   @a perspec,draw
 
45
endif
 
46
!
 
47
entry draw                              !the drawing is done here
 
48
!---------
 
49
 
50
clear/chan over
 
51
!
 
52
draw/line {outputr(1)},{outputr(2)},{outputr(3)},{outputr(4)} f
 
53
draw/line {outputr(3)},{outputr(4)},{outputr(5)},{outputr(6)} f
 
54
draw/line {outputr(1)},{outputr(2)},{outputr(7)},{outputr(8)} f
 
55
draw/line {outputr(5)},{outputr(6)},{outputr(7)},{outputr(8)} f
 
56
!
 
57
define/local noplan/i/1/1 0
 
58
noplan = outputr(13)                    !get no. of planes
 
59
if noplan .lt. 2 return
 
60
 
61
draw/line {outputr(1)},{outputr(2)},{outputr(1)},{outputr(9)} f
 
62
draw/line {outputr(3)},{outputr(4)},{outputr(3)},{outputr(10)} f
 
63
draw/line {outputr(5)},{outputr(6)},{outputr(5)},{outputr(11)} f
 
64
define/local loop/i/1/2 0,0
 
65
loop(2) = noplan-2
 
66
!
 
67
define/local rr/r/1/5 0.,0.,0.,0.,0.
 
68
define/local kl/i/1/2 0,0
 
69
do kl = 1 4
 
70
   kl(2) = kl(1)*2
 
71
   rr({kl}) = outputr({kl(2)})
 
72
enddo
 
73
rr(5) = rr(4) + outputr(15)
 
74
draw/line {outputr(7)},{rr(4)},{outputr(7)},{rr(5)} f
 
75
if loop(2) .le. 0 goto last_plane
 
76
!
 
77
do loop = 1 {loop(2)}
 
78
   do kl = 1 4
 
79
      rr({kl}) = rr({kl})+outputr(16)
 
80
   enddo
 
81
   draw/line {outputr(1)},{rr(1)},{outputr(3)},{rr(2)} f
 
82
   draw/line {outputr(3)},{rr(2)},{outputr(5)},{rr(3)} f
 
83
   draw/line {outputr(1)},{rr(1)},{outputr(7)},{rr(4)} f
 
84
   draw/line {outputr(5)},{rr(3)},{outputr(7)},{rr(4)} f
 
85
   rr(5) = rr(4) + outputr(15)
 
86
   draw/line {outputr(7)},{rr(4)},{outputr(7)},{rr(5)} f
 
87
enddo
 
88
!
 
89
last_plane:
 
90
draw/line {outputr(1)},{outputr(9)},{outputr(3)},{outputr(10)} f
 
91
draw/line {outputr(3)},{outputr(10)},{outputr(5)},{outputr(11)} f
 
92
draw/line {outputr(1)},{outputr(9)},{outputr(7)},{outputr(12)} f
 
93
draw/line {outputr(5)},{outputr(11)},{outputr(7)},{outputr(12)} f