Changeset 3768
- Timestamp:
- Jul 10, 2013 1:19:25 PM (11 years ago)
- Location:
- trunk/gui/scripts
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/vtkheightmapviewer.tcl
r3733 r3768 88 88 private method BuildDownloadPopup { widget command } 89 89 private method Combo { option } 90 private method ConvertToVtkData { dataobj comp }91 90 private method DrawLegend {} 92 91 private method EnterLegend { x y } … … 389 388 390 389 set _image(download) [image create photo] 391 puts stderr "args=$args"392 390 eval itk_initialize $args 393 391 Connect … … 2172 2170 foreach comp [$dataobj components] { 2173 2171 set tag $dataobj-$comp 2174 #set contents [ConvertToVtkData $dataobj $comp]2175 2172 set contents [$dataobj vtkdata $comp] 2176 append bytes "$contents\n \n"2173 append bytes "$contents\n" 2177 2174 } 2178 2175 } -
trunk/gui/scripts/vtkviewer.tcl
r3709 r3768 88 88 private method BuildMeshTab {} 89 89 private method BuildMoleculeTab {} 90 private method ConvertToVtkData { dataobj comp }91 90 private method DrawLegend {} 92 91 private method EnterLegend { x y } … … 2184 2183 } 2185 2184 2186 itcl::body Rappture::VtkViewer::ConvertToVtkData { dataobj comp } {2187 foreach { x1 x2 xN y1 y2 yN } [$dataobj mesh $comp] break2188 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 $out2202 }2203 2204 2185 itcl::body Rappture::VtkViewer::GetVtkData { args } { 2205 2186 set bytes "" … … 2209 2190 set contents [$dataobj data $comp] 2210 2191 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] 2215 2195 } 2216 2196
Note: See TracChangeset
for help on using the changeset viewer.