Changeset 5364 for branches/1.3


Ignore:
Timestamp:
Apr 29, 2015, 6:32:23 AM (10 years ago)
Author:
ldelgass
Message:

merge r5333:5337 from trunk

Location:
branches/1.3
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • branches/1.3

  • branches/1.3/gui/apps/vtkheightmap-test

    r4413 r5364  
    2626package require Rappture
    2727package require RapptureGUI
    28 package require vtk
    2928
    3029option add *comm.font -*-courier-medium-r-normal-*-*-120-*
  • branches/1.3/gui/apps/vtkisosurface-test

    r4413 r5364  
    2626package require Rappture
    2727package require RapptureGUI
    28 package require vtk
    2928
    3029option add *comm.font -*-courier-medium-r-normal-*-*-120-*
  • branches/1.3/gui/apps/vtkvolume-test

    r4413 r5364  
    2626package require Rappture
    2727package require RapptureGUI
    28 package require vtk
    2928
    3029option add *comm.font -*-courier-medium-r-normal-*-*-120-*
  • branches/1.3/gui/scripts/drawing.tcl

    r4786 r5364  
    4848# ----------------------------------------------------------------------
    4949itcl::body Rappture::Drawing::constructor {xmlobj path} {
    50     package require vtk
    5150    if {![Rappture::library isvalid $xmlobj]} {
    5251        error "bad value \"$xmlobj\": should be Rappture::library"
     
    123122        }
    124123    }
    125     foreach {key} { axisorder } {
    126         set str [$_drawing get $key]
    127         if {"" != $str} {
    128             set _hints($key) $str
    129         }
    130     }
    131124    foreach {key path} {
    132125        toolid          tool.id
  • branches/1.3/gui/scripts/field.tcl

    r5363 r5364  
    895895            #
    896896            # Extract gzipped, base64-encoded OpenDX data
    897             # 
     897            #
    898898            set viewer [$_field get "about.view"]
    899899            if { $viewer != "" } {
  • branches/1.3/gui/scripts/vtkglyphviewer.tcl

    r5348 r5364  
    158158# ----------------------------------------------------------------------
    159159itcl::body Rappture::VtkGlyphViewer::constructor {hostlist args} {
    160     package require vtk
    161160    set _serverType "vtkvis"
    162161
  • branches/1.3/gui/scripts/vtkisosurfaceviewer.tcl

    r5348 r5364  
    182182# ----------------------------------------------------------------------
    183183itcl::body Rappture::VtkIsosurfaceViewer::constructor {hostlist args} {
    184     package require vtk
    185184    set _serverType "vtkvis"
    186185
  • branches/1.3/gui/scripts/vtkmeshviewer.tcl

    r5348 r5364  
    5757    public method get {args}
    5858    public method isconnected {}
    59     public method limits { dataobj }
    6059    public method parameters {title args} {
    6160        # do nothing
     
    135134# ----------------------------------------------------------------------
    136135itcl::body Rappture::VtkMeshViewer::constructor {hostlist args} {
    137     package require vtk
    138136    set _serverType "vtkvis"
    139137
     
    173171    set _arcball [blt::arcball create 100 100]
    174172    $_arcball quaternion [ViewToQuaternion]
    175 
    176     set _limits(zmin) 0.0
    177     set _limits(zmax) 1.0
    178173
    179174    array set _settings {
     
    551546itcl::body Rappture::VtkMeshViewer::scale {args} {
    552547    foreach dataobj $args {
    553         array set bounds [limits $dataobj]
    554         if {![info exists _limits(xmin)] || $_limits(xmin) > $bounds(xmin)} {
    555             set _limits(xmin) $bounds(xmin)
    556         }
    557         if {![info exists _limits(xmax)] || $_limits(xmax) < $bounds(xmax)} {
    558             set _limits(xmax) $bounds(xmax)
    559         }
    560 
    561         if {![info exists _limits(ymin)] || $_limits(ymin) > $bounds(ymin)} {
    562             set _limits(ymin) $bounds(ymin)
    563         }
    564         if {![info exists _limits(ymax)] || $_limits(ymax) < $bounds(ymax)} {
    565             set _limits(ymax) $bounds(ymax)
    566         }
    567 
    568         if {![info exists _limits(zmin)] || $_limits(zmin) > $bounds(zmin)} {
    569             set _limits(zmin) $bounds(zmin)
    570         }
    571         if {![info exists _limits(zmax)] || $_limits(zmax) < $bounds(zmax)} {
    572             set _limits(zmax) $bounds(zmax)
     548        if { ![$dataobj isvalid] } {
     549            continue;                   # Object doesn't contain valid data.
     550        }
     551        foreach axis { x y z } {
     552            set lim [$dataobj limits $axis]
     553            if { ![info exists _limits($axis)] } {
     554                set _limits($axis) $lim
     555                continue
     556            }
     557            foreach {min max} $lim break
     558            foreach {amin amax} $_limits($axis) break
     559            if { $amin > $min } {
     560                set amin $min
     561            }
     562            if { $amax < $max } {
     563                set amax $max
     564            }
     565            set _limits($axis) [list $amin $amax]           
    573566        }
    574567    }
     
    824817    }
    825818
    826     set _limits(zmin) ""
    827     set _limits(zmax) ""
    828819    set _first ""
    829820    SendCmd "dataset visible 0"
     
    12261217        SendCmd "outline color $rgb"
    12271218    }
    1228 }
    1229 
    1230 itcl::body Rappture::VtkMeshViewer::limits { dataobj } {
    1231     set tag $dataobj
    1232     if { ![info exists _limits($tag)] } {
    1233         set data [$dataobj vtkdata -full]
    1234         if { $data == "" } {
    1235             continue
    1236         }
    1237         set tmpfile file[pid].vtk
    1238         set f [open "$tmpfile" "w"]
    1239         fconfigure $f -translation binary -encoding binary
    1240         puts $f $data
    1241         close $f
    1242         set reader [vtkDataSetReader $tag-xvtkDataSetReader]
    1243         $reader SetFileName $tmpfile
    1244         $reader Update
    1245         file delete $tmpfile
    1246         set output [$reader GetOutput]
    1247         set _limits($tag) [$output GetBounds]
    1248         rename $output ""
    1249         rename $reader ""
    1250     }
    1251     foreach { xMin xMax yMin yMax zMin zMax} $_limits($tag) break
    1252     if {![info exists limits(xmin)] || $limits(xmin) > $xMin} {
    1253         set limits(xmin) $xMin
    1254     }
    1255     if {![info exists limits(xmax)] || $limits(xmax) < $xMax} {
    1256         set limits(xmax) $xMax
    1257     }
    1258     if {![info exists limits(ymin)] || $limits(ymin) > $yMin} {
    1259         set limits(ymin) $xMin
    1260     }
    1261     if {![info exists limits(ymax)] || $limits(ymax) < $yMax} {
    1262         set limits(ymax) $yMax
    1263     }
    1264     if {![info exists limits(zmin)] || $limits(zmin) > $zMin} {
    1265         set limits(zmin) $zMin
    1266     }
    1267     if {![info exists limits(zmax)] || $limits(zmax) < $zMax} {
    1268         set limits(zmax) $zMax
    1269     }
    1270 
    1271     return [array get limits]
    12721219}
    12731220
  • branches/1.3/gui/scripts/vtkstreamlinesviewer.tcl

    r5348 r5364  
    164164# ----------------------------------------------------------------------
    165165itcl::body Rappture::VtkStreamlinesViewer::constructor {hostlist args} {
    166     package require vtk
    167166    set _serverType "vtkvis"
    168167
  • branches/1.3/gui/scripts/vtksurfaceviewer.tcl

    r5348 r5364  
    159159# ----------------------------------------------------------------------
    160160itcl::body Rappture::VtkSurfaceViewer::constructor {hostlist args} {
    161     package require vtk
    162161    set _serverType "vtkvis"
    163162
  • branches/1.3/gui/scripts/vtkvolumeviewer.tcl

    r5348 r5364  
    157157# ----------------------------------------------------------------------
    158158itcl::body Rappture::VtkVolumeViewer::constructor {hostlist args} {
    159     package require vtk
    160159    set _serverType "vtkvis"
    161160
Note: See TracChangeset for help on using the changeset viewer.