Changeset 4344 for trunk


Ignore:
Timestamp:
Apr 16, 2014, 1:18:07 PM (11 years ago)
Author:
ldelgass
Message:

Add VTK surface viewer for viewing colormapped surfaces from any field.

Location:
trunk/gui/scripts
Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/Makefile.in

    r4267 r4344  
    139139                $(srcdir)/vtkmeshviewer.tcl \
    140140                $(srcdir)/vtkstreamlinesviewer.tcl \
     141                $(srcdir)/vtksurfaceviewer.tcl \
    141142                $(srcdir)/vtkvolumeviewer.tcl \
    142143                $(srcdir)/vtkheightmapviewer.tcl \
  • trunk/gui/scripts/fieldresult.tcl

    r4301 r4344  
    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        }
     
    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            }
  • trunk/gui/scripts/vtkglyphviewer.tcl

    r4338 r4344  
    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
     
    15131512itcl::body Rappture::VtkGlyphViewer::RequestLegend {} {
    15141513    set _legendPending 0
    1515     if { ![info exists _fields($_curFldName)] } {
    1516         return
    1517     }
     1514    set font "Arial 8"
     1515    set w 12
     1516    set lineht [font metrics $font -linespace]
     1517    # color ramp height = (canvas height) - (min and max value lines) - 2
     1518    set h [expr {$_height - 2 * ($lineht + 2)}]
     1519
    15181520    set fname $_curFldName
    1519     set font "Arial 8"
    1520     set lineht [font metrics $font -linespace]
    1521     set w 12
    1522     set h [expr {$_height - 2 * ($lineht + 2)}]
    1523     if { $h < 1 } {
    1524         return
    1525     }
    15261521    if { [string match "component*" $fname] } {
    15271522        set title ""
     
    15391534    if { $title != "" } {
    15401535        incr h -$lineht
     1536    }
     1537    if { $h < 1 } {
     1538        return
    15411539    }
    15421540    # Set the legend on the first heightmap dataset.
     
    24262424        # If there's a legend title, create a text item for the title.
    24272425        $c create text $x $y \
    2428                 -anchor ne \
    2429                 -fill $itk_option(-plotforeground) -tags "title legend" \
    2430                 -font $font
    2431             incr y $lineht
     2426            -anchor ne \
     2427            -fill $itk_option(-plotforeground) -tags "title legend" \
     2428            -font $font
     2429        if { $title != "" } {
     2430            incr y $lineht
     2431        }
    24322432        $c create text $x $y \
    24332433            -anchor ne \
  • trunk/gui/scripts/vtkheightmapviewer.tcl

    r4336 r4344  
    77# ======================================================================
    88#  AUTHOR:  Michael McLennan, Purdue University
    9 #  Copyright (c) 2004-2012  HUBzero Foundation, LLC
     9#  Copyright (c) 2004-2014  HUBzero Foundation, LLC
    1010#
    1111#  See the file "license.terms" for information on usage and
     
    13571357        }
    13581358        "axisLabels" {
    1359             set bool $_settings(axisLabels)
     1359            set bool $_settings($what)
    13601360            SendCmd "axis labels all $bool"
    13611361        }
    13621362        "axisMinorTicks" {
    1363             set bool $_settings(axisMinorTicks)
     1363            set bool $_settings($what)
    13641364            foreach axis { x y z } {
    13651365                SendCmd "axis minticks ${axis} $bool"
     
    13671367        }
    13681368        "axisVisible" {
    1369             set bool $_settings(axisVisible)
     1369            set bool $_settings($what)
    13701370            SendCmd "axis visible all $bool"
    13711371        }
     
    13911391        }
    13921392        "colormap" {
    1393             set _changed(colormap) 1
     1393            set _changed($what) 1
    13941394            StartBufferingCommands
    13951395            set color [$itk_component(colormap) value]
    1396             set _settings(colormap) $color
     1396            set _settings($what) $color
    13971397            if { $color == "none" } {
    13981398                if { $_settings(colormapVisible) } {
     
    14351435        }
    14361436        "edges" {
    1437             set bool $_settings(edges)
     1437            set bool $_settings($what)
    14381438            SendCmd "heightmap edges $bool"
    14391439        }
     
    14411441            set label [$itk_component(field) value]
    14421442            set fname [$itk_component(field) translate $label]
    1443             set _settings(field) $fname
     1443            set _settings($what) $fname
    14441444            if { [info exists _fields($fname)] } {
    14451445                foreach { label units components } $_fields($fname) break
     
    14961496        }
    14971497        "isHeightmap" {
    1498             set bool $_settings(isHeightmap)
     1498            set bool $_settings($what)
    14991499            set c $itk_component(view)
    15001500            StartBufferingCommands
     
    16021602        "lighting" {
    16031603            if { $_settings(isHeightmap) } {
    1604                 set _settings(saveLighting) $_settings(lighting)
     1604                set _settings(saveLighting) $_settings($what)
    16051605                set bool $_settings($what)
    16061606                SendCmd "heightmap lighting $bool"
     
    16101610        }
    16111611        "numIsolines" {
    1612             set _settings(numIsolines) [$itk_component(numisolines) value]
    1613             set _currentNumIsolines $_settings(numIsolines)
     1612            set _settings($what) [$itk_component(numisolines) value]
     1613            set _currentNumIsolines $_settings($what)
    16141614            UpdateContourList
    1615             set _changed(numIsolines) 1
     1615            set _changed($what) 1
    16161616            SendCmd "heightmap contourlist [list $_contourList]"
    16171617            if {$_settings(colormapDiscrete)} {
    1618                 set numColors [expr $_settings(numIsolines) + 1]
     1618                set numColors [expr $_settings($what) + 1]
    16191619                SendCmd "colormap res $numColors"
    16201620                EventuallyRequestLegend
     
    16241624        }
    16251625        "opacity" {
    1626             set _changed(opacity) 1
     1626            set _changed($what) 1
    16271627            if { $_settings(isHeightmap) } {
    1628                 set _settings(saveOpacity) $_settings(opacity)
    1629                 set val $_settings(opacity)
     1628                set _settings(saveOpacity) $_settings($what)
     1629                set val $_settings($what)
    16301630                set sval [expr { 0.01 * double($val) }]
    16311631                SendCmd "heightmap opacity $sval"
     
    16381638                SendCmd "outline visible 0"
    16391639            } else {
    1640                 set _settings(saveOutline) $_settings(outline)
    1641                 set bool $_settings(outline)
     1640                set _settings(saveOutline) $_settings($what)
     1641                set bool $_settings($what)
    16421642                SendCmd "outline visible $bool"
    16431643            }
     
    22622262    array set style {
    22632263        -color BCGYR
     2264        -levels 10
    22642265        -opacity 100
    2265         -levels 10
    22662266    }
    22672267    set stylelist [$dataobj style $comp]
     
    23822382        # If there's a legend title, create a text item for the title.
    23832383        $c create text $x $y \
    2384                 -anchor ne \
    2385                 -fill $itk_option(-plotforeground) -tags "title legend" \
    2386                 -font $font
     2384            -anchor ne \
     2385            -fill $itk_option(-plotforeground) -tags "title legend" \
     2386            -font $font
     2387        if { $title != "" } {
     2388            incr y $lineht
     2389        }
    23872390        $c create text $x $y \
    23882391            -anchor ne \
  • trunk/gui/scripts/vtkimageviewer.tcl

    r4336 r4344  
    77# ======================================================================
    88#  AUTHOR:  Michael McLennan, Purdue University
    9 #  Copyright (c) 2004-2012  HUBzero Foundation, LLC
     9#  Copyright (c) 2004-2014  HUBzero Foundation, LLC
    1010#
    1111#  See the file "license.terms" for information on usage and
     
    21452145        # If there's a legend title, create a text item for the title.
    21462146        $c create text $x $y \
    2147                 -anchor ne \
    2148                 -fill $itk_option(-plotforeground) -tags "title legend" \
    2149                 -font $font
     2147            -anchor ne \
     2148            -fill $itk_option(-plotforeground) -tags "title legend" \
     2149            -font $font
     2150        if { $title != "" } {
     2151            incr y $lineht
     2152        }
    21502153        $c create text $x $y \
    21512154            -anchor ne \
  • trunk/gui/scripts/vtkisosurfaceviewer.tcl

    r4342 r4344  
    222222
    223223    array set _settings {
     224        -axesvisible                    1
     225        -axislabelsvisible              1
    224226        -background                     black
    225227        -colormap                       BCGYR
    226228        -colormapvisible                1
    227         -field                          "Default"
    228         -isolinecolor                   white
    229         -axesvisible                    1
    230         -axislabelsvisible              1
    231229        -cutplaneedges                  0
    232230        -cutplanelighting               1
     
    235233        -cutplanesvisible               0
    236234        -cutplanewireframe              0
     235        -field                          "Default"
     236        -isolinecolor                   white
    237237        -isosurfaceedges                0
    238238        -isosurfacelighting             1
  • trunk/gui/scripts/vtkmeshviewer.tcl

    r4250 r4344  
    11# -*- mode: tcl; indent-tabs-mode: nil -*-
    2 
    32# ----------------------------------------------------------------------
    43#  COMPONENT: vtkmeshviewer - Vtk mesh viewer
     
    87# ======================================================================
    98#  AUTHOR:  Michael McLennan, Purdue University
    10 #  Copyright (c) 2004-2012  HUBzero Foundation, LLC
     9#  Copyright (c) 2004-2014  HUBzero Foundation, LLC
    1110#
    1211#  See the file "license.terms" for information on usage and
  • trunk/gui/scripts/vtkstreamlinesviewer.tcl

    r4336 r4344  
    77# ======================================================================
    88#  AUTHOR:  Michael McLennan, Purdue University
    9 #  Copyright (c) 2004-2012  HUBzero Foundation, LLC
     9#  Copyright (c) 2004-2014  HUBzero Foundation, LLC
    1010#
    1111#  See the file "license.terms" for information on usage and
  • trunk/gui/scripts/vtkviewer.tcl

    r4336 r4344  
    11# -*- mode: tcl; indent-tabs-mode: nil -*-
    2 
    32# ----------------------------------------------------------------------
    43#  COMPONENT: vtkviewer - Vtk drawing object viewer
     
    87# ======================================================================
    98#  AUTHOR:  Michael McLennan, Purdue University
    10 #  Copyright (c) 2004-2012  HUBzero Foundation, LLC
     9#  Copyright (c) 2004-2014  HUBzero Foundation, LLC
    1110#
    1211#  See the file "license.terms" for information on usage and
Note: See TracChangeset for help on using the changeset viewer.