Changeset 4412 for branches/1.3/gui/scripts
- Timestamp:
- Jun 21, 2014, 5:58:05 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3/gui/scripts/drawing.tcl
r3879 r4412 12 12 package require Itcl 13 13 package require BLT 14 15 set count 016 14 17 15 namespace eval Rappture { … … 47 45 public method hints {{keyword ""}} 48 46 public method components { args } 49 private method PdbToVtk { cname contents }50 47 } 51 48 … … 109 106 set pdbdata [$_xmlobj get $path.$elem.pdb] 110 107 if { $pdbdata != "" } { 111 if 0 {112 global count113 set f [open /tmp/file$count.pdb "w"]114 incr count115 puts $f $pdbdata116 close $f117 }118 108 set contents [Rappture::PdbToVtk $pdbdata] 119 if 0 {120 set f [open /tmp/convertedpdb.vtk "w"]121 puts $f $contents122 close $f123 }124 109 } else { 125 110 set contents [$_xmlobj get $path.$elem.vtk] … … 356 341 } 357 342 358 itcl::body Rappture::Drawing::PdbToVtk { cname contents } {359 package require vtk360 361 set reader $this-datasetreader362 vtkPDBReader $reader363 364 # Write the contents to a file just in case it's binary.365 set tmpfile $cname[pid].pdb366 set f [open "$tmpfile" "w"]367 fconfigure $f -translation binary -encoding binary368 puts $f $contents369 close $f370 $reader SetFileName $tmpfile371 $reader Update372 file delete $tmpfile373 374 set tmpfile $cname[pid].vtk375 set writer $this-datasetwriter376 vtkDataSetWriter $writer377 $writer SetInputConnection [$reader GetOutputPort]378 $writer SetFileName $tmpfile379 $writer Write380 rename $reader ""381 rename $writer ""382 383 set f [open "$tmpfile" "r"]384 fconfigure $f -translation binary -encoding binary385 set vtkdata [read $f]386 close $f387 file delete $tmpfile388 return $vtkdata389 }
Note: See TracChangeset
for help on using the changeset viewer.