Changeset 4506


Ignore:
Timestamp:
Jul 16, 2014 1:01:57 PM (7 years ago)
Author:
ldelgass
Message:

Skip invalid VTK files when computing bounds/limits

File:
1 edited

Legend:

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

    r4465 r4506  
    743743        }
    744744        array set bounds [limits $dataobj]
    745         if {![info exists _limits(xmin)] || $_limits(xmin) > $bounds(xmin)} {
     745        if {[info exists bounds(xmin)] && (![info exists _limits(xmin)] || $_limits(xmin) > $bounds(xmin))} {
    746746            set _limits(xmin) $bounds(xmin)
    747747        }
    748         if {![info exists _limits(xmax)] || $_limits(xmax) < $bounds(xmax)} {
     748        if {[info exists bounds(xmax)] && (![info exists _limits(xmax)] || $_limits(xmax) < $bounds(xmax))} {
    749749            set _limits(xmax) $bounds(xmax)
    750750        }
    751751
    752         if {![info exists _limits(ymin)] || $_limits(ymin) > $bounds(ymin)} {
     752        if {[info exists bounds(ymin)] && (![info exists _limits(ymin)] || $_limits(ymin) > $bounds(ymin))} {
    753753            set _limits(ymin) $bounds(ymin)
    754754        }
    755         if {![info exists _limits(ymax)] || $_limits(ymax) < $bounds(ymax)} {
     755        if {[info exists bounds(ymax)] && (![info exists _limits(ymax)] || $_limits(ymax) < $bounds(ymax))} {
    756756            set _limits(ymax) $bounds(ymax)
    757757        }
    758758
    759         if {![info exists _limits(zmin)] || $_limits(zmin) > $bounds(zmin)} {
     759        if {[info exists bounds(zmin)] && (![info exists _limits(zmin)] || $_limits(zmin) > $bounds(zmin))} {
    760760            set _limits(zmin) $bounds(zmin)
    761761        }
    762         if {![info exists _limits(zmax)] || $_limits(zmax) < $bounds(zmax)} {
     762        if {[info exists bounds(zmax)] && (![info exists _limits(zmax)] || $_limits(zmax) < $bounds(zmax))} {
    763763            set _limits(zmax) $bounds(zmax)
    764764        }
     
    19091909            file delete $tmpfile
    19101910            set output [$reader GetOutput]
     1911            if { $output == "" } {
     1912                # Invalid VTK file -- loader failed to parse
     1913                continue
     1914            }
    19111915            set _limits($tag) [$output GetBounds]
    19121916            if {$debug} {
Note: See TracChangeset for help on using the changeset viewer.