Changeset 3032 for trunk/gui


Ignore:
Timestamp:
Jun 12, 2012, 3:32:04 PM (12 years ago)
Author:
gah
Message:

intermediate updates for vtkcontourviewer

Location:
trunk/gui
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/drawingentry.tcl

    r3027 r3032  
    910910}
    911911
     912#
     913# Rewrite --
     914#
     915#       Rewrite string into list of text and substitution variables.
     916#       Also break on new lines.
     917#
     918itcl::body Rappture::DrawingEntry::ApplySubstitutions { string } {
     919    set cursor 0
     920    set list {}
     921    set lines [split $string \n]
     922    foreach line $lines {
     923        while 1 {
     924            set index [string first \$ $line $cursor]
     925            if { $index == -1 } {
     926                # Take the rest of the line
     927                lappend list "text" [string range $line $cursor end]
     928                break
     929            }
     930            # Find the end of the variable
     931            incr cursor
     932            set c [string index $line $cursor]
     933            if { $c != "{" } {
     934                lappend list "text" "\$"
     935                continue
     936            }
     937            set index [string first "\}" $string $cursor]
     938            if { $index == -1 } {
     939                error "missing } character in variable substitution."
     940            }
     941            set varName [string range $string $cursor [expr $index - 1]]
     942            set cursor [expr $index  + 1]
     943            # Check that it's a substitution variable
     944            if { ![info exists _name2path($varName)] } {
     945                error "no substitution \"$varName\" found"
     946            }
     947            set path $_name2path($name)
     948            set w [$_owner widgetfor $path]
     949            if { $w != "" } {
     950                set value [$w value]
     951            } else {
     952                set value ""
     953            }
     954            lappend list "subst" $value
     955        }
     956        lappend list "text" "\n"
     957    }
     958    return $list
     959}
  • trunk/gui/scripts/nanovisviewer.tcl

    r2876 r3032  
    117117    private method volume { tag name }
    118118    private method GetVolumeInfo { w }
     119    private method SetOrientation {}
    119120
    120121    private variable _outbuf       ;# buffer for outgoing commands
     
    10881089                set _settings($this-phi)   $_view(phi)
    10891090                set _settings($this-psi)   $_view(psi)
    1090                 SendCmd "camera angle $xyz"
     1091<                SendCmd "camera angle $xyz"
    10911092                set _click(x) $x
    10921093                set _click(y) $y
     
    18731874        incr row
    18741875    }
     1876
     1877    itk_component add orientation {
     1878        Rappture::Combobox $inner.orientation -width 10 -editable no
     1879    }
     1880    $inner.mode choices insert end \
     1881        "front"    "lines" \
     1882        "back"   "ribbons" \
     1883        "top"     "0 0 0"  \
     1884        "bottom"     "0 180 0"  \
     1885        "left"     "270 0 0 "  \
     1886        "right"     "90 0 0"  \
     1887        "default"  "45 45 0"
     1888    $itk_component(orientation) value "default"
     1889    bind $inner.mode <<Value>> [itcl::code $this SetOrientation]
     1890
    18751891    blt::table configure $inner c0 c1 -resize none
    18761892    blt::table configure $inner c2 -resize expand
     
    20372053}
    20382054
     2055
     2056itcl::body Rappture::NanovisViewer::SetOrientation {} {
     2057    set angles [$itk_component(orientation) value]
     2058    foreach name { theta phi psi } angle $angles {
     2059        set _view($name) $angle
     2060    }
     2061    set xyz [Euler2XYZ $_view(theta) $_view(phi) $_view(psi)]
     2062    SendCmd "camera angle $xyz"
     2063}
  • trunk/gui/scripts/tool.tcl

    r2977 r3032  
    212212
    213213            if { $status != 0 } {
     214                # We're here because the exec-ed program failed
    214215                if { $::Rappture::Tool::job(control) != "" } {
    215                     set code [lindex $::Rappture::Tool::job(control) 0]
    216                     set mesg [lindex $::Rappture::Tool::job(control) 2]
    217                     if { $code == "EXITED" } {
    218                         set result "Program returned exit code $status:\n\n"
     216                    foreach { token pid code mesg } \
     217                        $::Rappture::Tool::job(control) break
     218                    if { $token == "EXITED" } {
     219                        # This means that the program exited normally but
     220                        # returned a non-zero exitcode.  Consider this an
     221                        # invalid result from the program.  Append the stderr
     222                        # from the program to the message.
     223                        append result \
     224                            "\nProgram exited normally: exit code is $code\n\n"
    219225                        append result $::Rappture::Tool::job(error)
    220                     } else  {
    221                         set result \
    222                             "Abnormal program termination \"$code\": $mesg"
     226                    } elseif { $token == "abort" }  {
     227                        # The user pressed the abort button.
     228                        set result "Program terminated by user.\n\n"
     229                        append result $::Rappture::Tool::job(output)
     230                    } else {
     231                        # Abnormal termination
     232                        set result "Abnormal program termination: $mesg\n\n"
     233                        append result $::Rappture::Tool::job(output)
    223234                    }
    224235                }
  • trunk/gui/scripts/vtkheightmapviewer.tcl

    r2792 r3032  
    1 
    21# ----------------------------------------------------------------------
    32#  COMPONENT: vtkheightmapviewer - Vtk heightmap viewer
Note: See TracChangeset for help on using the changeset viewer.