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 edited

Legend:

Unmodified
Added
Removed
  • branches/1.3

  • 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.