home *** CD-ROM | disk | FTP | other *** search
- REM name: gmupdate.cdl
-
- REM date: 020189 simon izraelevitz
-
- REM task: redefines a geometric entity by updating date base
- REM data.
-
- REM -----------------------------------------------
-
- CLEAR
- ARRAY vm[9]
- ARRAY pvm[9]
- PI = 3.1415926536
- radang = 180/PI
-
- REM *** default definition view.
- defview = -1
-
- :get_ent
- REM *** get entity to update
- SET mask
- GETENT "Indicate entity", etype
- ON (@key + 3) GOTO exit,exit,get_ent,
-
- REM *** define new view if it is different from the default view.
- :chk_view
- prview = @VIEW
- IF (prview != defview)
- GETVIEW prview,pvm
- VIEW 1,pvm[0],pvm[1],pvm[2],pvm[3],pvm[4],pvm[5],pvm[6],pvm[7],pvm[8]
- defview = prview
-
- ON (etype - 1) GOTO point,line,arc,
-
- :point
- x = @FLTDAT[0]
- y = @FLTDAT[1]
- z = @FLTDAT[2]
-
- :pt_prompt1
- SPRINT $pmpt, "WORLD: X= %f Y= %f Z= %f", x, y, z
-
- :pt_menu1
- GETMENU $pmpt,\
- "CHG X",\
- "CHG Y",\
- "CHG Z"
- key=@key
- ON (key + 3) GOTO exit, get_ent,pt_map,pt_menu1,pxw,pyw,pzw
-
- :pxw
- GETFLT "X (%f) = ",x,x
- ON (@KEY + 3) GOTO exit, pt_prompt1,pt_prompt1
- :pyw
- GETFLT "Y (%f) = ",y,y
- ON (@KEY + 3) GOTO exit, pt_prompt1,pt_prompt1
- :pzw
- GETFLT "Z (%f) = ",z,z
- ON (@KEY + 3) GOTO exit, pt_prompt1,pt_prompt1
-
- :pt_map
- CALL xfmwv, pvm, x, y, z, xv, yv, zv
-
- :pt_prompt2
- SPRINT $pmpt, "VIEW: XV= %f YV= %f ZV= %f", xv, yv, zv
-
- :pt_menu2
- GETMENU $pmpt,\
- "CHG XV",\
- "CHG YV",\
- "CHG ZV"
- ON (@key + 3) GOTO exit, pt_prompt1,make_pt,pt_menu2,pxv,pyv,pzv
-
- :pxv
- GETFLT "XV (%f) = ",xv,xv
- ON (@KEY + 3) GOTO exit, pt_prompt2,pt_prompt2
- :pyv
- GETFLT "YV (%f) = ",yv,yv
- ON (@KEY + 3) GOTO exit, pt_prompt2,pt_prompt2
- :pzv
- GETFLT "ZV (%f) = ",zv,zv
- ON (@KEY + 3) GOTO exit, pt_prompt2,pt_prompt2
-
- :make_pt
- CALL xfmvw, pvm, xv, yv, zv, x, y, z
- DELENT
- POINT x,y,z
- GOTO get_ent
-
- :line
- x1 = @FLTDAT[0]
- y1 = @FLTDAT[1]
- z1 = @FLTDAT[2]
- x2 = @FLTDAT[3]
- y2 = @FLTDAT[4]
- z2 = @FLTDAT[5]
-
- :ln_prompt1
- SPRINT $pmpt, "WORLD: X1= %f Y1= %f Z1= %f", x1, y1, z1
-
- :ln_menu1
- MODE DRAW
- POINT x1,y1,z1,5
- MODE NORMAL
- GETMENU $pmpt,\
- "CHG X1",\
- "CHG Y1",\
- "CHG Z1"
- ON (@key + 3) GOTO exit, get_ent,ln_prompt2,ln_menu1,px1,py1,pz1
-
- :px1
- GETFLT "X1 (%f) = ",x1,x1
- ON (@KEY + 3) GOTO exit, ln_prompt1,ln_prompt1
- :py1
- GETFLT "Y1 (%f) = ",y1,y1
- ON (@KEY + 3) GOTO exit, ln_prompt1,ln_prompt1
- :pz1
- GETFLT "Z1 (%f) = ",z1,z1
- ON (@KEY + 3) GOTO exit, ln_prompt1,ln_prompt1
-
- :ln_prompt2
- SPRINT $pmpt, "WORLD: X2= %f Y2= %f Z2= %f", x2, y2, z2
-
- :ln_menu2
- GETMENU $pmpt,\
- "CHG X2",\
- "CHG Y2",\
- "CHG Z2"
- ON (@key + 3) GOTO exit, ln_prompt1,ln_map,ln_menu2,px2,py2,pz2
-
- :px2
- GETFLT "X2 (%f) = ",x2,x2
- ON (@KEY + 3) GOTO exit, ln_prompt2,ln_prompt2
- :py2
- GETFLT "Y2 (%f) = ",y2,y2
- ON (@KEY + 3) GOTO exit, ln_prompt2,ln_prompt2
- :pz2
- GETFLT "Z2 (%f) = ",z2,z2
- ON (@KEY + 3) GOTO exit, ln_prompt2,ln_prompt2
-
- :ln_map
- CALL xfmwv, pvm, x1, y1, z1, xv1, yv1, zv1
- CALL xfmwv, pvm, x2, y2, z2, xv2, yv2, zv2
-
- :ln_prompt3
- SPRINT $pmpt, "VIEW: XV1= %f YV1= %f ZV1= %f", xv1, yv1, zv1
-
- :ln_menu3
- GETMENU $pmpt,\
- "CHG XV1",\
- "CHG YV1",\
- "CHG ZV1"
- ON (@key + 3) GOTO exit, ln_prompt2,ln_prompt4,ln_menu3,pxv1,pyv1,pzv1
-
- :pxv1
- GETFLT "XV1 (%f) = ",xv1,xv1
- ON (@KEY + 3) GOTO exit, ln_prompt3,ln_prompt3
- :pyv1
- GETFLT "YV1 (%f) = ",yv1,yv1
- ON (@KEY + 3) GOTO exit, ln_prompt3,ln_prompt3
- :pzv1
- GETFLT "ZV1 (%f) = ",zv1,zv1
- ON (@KEY + 3) GOTO exit, ln_prompt3,ln_prompt3
-
- :ln_prompt4
- SPRINT $pmpt, "VIEW: XV2= %f YV2= %f ZV2= %f", xv2, yv2, zv2
-
- :ln_menu4
- GETMENU $pmpt,\
- "CHG XV2",\
- "CHG YV2",\
- "CHG ZV2"
- ON (@key + 3) GOTO exit, ln_prompt3,make_ln,ln_menu4,pxv2,pyv2,pzv2
-
- :pxv2
- GETFLT "XV2 (%f) = ",xv2,xv2
- ON (@KEY + 3) GOTO exit, ln_prompt4,ln_prompt4
- :pyv2
- GETFLT "YV1 (%f) = ",yv1,yv1
- ON (@KEY + 3) GOTO exit, ln_prompt4,ln_prompt4
- :pzv2
- GETFLT "ZV1 (%f) = ",zv1,zv1
- ON (@KEY + 3) GOTO exit,ln_prompt4,ln_prompt4
-
- :make_ln
- CALL xfmvw, pvm, xv1, yv1, zv1, x1, y1, z1
- CALL xfmvw, pvm, xv2, yv2, zv2, x2, y2, z2
- DELENT
- LINE x1,y1,z1,x2,y2,z2
- GOTO get_ent
-
- :arc
- x = @FLTDAT[0]
- y = @FLTDAT[1]
- z = @FLTDAT[2]
- rad = @FLTDAT[3]
- stang = @FLTDAT[4]*radang
- endang = @FLTDAT[5]*radang + stang
-
- rem *** define arc view
- GETVIEW @INTDAT[8]
- i = 0
- :vmloop
- vm[i] = @FLTDAT[i]
- i = i + 1
- IF (i == 9)
- GOTO arc_view
- GOTO vmloop
-
- :arc_view
- VIEW 1,vm[0],vm[1],vm[2],vm[3],vm[4],vm[5],vm[6],vm[7],vm[8]
- CALL xfmvw, vm, x, y, z, xw, yw, zw
-
- :arc_prompt1
- SPRINT $pmpt, "WORLD: X= %f Y= %f Z= %f", xw, yw, zw
-
- :arc_menu1
- MODE DRAW
- POINT xw,yw,zw,5
- MODE NORMAL
- GETMENU $pmpt,\
- "CHG X",\
- "CHG Y",\
- "CHG Z"
- ON (@key + 3) GOTO exit, get_ent,arc_map,arc_menu1,cxw,cyw,czw
-
- :cxw
- GETFLT "X (%f) = ",xw,xw
- ON (@KEY + 3) GOTO exit, arc_prompt1,arc_prompt1
- :cyw
- GETFLT "Y (%f) = ",yw,yw
- ON (@KEY + 3) GOTO exit, arc_prompt1,arc_prompt1
- :czw
- GETFLT "Z (%f) = ",zw,zw
- ON (@KEY + 3) GOTO exit, arc_prompt1,arc_prompt1
-
- :arc_map
- CALL xfmwv, pvm, xw, yw, zw, xv, yv, zv
-
- :arc_prompt2
- SPRINT $pmpt, "VIEW: XV= %f YV= %f ZV= %f", xv, yv, zv
-
- :arc_menu2
- GETMENU $pmpt,\
- "CHG XV",\
- "CHG YV",\
- "CHG ZV"
- ON (@key + 3) GOTO exit, arc_prompt1,arc_prompt3,arc_menu2,cxv,cyv,czv
-
- :cxv
- GETFLT "XV (%f) = ",xv,xv
- ON (@KEY + 3) GOTO exit, arc_prompt2,arc_prompt2
- :cyv
- GETFLT "YV (%f) = ",yv,yv
- ON (@KEY + 3) GOTO exit, arc_prompt2,arc_prompt2
- :czv
- GETFLT "ZV (%f) = ",zv,zv
- ON (@KEY + 3) GOTO exit, arc_prompt2,arc_prompt2
-
- CALL xfmvw, pvm, xv, yv, zv, xw, yw, zw
- CALL xfmwv, vm, xw, yw, zw, x, y, z
-
- :arc_prompt3
- SPRINT $pmpt, " RAD= %f STANG= %f ENDANG= %f",rad,stang,endang
-
- :arc_menu3
- GETMENU $pmpt,\
- "CHG RAD",\
- "CHG ST",\
- "CHG END"
- ON (@key + 3) GOTO exit,arc_prompt2,make_arc,arc_menu3,radius,st_ang,end_ang
-
- :radius
- GETFLT "Radius (%f) = ",rad,rad,
- ON (@KEY + 3) GOTO exit, arc_prompt3,arc_prompt3
- :st_ang
- GETFLT "St. Ang (%f) = ",stang,stang,
- ON (@KEY + 3) GOTO exit, arc_prompt3,arc_prompt3
- :end_ang
- GETFLT "End Ang (%f) = ",endang,endang,
- ON (@KEY + 3) GOTO exit, arc_prompt3,arc_prompt3
-
- :make_arc
- DELENT
- ARC x, y, z, rad, stang, endang, 1
- GOTO get_ent
-
- :exit
- EXIT