Changeset 3768


Ignore:
Timestamp:
Jul 10, 2013 1:19:25 PM (11 years ago)
Author:
ldelgass
Message:

Some minor cleanups

Location:
trunk/gui/scripts
Files:
2 edited

Legend:

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

    r3733 r3768  
    8888    private method BuildDownloadPopup { widget command }
    8989    private method Combo { option }
    90     private method ConvertToVtkData { dataobj comp }
    9190    private method DrawLegend {}
    9291    private method EnterLegend { x y }
     
    389388
    390389    set _image(download) [image create photo]
    391     puts stderr "args=$args"
    392390    eval itk_initialize $args
    393391    Connect
     
    21722170        foreach comp [$dataobj components] {
    21732171            set tag $dataobj-$comp
    2174             #set contents [ConvertToVtkData $dataobj $comp]
    21752172            set contents [$dataobj vtkdata $comp]
    2176             append bytes "$contents\n\n"
     2173            append bytes "$contents\n"
    21772174        }
    21782175    }
  • trunk/gui/scripts/vtkviewer.tcl

    r3709 r3768  
    8888    private method BuildMeshTab {}
    8989    private method BuildMoleculeTab {}
    90     private method ConvertToVtkData { dataobj comp }
    9190    private method DrawLegend {}
    9291    private method EnterLegend { x y }
     
    21842183}
    21852184
    2186 itcl::body Rappture::VtkViewer::ConvertToVtkData { dataobj comp } {
    2187     foreach { x1 x2 xN y1 y2 yN } [$dataobj mesh $comp] break
    2188     set values [$dataobj values $comp]
    2189     append out "# vtk DataFile Version 2.0 \n"
    2190     append out "Test data \n"
    2191     append out "ASCII \n"
    2192     append out "DATASET STRUCTURED_POINTS \n"
    2193     append out "DIMENSIONS $xN $yN 1 \n"
    2194     append out "ORIGIN 0 0 0 \n"
    2195     append out "SPACING 1 1 1 \n"
    2196     append out "POINT_DATA [expr $xN * $yN] \n"
    2197     append out "SCALARS field double 1 \n"
    2198     append out "LOOKUP_TABLE default \n"
    2199     append out [join $values "\n"]
    2200     append out "\n"
    2201     return $out
    2202 }
    2203 
    22042185itcl::body Rappture::VtkViewer::GetVtkData { args } {
    22052186    set bytes ""
     
    22092190            set contents [$dataobj data $comp]
    22102191            append bytes "$contents\n"
    2211             append bytes "\# End of VTK file\n\n"
    2212         }
    2213     }
    2214     return [list .txt $bytes]
     2192        }
     2193    }
     2194    return [list .vtk $bytes]
    22152195}
    22162196
Note: See TracChangeset for help on using the changeset viewer.