From d4f075b2478675a09ccb6eb1a4821fc014c3478c Mon Sep 17 00:00:00 2001 From: William Joye Date: Thu, 28 Mar 2019 13:21:56 -0400 Subject: add 3d mouse mode --- ds9/doc/release/r8.1.html | 1 + ds9/library/3d.tcl | 55 +++++++++ ds9/library/frame.tcl | 65 +++++++---- ds9/library/info.tcl | 3 +- ds9/library/medit.tcl | 15 ++- ds9/library/util.tcl | 7 +- ds9/parsers/modelex.fcl | 3 +- ds9/parsers/modelex.tcl | 121 ++++++++++--------- ds9/parsers/modeparser.tab.tcl | 21 ++-- ds9/parsers/modeparser.tac | 4 +- ds9/parsers/modeparser.tcl | 260 ++++++++++++++++++++++------------------- 11 files changed, 340 insertions(+), 215 deletions(-) diff --git a/ds9/doc/release/r8.1.html b/ds9/doc/release/r8.1.html index 5e8335f..f0282df 100644 --- a/ds9/doc/release/r8.1.html +++ b/ds9/doc/release/r8.1.html @@ -68,6 +68,7 @@
  • 03.21.2019 PLOT: removed old sequence flag.
  • 03.25.2019 MOVIE: fixed movie 3d to/from params issues.
  • 03.25.2019 MOVIE: add support for animated gif movies.
  • +
  • 03.28.2019 3D: add 3D mouse mode.
  • xx.xx.2019 RELEASE version 8.1b1
  • diff --git a/ds9/library/3d.tcl b/ds9/library/3d.tcl index df5fd8e..f3a9f99 100644 --- a/ds9/library/3d.tcl +++ b/ds9/library/3d.tcl @@ -367,6 +367,61 @@ proc Lock3DView {which} { } } +proc 3DMotion {which x y} { + global canvas + global threed + + set threed(az) [expr -(double($x)/$canvas(width) - .5) *2*90] + set threed(el) [expr (double($y)/$canvas(height) - .5) *2*90] + if {$threed(az) < -90} { + set threed(az) -90 + } + if {$threed(az) > 90} { + set threed(az) 90 + } + if {$threed(el) < -90} { + set threed(el) -90 + } + if {$threed(el) > 90} { + set threed(el) 90 + } + + $which 3d view $threed(az) $threed(el) + Lock3DView $which +} + +proc 3DDouble {which} { + global threed + + set threed(az) 0 + set threed(el) 0 + + $which 3d view $threed(az) $threed(el) + Lock3DView $which +} + +proc 3DArrowKey {which az el} { + global threed + + set threed(az) [expr $threed(az) + $az] + set threed(el) [expr $threed(el) + $el] + if {$threed(az) < -180} { + set threed(az) -180 + } + if {$threed(az) > 180} { + set threed(az) 180 + } + if {$threed(el) < -90} { + set threed(el) -90 + } + if {$threed(el) > 90} { + set threed(el) 90 + } + + $which 3d view $threed(az) $threed(el) + Lock3DView $which +} + # Prefs proc PrefsDialog3d {} { diff --git a/ds9/library/frame.tcl b/ds9/library/frame.tcl index e4fb46f..f953076 100644 --- a/ds9/library/frame.tcl +++ b/ds9/library/frame.tcl @@ -240,9 +240,7 @@ proc CreateNameNumberFrame {which type} { } switch $current(mode) { - crosshair { - $ds9(next) crosshair on - } + crosshair {$ds9(next) crosshair on} } UpdateFrameMenuItems @@ -566,14 +564,14 @@ proc EnterFrame {which x y} { $ds9(canvas) focus $which switch -- $current(mode) { + none - + pointer - + region {} crosshair { set coord [$which get crosshair canvas] set x [lindex $coord 0] set y [lindex $coord 1] } - none - - pointer - - region - catalog - pan - zoom - @@ -581,7 +579,8 @@ proc EnterFrame {which x y} { crop - colorbar - examine - - iexam {} + iexam - + 3d {} } EnterInfoBox $which @@ -621,8 +620,6 @@ proc LeaveFrame {which} { $ds9(canvas) focus {} switch -- $current(mode) { - crosshair {} - none - pointer - region - @@ -633,11 +630,13 @@ proc LeaveFrame {which} { crop - catalog - examine - - iexam { + iexam - + 3d { LeaveInfoBox PixelTableClearDialog ClearGraphData } + crosshair {} } $which magnifier off @@ -700,7 +699,8 @@ proc DoMotion {which x y cursor1 cursor2} { rotate - crop - examine - - iexam { + iexam - + 3d { UpdateColormapLevelMosaic $which $x $y canvas UpdateInfoBox $which $x $y canvas UpdatePixelTableDialog $which $x $y canvas @@ -765,9 +765,7 @@ proc Button1Frame {which x y} { UpdateGraphData $which $x $y canvas UpdateMagnifier $which $x $y } - colorbar { - ColorbarButton3 $x $y - } + colorbar {ColorbarButton3 $x $y} pan { PanButton $which $x $y UpdateMagnifier $which $x $y @@ -797,6 +795,7 @@ proc Button1Frame {which x y} { } examine {ExamineButton $which $x $y} iexam {IExamButton $which $x $y} + 3d {} } } @@ -836,8 +835,9 @@ proc ShiftButton1Frame {which x y} { } UpdateMagnifier $which $x $y } - examine - + examine {} iexam {} + 3d {} } } @@ -879,8 +879,9 @@ proc ControlButton1Frame {which x y} { Crop3dButton $which $x $y 1 UpdateMagnifier $which $x $y } - examine - + examine {} iexam {} + 3d {} } } @@ -920,7 +921,8 @@ proc ControlShiftButton1Frame {which x y} { rotate - crop - examine - - iexam {} + iexam - + 3d {} } } @@ -1003,8 +1005,13 @@ proc Motion1Frame {which x y} { UpdateGraphData $which $x $y canvas UpdateMagnifier $which $x $y } - examine - + examine {} iexam {} + 3d { + if {$ds9(b1)} { + 3DMotion $which $x $y + } + } } } @@ -1024,6 +1031,7 @@ proc Release1Frame {which x y} { } switch -- $current(mode) { + none {} pointer - region { if {$which == $current(frame)} { @@ -1072,9 +1080,9 @@ proc Release1Frame {which x y} { CATRelease $which $x $y } } - none - - examine - + examine {} iexam {} + 3d {} } # let others know that the mouse is up @@ -1113,6 +1121,8 @@ proc Double1Frame {which x y} { catalog - examine - iexam {} + 3d {3DDouble $which} + } } @@ -1136,7 +1146,8 @@ proc DoubleRelease1Frame {which x y} { crop - catalog - examine - - iexam {} + iexam - + 3d {} } UpdateEditMenu @@ -1418,6 +1429,18 @@ proc KeyFrame {which K A xx yy} { rotate - crop - examine {} + 3d { + switch -- $K { + Up - + k {3DArrowKey $which 0 1} + Down - + j {3DArrowKey $which 0 -1} + Left - + h {3DArrowKey $which -1 0} + Right - + l {3DArrowKey $which 1 0} + } + } } UpdateEditMenu diff --git a/ds9/library/info.tcl b/ds9/library/info.tcl index fbe0431..bdc044c 100644 --- a/ds9/library/info.tcl +++ b/ds9/library/info.tcl @@ -505,7 +505,8 @@ proc RefreshInfoBox {which} { crop - catalog - examine - - iexam { + iexam - + 3d { EnterInfoBox $which UpdateInfoBoxFrame $which } diff --git a/ds9/library/medit.tcl b/ds9/library/medit.tcl index 04bff4f..65d71e8 100644 --- a/ds9/library/medit.tcl +++ b/ds9/library/medit.tcl @@ -41,6 +41,8 @@ proc EditMainMenu {} { -variable current(mode) -value catalog -command ChangeMode $ds9(mb).edit add radiobutton -label [msgcat::mc {Examine}] \ -variable current(mode) -value examine -command ChangeMode + $ds9(mb).edit add radiobutton -label [msgcat::mc {3D}] \ + -variable current(mode) -value 3d -command ChangeMode switch $ds9(wm) { x11 - @@ -91,6 +93,8 @@ proc PrefsDialogEditMenu {w} { -variable pcurrent(mode) -value catalog $m add radiobutton -label [msgcat::mc {Examine}] \ -variable pcurrent(mode) -value examine + $m add radiobutton -label [msgcat::mc {3D}] \ + -variable pcurrent(mode) -value 3d pack $f -side top -fill both -expand true } @@ -115,6 +119,7 @@ proc ButtonsEditDef {} { edit,crop 1 edit,catalog 1 edit,examine 1 + edit,3d 1 edit,prefs 0 } } @@ -165,6 +170,9 @@ proc CreateButtonsEdit {} { RadioButton $ds9(buttons).edit.examine \ [string tolower [msgcat::mc {Exam}]] \ current(mode) examine ChangeMode + RadioButton $ds9(buttons).edit.3d \ + [string tolower [msgcat::mc {3D}]] \ + current(mode) 3d ChangeMode ButtonButton $ds9(buttons).edit.prefs \ [string tolower [msgcat::mc {Preferences}]] PrefsDialog @@ -184,6 +192,7 @@ proc CreateButtonsEdit {} { $ds9(buttons).edit.crop pbuttons(edit,crop) $ds9(buttons).edit.catalog pbuttons(edit,catalog) $ds9(buttons).edit.examine pbuttons(edit,examine) + $ds9(buttons).edit.3d pbuttons(edit,3d) $ds9(buttons).edit.prefs pbuttons(edit,prefs) " } @@ -227,6 +236,8 @@ proc PrefsDialogButtonbarEdit {f} { -variable pbuttons(edit,catalog) -command {UpdateButtons buttons(edit)} $m add checkbutton -label [msgcat::mc {Examine}] \ -variable pbuttons(edit,examine) -command {UpdateButtons buttons(edit)} + $m add checkbutton -label [msgcat::mc {3D}] \ + -variable pbuttons(edit,3d) -command {UpdateButtons buttons(3d)} $m add separator $m add checkbutton -label [msgcat::mc {Preferences}] \ -variable pbuttons(edit,prefs) -command {UpdateButtons buttons(edit)} @@ -297,7 +308,7 @@ proc UpdateEditMenu {} { crop - catalog - examine - - iexam {$ds9(mb).edit entryconfig [msgcat::mc {Undo}] -state disabled} + iexam - + 3d {$ds9(mb).edit entryconfig [msgcat::mc {Undo}] -state disabled} } } - diff --git a/ds9/library/util.tcl b/ds9/library/util.tcl index c897c5f..0722489 100644 --- a/ds9/library/util.tcl +++ b/ds9/library/util.tcl @@ -160,7 +160,8 @@ proc UpdateMain {} { rotate - crop - examine - - iexam {} + iexam - + 3d {} } } @@ -967,6 +968,7 @@ proc ChangeMode {} { crop {SetCursor {}} examine {SetCursor target} iexam {} + 3d {SetCursor {}} } } @@ -1487,7 +1489,8 @@ proc CursorCmd {x y} { rotate - crop - examine - - iexam {} + iexam - + 3d {} } } diff --git a/ds9/parsers/modelex.fcl b/ds9/parsers/modelex.fcl index 7dab10a..fd7ff75 100644 --- a/ds9/parsers/modelex.fcl +++ b/ds9/parsers/modelex.fcl @@ -8,6 +8,7 @@ %% none {return $NONE_} +pointer {return $POINTER_} region {return $REGION_} crosshair {return $CROSSHAIR_} colorbar {return $COLORBAR_} @@ -17,7 +18,7 @@ rotate {return $ROTATE_} crop {return $CROP_} catalog {return $CATALOG_} examine {return $EXAMINE_} -pointer {return $POINTER_} +3d {return $3D_} #include string.fin #include ws.fin diff --git a/ds9/parsers/modelex.tcl b/ds9/parsers/modelex.tcl index 7de9bf5..6da85d5 100644 --- a/ds9/parsers/modelex.tcl +++ b/ds9/parsers/modelex.tcl @@ -181,16 +181,17 @@ proc mode::yylex {} { set STRING_ 257 set NONE_ 258 -set REGION_ 259 -set CROSSHAIR_ 260 -set COLORBAR_ 261 -set PAN_ 262 -set ZOOM_ 263 -set ROTATE_ 264 -set CROP_ 265 -set CATALOG_ 266 -set EXAMINE_ 267 -set POINTER_ 268 +set POINTER_ 259 +set REGION_ 260 +set CROSSHAIR_ 261 +set COLORBAR_ 262 +set PAN_ 263 +set ZOOM_ 264 +set ROTATE_ 265 +set CROP_ 266 +set CATALOG_ 267 +set EXAMINE_ 268 +set 3D_ 269 while {1} { if {[string length $yy_current_buffer] - $index_ < 1024} { @@ -219,118 +220,125 @@ set POINTER_ 268 set yyleng [string length $yytext] set matched_rule 0 } - # rule 1: region - if {[regexp -start $index_ -indices -line -nocase -- {\A(region)} $yy_current_buffer match] > 0 && \ + # rule 1: pointer + if {[regexp -start $index_ -indices -line -nocase -- {\A(pointer)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 1 } - # rule 2: crosshair - if {[regexp -start $index_ -indices -line -nocase -- {\A(crosshair)} $yy_current_buffer match] > 0 && \ + # rule 2: region + if {[regexp -start $index_ -indices -line -nocase -- {\A(region)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 2 } - # rule 3: colorbar - if {[regexp -start $index_ -indices -line -nocase -- {\A(colorbar)} $yy_current_buffer match] > 0 && \ + # rule 3: crosshair + if {[regexp -start $index_ -indices -line -nocase -- {\A(crosshair)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 3 } - # rule 4: pan - if {[regexp -start $index_ -indices -line -nocase -- {\A(pan)} $yy_current_buffer match] > 0 && \ + # rule 4: colorbar + if {[regexp -start $index_ -indices -line -nocase -- {\A(colorbar)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 4 } - # rule 5: zoom - if {[regexp -start $index_ -indices -line -nocase -- {\A(zoom)} $yy_current_buffer match] > 0 && \ + # rule 5: pan + if {[regexp -start $index_ -indices -line -nocase -- {\A(pan)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 5 } - # rule 6: rotate - if {[regexp -start $index_ -indices -line -nocase -- {\A(rotate)} $yy_current_buffer match] > 0 && \ + # rule 6: zoom + if {[regexp -start $index_ -indices -line -nocase -- {\A(zoom)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 6 } - # rule 7: crop - if {[regexp -start $index_ -indices -line -nocase -- {\A(crop)} $yy_current_buffer match] > 0 && \ + # rule 7: rotate + if {[regexp -start $index_ -indices -line -nocase -- {\A(rotate)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 7 } - # rule 8: catalog - if {[regexp -start $index_ -indices -line -nocase -- {\A(catalog)} $yy_current_buffer match] > 0 && \ + # rule 8: crop + if {[regexp -start $index_ -indices -line -nocase -- {\A(crop)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 8 } - # rule 9: examine - if {[regexp -start $index_ -indices -line -nocase -- {\A(examine)} $yy_current_buffer match] > 0 && \ + # rule 9: catalog + if {[regexp -start $index_ -indices -line -nocase -- {\A(catalog)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 9 } - # rule 10: pointer - if {[regexp -start $index_ -indices -line -nocase -- {\A(pointer)} $yy_current_buffer match] > 0 && \ + # rule 10: examine + if {[regexp -start $index_ -indices -line -nocase -- {\A(examine)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 10 } - # rule 11: \"[^\"]*\" - if {[regexp -start $index_ -indices -line -nocase -- {\A(\"[^\"]*\")} $yy_current_buffer match] > 0 && \ + # rule 11: 3d + if {[regexp -start $index_ -indices -line -nocase -- {\A(3d)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 11 } - # rule 12: \'[^\']*\' - if {[regexp -start $index_ -indices -line -nocase -- {\A(\'[^\']*\')} $yy_current_buffer match] > 0 && \ + # rule 12: \"[^\"]*\" + if {[regexp -start $index_ -indices -line -nocase -- {\A(\"[^\"]*\")} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 12 } - # rule 13: \{[^\}]*\} - if {[regexp -start $index_ -indices -line -nocase -- {\A(\{[^\}]*\})} $yy_current_buffer match] > 0 && \ + # rule 13: \'[^\']*\' + if {[regexp -start $index_ -indices -line -nocase -- {\A(\'[^\']*\')} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 13 } - # rule 14: \S+\S+ - if {[regexp -start $index_ -indices -line -nocase -- {\A(\S+\S+)} $yy_current_buffer match] > 0 && \ + # rule 14: \{[^\}]*\} + if {[regexp -start $index_ -indices -line -nocase -- {\A(\{[^\}]*\})} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 14 } - # rule 15: \s - if {[regexp -start $index_ -indices -line -nocase -- {\A(\s)} $yy_current_buffer match] > 0 && \ + # rule 15: \S+\S+ + if {[regexp -start $index_ -indices -line -nocase -- {\A(\S+\S+)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 15 } - # rule 16: . - if {[regexp -start $index_ -indices -line -nocase -- {\A(.)} $yy_current_buffer match] > 0 && \ + # rule 16: \s + if {[regexp -start $index_ -indices -line -nocase -- {\A(\s)} $yy_current_buffer match] > 0 && \ [lindex $match 1] - $index_ + 1 > $yyleng} { set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] set yyleng [string length $yytext] set matched_rule 16 } + # rule 17: . + if {[regexp -start $index_ -indices -line -nocase -- {\A(.)} $yy_current_buffer match] > 0 && \ + [lindex $match 1] - $index_ + 1 > $yyleng} { + set yytext [string range $yy_current_buffer $index_ [lindex $match 1]] + set yyleng [string length $yytext] + set matched_rule 17 + } if {$matched_rule == -1} { set yytext [string index $yy_current_buffer $index_] set yyleng 1 @@ -347,37 +355,37 @@ set POINTER_ 268 return $NONE_ } 1 { -return $REGION_ +return $POINTER_ } 2 { -return $CROSSHAIR_ +return $REGION_ } 3 { -return $COLORBAR_ +return $CROSSHAIR_ } 4 { -return $PAN_ +return $COLORBAR_ } 5 { -return $ZOOM_ +return $PAN_ } 6 { -return $ROTATE_ +return $ZOOM_ } 7 { -return $CROP_ +return $ROTATE_ } 8 { -return $CATALOG_ +return $CROP_ } 9 { -return $EXAMINE_ +return $CATALOG_ } 10 { -return $POINTER_ +return $EXAMINE_ } 11 { -set yylval [string range $yytext 1 end-1]; return $STRING_ +return $3D_ } 12 { set yylval [string range $yytext 1 end-1]; return $STRING_ @@ -386,12 +394,15 @@ set yylval [string range $yytext 1 end-1]; return $STRING_ set yylval [string range $yytext 1 end-1]; return $STRING_ } 14 { -set yylval $yytext; return $STRING_ +set yylval [string range $yytext 1 end-1]; return $STRING_ } 15 { -# ignore whitespace +set yylval $yytext; return $STRING_ } 16 { +# ignore whitespace + } + 17 { set yylval $yytext; return $yylval } default diff --git a/ds9/parsers/modeparser.tab.tcl b/ds9/parsers/modeparser.tab.tcl index 2059a9e..60e6e44 100644 --- a/ds9/parsers/modeparser.tab.tcl +++ b/ds9/parsers/modeparser.tab.tcl @@ -1,12 +1,13 @@ set STRING_ 257 set NONE_ 258 -set REGION_ 259 -set CROSSHAIR_ 260 -set COLORBAR_ 261 -set PAN_ 262 -set ZOOM_ 263 -set ROTATE_ 264 -set CROP_ 265 -set CATALOG_ 266 -set EXAMINE_ 267 -set POINTER_ 268 +set POINTER_ 259 +set REGION_ 260 +set CROSSHAIR_ 261 +set COLORBAR_ 262 +set PAN_ 263 +set ZOOM_ 264 +set ROTATE_ 265 +set CROP_ 266 +set CATALOG_ 267 +set EXAMINE_ 268 +set 3D_ 269 diff --git a/ds9/parsers/modeparser.tac b/ds9/parsers/modeparser.tac index f745303..5773783 100644 --- a/ds9/parsers/modeparser.tac +++ b/ds9/parsers/modeparser.tac @@ -7,6 +7,7 @@ %start command %token NONE_ +%token POINTER_ %token REGION_ %token CROSSHAIR_ %token COLORBAR_ @@ -16,7 +17,7 @@ %token CROP_ %token CATALOG_ %token EXAMINE_ -%token POINTER_ +%token 3D_ %% @@ -37,6 +38,7 @@ item : NONE_ {set _ none} | CROP_ {set _ crop} | CATALOG_ {set _ catalog} | EXAMINE_ {set _ examine} + | 3D_ {set _ 3d} # backward compatibilty | POINTER_ {set _ region} ; diff --git a/ds9/parsers/modeparser.tcl b/ds9/parsers/modeparser.tcl index f709535..fdf20dd 100644 --- a/ds9/parsers/modeparser.tcl +++ b/ds9/parsers/modeparser.tcl @@ -62,12 +62,13 @@ proc mode::unsetupvalues {numsyms} { array set mode::table { 0:258 shift + 5:0,target 8 0:260 shift 0:259 shift 2:257 reduce - 5:0,target 9 + 15:0,target 4 9:0 reduce - 8:257,target 12 + 8:257,target 11 0:261 shift 0:266,target 9 11:0 reduce @@ -76,98 +77,104 @@ array set mode::table { 0:263 shift 6:257 reduce 0:264 shift - 3:257,target 7 - 13:270 goto + 3:257,target 6 0:265 shift + 15:0 reduce 8:257 reduce 0:266 shift - 15:257,target 16 + 15:257,target 4 0:267 shift - 13:270,target 15 0:265,target 8 0:268 shift - 6:0,target 10 - 0:269 goto - 16:0,target 3 - 10:257,target 14 - 0:271 goto + 6:0,target 9 + 0:270 goto + 0:269 shift + 10:257,target 13 2:0 reduce 0:272 goto + 0:273 goto 6:0 reduce - 6:257,target 10 + 6:257,target 9 0:264,target 7 - 7:0,target 11 + 7:0,target 10 1:257,target 5 - 12:0 accept - 10:0,target 14 - 13:257,target 2 + 17:0,target 3 + 12:0 reduce + 10:0,target 13 0:263,target 6 - 16:0 reduce 10:257 reduce - 9:257,target 13 + 0:273,target 15 + 12:257 reduce + 14:271,target 16 + 9:257,target 12 14:257 reduce - 8:0,target 12 + 8:0,target 11 3:0 reduce 1:0,target 5 - 11:0,target 15 + 16:257 shift + 11:0,target 14 0:262,target 5 - 4:257,target 8 + 4:257,target 7 0:272,target 14 7:0 reduce 1:257 reduce + 16:257,target 17 3:257 reduce - 11:257,target 15 + 11:257,target 14 5:257 reduce - 13:0 reduce - 9:0,target 13 + 13:0 accept + 9:0,target 12 0:261,target 4 7:257 reduce - 0:271,target 13 - 2:0,target 6 - 12:0,target 0 + 2:0,target 16 + 12:0,target 15 + 14:271 goto 9:257 reduce - 7:257,target 11 - 0:259,target 2 + 17:0 reduce + 7:257,target 10 0:260,target 3 - 2:257,target 6 + 0:259,target 2 + 2:257,target 16 + 0:270,target 13 0:269,target 12 4:0 reduce - 14:257,target 4 - 3:0,target 7 - 13:0,target 1 + 14:257,target 2 + 3:0,target 6 + 13:0,target 0 8:0 reduce 10:0 reduce 0:258,target 1 0:268,target 11 14:0 reduce - 5:257,target 9 - 4:0,target 8 - 14:0,target 4 + 5:257,target 8 + 4:0,target 7 + 14:0,target 1 11:257 reduce 1:0 reduce - 13:257 reduce 0:267,target 10 - 15:257 shift + 15:257 reduce + 12:257,target 15 5:0 reduce } array set mode::rules { - 9,l 272 - 11,l 272 - 15,l 272 - 2,l 270 - 6,l 272 - 12,l 272 - 3,l 269 - 7,l 272 - 13,l 272 - 0,l 273 - 4,l 271 - 8,l 272 - 10,l 272 - 14,l 272 - 1,l 269 - 5,l 272 + 9,l 273 + 11,l 273 + 15,l 273 + 2,l 271 + 6,l 273 + 12,l 273 + 16,l 273 + 3,l 270 + 7,l 273 + 13,l 273 + 0,l 274 + 4,l 272 + 8,l 273 + 10,l 273 + 14,l 273 + 1,l 270 + 5,l 273 } array set mode::rules { @@ -183,6 +190,7 @@ array set mode::rules { 13,dc 1 9,dc 1 4,dc 1 + 16,dc 1 11,dc 1 7,dc 1 2,dc 0 @@ -190,84 +198,89 @@ array set mode::rules { } array set mode::rules { - 13,line 41 + 13,line 42 2,e 1 - 7,line 35 - 10,line 38 - 4,line 30 - 1,line 26 - 15,line 44 - 9,line 37 - 12,line 40 - 6,line 34 - 3,line 27 + 7,line 36 + 10,line 39 + 4,line 31 + 1,line 27 + 15,line 45 + 9,line 38 + 12,line 41 + 6,line 35 + 3,line 28 14,line 43 - 8,line 36 - 11,line 39 - 5,line 33 - 2,line 26 + 8,line 37 + 11,line 40 + 5,line 34 + 2,line 27 + 16,line 46 } array set mode::lr1_table { - 13,trans {{270 15}} - 0 {{0 0 0} {1 0 0} {3 0 0} {4 {0 257} 0} {5 {0 257} 0} {6 {0 257} 0} {7 {0 257} 0} {8 {0 257} 0} {9 {0 257} 0} {10 {0 257} 0} {11 {0 257} 0} {12 {0 257} 0} {13 {0 257} 0} {14 {0 257} 0} {15 {0 257} 0}} - 14,trans {} + 17 {{3 0 3}} + 13,trans {} + 0 {{0 0 0} {1 0 0} {3 0 0} {4 {0 257} 0} {5 {0 257} 0} {6 {0 257} 0} {7 {0 257} 0} {8 {0 257} 0} {9 {0 257} 0} {10 {0 257} 0} {11 {0 257} 0} {12 {0 257} 0} {13 {0 257} 0} {14 {0 257} 0} {15 {0 257} 0} {16 {0 257} 0}} + 14,trans {{271 16}} 1 {{5 {0 257} 1}} - 15,trans {{257 16}} - 2 {{6 {0 257} 1}} - 16,trans {} - 3 {{7 {0 257} 1}} - 0,trans {{258 1} {259 2} {260 3} {261 4} {262 5} {263 6} {264 7} {265 8} {266 9} {267 10} {268 11} {269 12} {271 13} {272 14}} - 4 {{8 {0 257} 1}} + 15,trans {} + 2 {{16 {0 257} 1}} + 16,trans {{257 17}} + 3 {{6 {0 257} 1}} + 17,trans {} + 0,trans {{258 1} {259 2} {260 3} {261 4} {262 5} {263 6} {264 7} {265 8} {266 9} {267 10} {268 11} {269 12} {270 13} {272 14} {273 15}} + 4 {{7 {0 257} 1}} 1,trans {} - 5 {{9 {0 257} 1}} + 5 {{8 {0 257} 1}} 2,trans {} - 6 {{10 {0 257} 1}} + 6 {{9 {0 257} 1}} 3,trans {} - 7 {{11 {0 257} 1}} + 7 {{10 {0 257} 1}} 4,trans {} - 8 {{12 {0 257} 1}} + 8 {{11 {0 257} 1}} 5,trans {} - 9 {{13 {0 257} 1}} - 10 {{14 {0 257} 1}} + 9 {{12 {0 257} 1}} + 10 {{13 {0 257} 1}} 6,trans {} - 11 {{15 {0 257} 1}} + 11 {{14 {0 257} 1}} 7,trans {} - 12 {{0 0 1}} + 12 {{15 {0 257} 1}} 8,trans {} - 13 {{1 0 1} {3 0 1} {2 257 0}} + 13 {{0 0 1}} 10,trans {} 9,trans {} - 14 {{4 {0 257} 1}} - 15 {{3 0 2}} + 14 {{1 0 1} {3 0 1} {2 257 0}} 11,trans {} - 16 {{3 0 3}} + 15 {{4 {0 257} 1}} + 16 {{3 0 2}} 12,trans {} } array set mode::token_id_table { 264,line 17 270,t 1 - 269,t 1 - 265,title CROP + 269,t 0 + 265,title ROTATE + 274,t 1 261,line 14 257,t 0 270,title {} - 269,title {} - 273,line 45 + 269,title 3D + 273,line 33 257,line 7 262,t 0 + 274,title {} 270,line 26 - 269,line 25 - 259,title REGION - 260,title CROSSHAIR + 269,line 22 + 259,title POINTER + 260,title REGION 266,t 0 271,t 1 error error - 264,title ROTATE + 264,title ZOOM 266,line 19 - error,line 24 - 268,title POINTER + error,line 25 + 268,title EXAMINE 258,t 0 263,line 16 error,title {} @@ -276,50 +289,52 @@ array set mode::token_id_table { 259,line 12 260,line 13 258,title NONE - 272,line 32 + 272,line 30 267,t 0 - 263,title ZOOM + 263,title PAN 272,t 1 268,line 21 - 267,title EXAMINE + 267,title CATALOG 257 STRING_ 258 NONE_ 259,t 0 - 259 REGION_ - 260 CROSSHAIR_ + 259 POINTER_ + 260 REGION_ 260,t 0 272,title {} - 261 COLORBAR_ + 261 CROSSHAIR_ 265,line 18 - 262 PAN_ - 263 ZOOM_ + 262 COLORBAR_ + 263 PAN_ 257,title string - 264 ROTATE_ + 264 ZOOM_ 264,t 0 - 265 CROP_ + 265 ROTATE_ 262,line 15 - 266 CATALOG_ - 267 EXAMINE_ + 266 CROP_ + 267 CATALOG_ 0,t 0 0 {$} - 262,title PAN - 268 POINTER_ + 262,title COLORBAR + 268 EXAMINE_ 268,t 0 - 270 @PSEUDO1 - 269 command - 271 mode + 274,line 47 + 270 command + 269 3D_ + 271 @PSEUDO1 error,t 0 - 272 item + 272 mode 258,line 11 273,t 1 - 273 start' - 266,title CATALOG - 271,line 29 + 273 item + 266,title CROP + 274 start' + 271,line 27 271,title {} 261,t 0 267,line 20 265,t 0 - 261,title COLORBAR + 261,title CROSSHAIR } proc mode::yyparse {} { @@ -428,7 +443,8 @@ proc mode::yyparse {} { 12 { set _ crop } 13 { set _ catalog } 14 { set _ examine } - 15 { set _ region } + 15 { set _ 3d } + 16 { set _ region } } unsetupvalues $dc # pop off tokens from the stack if normal rule -- cgit v0.12