Ignore:
Timestamp:
Jul 10, 2014 6:08:15 AM (10 years ago)
Author:
ldelgass
Message:

Merge r4169,r4344 from trunk: merge field 2D/3D result, add VTK surface viewer

Location:
branches/1.3
Files:
2 deleted
5 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/1.3

  • branches/1.3/gui/scripts/Makefile.in

    r4474 r4481  
    5151                $(srcdir)/energyLevels.tcl \
    5252                $(srcdir)/field.tcl \
    53                 $(srcdir)/field2dresult.tcl \
    54                 $(srcdir)/field3dresult.tcl \
     53                $(srcdir)/fieldresult.tcl \
    5554                $(srcdir)/filexfer.tcl \
    5655                $(srcdir)/flowdial.tcl \
     
    135134                $(srcdir)/vtkmeshviewer.tcl \
    136135                $(srcdir)/vtkstreamlinesviewer.tcl \
     136                $(srcdir)/vtksurfaceviewer.tcl \
    137137                $(srcdir)/vtkvolumeviewer.tcl \
    138138                $(srcdir)/vtkheightmapviewer.tcl \
  • branches/1.3/gui/scripts/fieldresult.tcl

    r4169 r4481  
    6161            set servers [Rappture::VisViewer::GetServerList "nanovis"]
    6262        }
    63         "contour" - "glyphs" - "heightmap" - "isosurface" - "streamlines" - "vtkimage" - "vtkviewer" - "vtkvolume" {
     63        "contour" - "glyphs" - "heightmap" - "isosurface" - "streamlines" - "surface" - "vtkimage" - "vtkviewer" - "vtkvolume" {
    6464            set servers [Rappture::VisViewer::GetServerList "vtkvis"]
    6565        }
     
    8787            "contour" - "heightmap" {
    8888                itk_component add renderer {
    89                     Rappture::VtkHeightmapViewer $itk_interior.ren \
    90                         $servers -mode $flags(-mode)
     89                    Rappture::VtkHeightmapViewer $itk_interior.ren $servers \
     90                        -mode $flags(-mode)
    9191                }
    9292            }
     
    9999                itk_component add renderer {
    100100                    Rappture::VtkStreamlinesViewer $itk_interior.ren $servers
     101                }
     102            }
     103            "surface" {
     104                itk_component add renderer {
     105                    Rappture::VtkSurfaceViewer $itk_interior.ren $servers
    101106                }
    102107            }
  • branches/1.3/gui/scripts/resultviewer.tcl

    r4474 r4481  
    307307                    }
    308308                }
    309                 2D {
    310                     set mode "field2d"
    311                     set viewer [$dataobj viewer]
    312                     set extents [$dataobj extents]
    313                     if { $extents > 1 } {
    314                         set mode "flowvis"
    315                     }
    316                     if {![info exists _mode2widget($mode)]} {
    317                         set w $itk_interior.$mode
    318                         if { ![winfo exists $w] } {
    319                             Rappture::Field2DResult $w -mode $viewer
    320                         }
    321                         set _mode2widget($mode) $w
    322                     }
    323                 }
    324                 3D {
     309                default {
    325310                    set mode [$dataobj viewer]
    326                     set extents [$dataobj extents]
    327                     if { $extents > 1 } {
    328                         set mode "flowvis"
    329                     }
    330311                    if {![info exists _mode2widget($mode)]} {
    331312                        set w $itk_interior.$mode
    332313                        if { ![winfo exists $w] } {
    333                             Rappture::Field3DResult $w -mode $mode
     314                            Rappture::FieldResult $w -mode $mode
    334315                        }
    335316                        set _mode2widget($mode) $w
    336317                    }
    337                 }
    338                 default {
    339                     puts stderr "WARNING: can't handle \"$dims\" dimension field"
    340                     return
    341318                }
    342319            }
  • branches/1.3/gui/scripts/sequenceresult.tcl

    r3800 r4481  
    493493                }
    494494                set mode [$dataobj viewer]
    495                 switch -- $dimensions {
    496                     2D {
    497                         Rappture::Field2DResult $w -mode $mode
    498                     }
    499                     3D {
    500                         Rappture::Field3DResult $w -mode $mode
    501                     }
    502                     default {
    503                         error "don't know how to view sequences of $type\
    504                             with \"$dimensions\" dimensions dim=[$dataobj components -dimensions]"
    505                     }
    506                 }
     495                FieldResult $w -mode $mode
    507496                pack $w -expand yes -fill both
    508497            }
  • branches/1.3/gui/scripts/vtkglyphviewer.tcl

    r4455 r4481  
    11# -*- mode: tcl; indent-tabs-mode: nil -*-
    2 
    32# ----------------------------------------------------------------------
    43#  COMPONENT: vtkglyphviewer - Vtk 3D glyphs object viewer
     
    87# ======================================================================
    98#  AUTHOR:  Michael McLennan, Purdue University
    10 #  Copyright (c) 2004-2005  Purdue Research Foundation
     9#  Copyright (c) 2004-2014  HUBzero Foundation, LLC
    1110#
    1211#  See the file "license.terms" for information on usage and
     
    14781477itcl::body Rappture::VtkGlyphViewer::RequestLegend {} {
    14791478    set _legendPending 0
    1480     if { ![info exists _fields($_curFldName)] } {
    1481         return
    1482     }
     1479    set font "Arial 8"
     1480    set w 12
     1481    set lineht [font metrics $font -linespace]
     1482    # color ramp height = (canvas height) - (min and max value lines) - 2
     1483    set h [expr {$_height - 2 * ($lineht + 2)}]
     1484
    14831485    set fname $_curFldName
    1484     set font "Arial 8"
    1485     set lineht [font metrics $font -linespace]
    1486     set w 12
    1487     set h [expr {$_height - 2 * ($lineht + 2)}]
    1488     if { $h < 1 } {
    1489         return
    1490     }
    14911486    if { [string match "component*" $fname] } {
    14921487        set title ""
     
    15041499    if { $title != "" } {
    15051500        incr h -$lineht
     1501    }
     1502    if { $h < 1 } {
     1503        return
    15061504    }
    15071505    # Set the legend on the first heightmap dataset.
     
    22992297        # If there's a legend title, create a text item for the title.
    23002298        $c create text $x $y \
    2301                 -anchor ne \
    2302                 -fill $itk_option(-plotforeground) -tags "title legend" \
    2303                 -font $font
    2304             incr y $lineht
     2299            -anchor ne \
     2300            -fill $itk_option(-plotforeground) -tags "title legend" \
     2301            -font $font
     2302        if { $title != "" } {
     2303            incr y $lineht
     2304        }
    23052305        $c create text $x $y \
    2306             -anchor ne \
    2307             -fill $itk_option(-plotforeground) -tags "vmax legend" \
    2308             -font $font
     2306            -anchor ne \
     2307            -fill $itk_option(-plotforeground) -tags "vmax legend" \
     2308            -font $font
    23092309        incr y $lineht
    23102310        $c create image $x $y \
    2311             -anchor ne \
    2312             -image $_image(legend) -tags "colormap legend"
     2311            -anchor ne \
     2312            -image $_image(legend) -tags "colormap legend"
    23132313        $c create rectangle $x $y 1 1 \
    2314             -fill "" -outline "" -tags "sensor legend"
     2314            -fill "" -outline "" -tags "sensor legend"
    23152315        $c create text $x [expr {$h-2}] \
    2316             -anchor se \
    2317             -fill $itk_option(-plotforeground) -tags "vmin legend" \
    2318             -font $font
     2316            -anchor se \
     2317            -fill $itk_option(-plotforeground) -tags "vmin legend" \
     2318            -font $font
    23192319        $c bind sensor <Enter> [itcl::code $this EnterLegend %x %y]
    23202320        $c bind sensor <Leave> [itcl::code $this LeaveLegend]
Note: See TracChangeset for help on using the changeset viewer.