Changeset 5594 for branches/1.4
- Timestamp:
- May 21, 2015, 4:59:20 AM (9 years ago)
- Location:
- branches/1.4
- Files:
-
- 1 deleted
- 8 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/1.4
- Property svn:mergeinfo changed
/trunk merged: 5581-5583,5591
- Property svn:mergeinfo changed
-
branches/1.4/examples/flow/demo1/Makefile.in
r1944 r5594 17 17 FILES = \ 18 18 $(srcdir)/demo1.tcl \ 19 $(srcdir)/data- unirect3d.tcl \19 $(srcdir)/data-demo1.tcl \ 20 20 $(srcdir)/tool.xml 21 21 -
branches/1.4/examples/flow/demo1/demo1.tcl
r1480 r5594 1 1 2 2 # Example of using a unirect3d mesh in a vector field 3 source data-unirect3d.tcl 3 # This is inlucded for testing purposes, since unirect3d outputs are deprecated 4 source data-demo1.tcl 4 5 5 6 package require Rappture -
branches/1.4/examples/flow/demo2/Makefile.in
r1944 r5594 17 17 FILES = \ 18 18 $(srcdir)/demo2.tcl \ 19 $(srcdir)/data-2dflow.tcl \ 19 20 $(srcdir)/data-unirect2d.tcl \ 20 21 $(srcdir)/tool.xml -
branches/1.4/examples/flow/demo2/demo2.tcl
r3484 r5594 1 1 2 # Example of using unirect2d mesh in a vector field. 3 source data-unirect2d.tcl 2 # Example of using unirect2d mesh with a vector field. 3 # This is included only for testing purposes, since unirect2d meshes are 4 # deprecated. 5 if 0 { 6 # extents=2 is deprecated, since VTK needs 3D vectors, even for 2D meshes 7 # Enabling this block should cause an error 8 source data-unirect2d.tcl 9 set extents 2 10 } else { 11 source data-2dflow.tcl 12 set extents 3 13 } 4 14 5 15 package require Rappture … … 7 17 set driver [Rappture::library [lindex $argv 0]] 8 18 9 set elements {19 set elements [subst { 10 20 output.field.about.label "Flow 2d half" 11 21 output.field.component.flow.axis z … … 27 37 output.field.component.style "-nonuniformcolors {0.0 steelblue4 0.000001 blue 0.01 green 0.1 grey 1.0 white} -markers {1% 2% 3% 5% 8% 10% 20% 50% 80%} -opacity 1" 28 38 output.field.camera.position { 29 qw 1 qx 0 qy 0 qz 0 pan-x 0 pan-y 0zoom 1.039 -qw 1 -qx 0 -qy 0 -qz 0 -xpan 0 -ypan 0 -zoom 1.0 30 40 } 31 output.field.component.extents 241 output.field.component.extents $extents 32 42 output.field.component.mesh unirect2d 33 43 unirect2d.xaxis.min -0.5 … … 38 48 unirect2d.yaxis.numpoints 109 39 49 unirect2d.components 2 40 } 50 }] 41 51 42 52 puts stdout "Setting attributes for demo1" -
branches/1.4/examples/flow/demo3/demo3.tcl
r1464 r5594 1 1 2 2 # Example of using dx file in a vector field. 3 # This is included for testing purposes, since DX file data is deprecated 3 4 source data-dx.tcl 4 5 -
branches/1.4/examples/flow/flowtest.tcl
r4727 r5594 1 1 2 # Example of using unirect2d meshes in a fieldobject in Rappture.2 # Example of using the flow object in Rappture. 3 3 4 4 package require Rappture 5 6 5 7 6 # Open an XML run file to write into 8 7 set driver [Rappture::library [lindex $argv 0]] 9 8 10 # Create 3 "field"objects to display the different flows.9 # Create 3 <mesh> and <field> objects to display the different flows. 11 10 11 set m1 output.mesh(jwire) 12 12 set f1 output.field(jwire) 13 14 set m2 output.mesh(half) 13 15 set f2 output.field(half) 14 set f3 output.field(si02) 16 17 set m3 output.mesh(sio2) 18 set f3 output.field(sio2) 15 19 16 20 set elements [subst { … … 52 56 $f1.component.flow.box(three).corner(1) "1000 -150 -100" 53 57 $f1.component.flow.box(three).corner(2) "2000 450 450" 54 $f1.component.extents 3 55 $f1.component.mesh unirect3d(jwire) 56 unirect3d(jwire).xaxis.min 0 57 unirect3d(jwire).xaxis.max 6300 58 unirect3d(jwire).xaxis.numpoints 126 59 unirect3d(jwire).yaxis.min 0 60 unirect3d(jwire).yaxis.max 1500 61 unirect3d(jwire).yaxis.numpoints 30 62 unirect3d(jwire).zaxis.min 0 63 unirect3d(jwire).zaxis.max 1519.05 64 unirect3d(jwire).zaxis.numpoints 22 58 $f1.component.elemtype vectors 59 $f1.component.elemsize 3 60 $f1.component.mesh $m1 61 $m1.about.label "JWire mesh" 62 $m1.dim 3 63 $m1.units "um" 64 $m1.hide yes 65 $m1.grid.xaxis.min 0 66 $m1.grid.xaxis.max 6300 67 $m1.grid.xaxis.numpoints 126 68 $m1.grid.yaxis.min 0 69 $m1.grid.yaxis.max 1500 70 $m1.grid.yaxis.numpoints 30 71 $m1.grid.zaxis.min 0 72 $m1.grid.zaxis.max 1519.05 73 $m1.grid.zaxis.numpoints 22 65 74 $f2.about.label "Flow 2d half" 66 75 $f2.component.flow.axis z … … 77 86 $f2.component.style "-color rainbow -levels 6" 78 87 $f2.camera.position { 79 qw 1 qx 0 qy 0 qz 0 pan-x 0 pan-y 0zoom 1.088 -qw 1 -qx 0 -qy 0 -qz 0 -xpan 0 -ypan 0 -zoom 1.0 80 89 } 81 $f2.component.extents 2 82 $f2.component.mesh unirect2d(half) 83 unirect2d(half).xaxis.min -0.5 84 unirect2d(half).xaxis.max 152 85 unirect2d(half).xaxis.numpoints 305 86 unirect2d(half).yaxis.min -22 87 unirect2d(half).yaxis.max 21.6 88 unirect2d(half).yaxis.numpoints 109 90 $f2.component.elemtype vectors 91 $f2.component.elemsize 3 92 $f2.component.mesh $m2 93 $m2.about.label "2D mesh" 94 $m2.dim 2 95 $m2.units "um" 96 $m2.hide yes 97 $m2.grid.xaxis.min -0.5 98 $m2.grid.xaxis.max 152 99 $m2.grid.xaxis.numpoints 305 100 $m2.grid.yaxis.min -22 101 $m2.grid.yaxis.max 21.6 102 $m2.grid.yaxis.numpoints 109 89 103 $f3.about.label "SiO2" 90 104 $f3.about.view "flowvis" … … 100 114 $f3.component.flow.particles(right).color khaki 101 115 $f3.component.flow.particles(right).position 90% 102 $f3.component.style 116 $f3.component.style "-color blue:red -levels 6" 103 117 $f3.component.elemtype vectors 104 118 $f3.component.elemsize 3 105 $f3.component.mesh output.mesh(sio2)106 output.mesh(sio2).about.label "SiO2"107 output.mesh(sio2).dim 3108 output.mesh(sio2).units "um"109 output.mesh(sio2).hide yes110 output.mesh(sio2).grid.xaxis.min 0111 output.mesh(sio2).grid.xaxis.max 29.75206608112 output.mesh(sio2).grid.xaxis.numpoints 121113 output.mesh(sio2).grid.yaxis.min -1.5114 output.mesh(sio2).grid.yaxis.max 2.82115 output.mesh(sio2).grid.yaxis.numpoints 25116 output.mesh(sio2).grid.zaxis.min -1117 output.mesh(sio2).grid.zaxis.max 4.304347828118 output.mesh(sio2).grid.zaxis.numpoints 23119 $f3.component.mesh $m3 120 $m3.about.label "SiO2 Mesh" 121 $m3.dim 3 122 $m3.units "um" 123 $m3.hide yes 124 $m3.grid.xaxis.min 0 125 $m3.grid.xaxis.max 29.75206608 126 $m3.grid.xaxis.numpoints 121 127 $m3.grid.yaxis.min -1.5 128 $m3.grid.yaxis.max 2.82 129 $m3.grid.yaxis.numpoints 25 130 $m3.grid.zaxis.min -1 131 $m3.grid.zaxis.max 4.304347828 132 $m3.grid.zaxis.numpoints 23 119 133 }] 120 134 … … 125 139 } 126 140 127 source demo1/data- unirect3d.tcl141 source demo1/data-demo1.tcl 128 142 $driver put $f1.component.values $values 129 143 130 source demo2/data- unirect2d.tcl144 source demo2/data-2dflow.tcl 131 145 $driver put $f2.component.values $values 132 133 #source demo3/data-dx.tcl134 #set data [Rappture::encoding::encode -as zb64 "<DX>$dx"]135 #$driver put $f3.component.dx $data136 146 137 147 source demo3/data-values.tcl … … 143 153 flush stdout 144 154 exit 0 145 -
branches/1.4/gui/scripts/field.tcl
r5580 r5594 158 158 private variable _comp2style; # cname => style settings 159 159 private variable _comp2cntls; # cname => x,y control points (1D only) 160 private variable _comp2limits; # Array of limits per component161 private variable _comp2flowhints 160 private variable _comp2limits; # cname => List of axis, min/max list 161 private variable _comp2flowhints; # cname => Rappture::FlowHints obj 162 162 private variable _comp2mesh; # list: mesh obj, BLT vector of values 163 163 # valid for cloud,mesh,unirect2d 164 164 private variable _values ""; # Only for unirect2d - list of values 165 165 … … 802 802 GetAssociation $cname 803 803 804 if { $_comp2size($cname) < 1 || 805 $_comp2size($cname) > 9 } { 806 puts stderr "ERROR: Invalid <elemsize>: $_comp2size($cname)" 807 continue 808 } 809 # Some types have restrictions on number of components 810 if { $_comp2type($cname) == "vectors" && 811 $_comp2size($cname) != 3 } { 812 puts stderr "ERROR: vectors <elemtype> must have <elemsize> of 3" 813 continue 814 } 815 if { $_comp2type($cname) == "normals" && 816 $_comp2size($cname) != 3 } { 817 puts stderr "ERROR: normals <elemtype> must have <elemsize> of 3" 818 continue 819 } 820 if { $_comp2type($cname) == "tcoords" && 821 $_comp2size($cname) > 3 } { 822 puts stderr "ERROR: tcoords <elemtype> must have <elemsize> <= 3" 823 continue 824 } 825 if { $_comp2type($cname) == "scalars" && 826 $_comp2size($cname) > 4 } { 827 puts stderr "ERROR: scalars <elemtype> must have <elemsize> <= 4" 828 continue 829 } 830 if { $_comp2type($cname) == "colorscalars" && 831 $_comp2size($cname) > 4 } { 832 puts stderr "ERROR: colorscalars <elemtype> must have <elemsize> <= 4" 833 continue 834 } 835 if { $_comp2type($cname) == "tensors" && 836 $_comp2size($cname) != 9 } { 837 puts stderr "ERROR: tensors <elemtype> must have <elemsize> of 9" 838 continue 839 } 840 804 841 if { [$_field element $cname.flow] != "" } { 805 842 set haveFlow 1 … … 1305 1342 set data [Rappture::encoding::decode -as zb64 $data] 1306 1343 return [Rappture::DxToVtk $data] 1344 } 1345 # unirect2d (deprecated) 1346 # This can be removed when the nanovis server with support for loading VTK 1347 # vector data is released 1348 if {[info exists _comp2unirect2d($cname)]} { 1349 set label $cname 1350 regsub -all { } $label {_} label 1351 set elemSize [numComponents $cname] 1352 set numValues [$_comp2unirect2d($cname) numpoints] 1353 append out "# vtk DataFile Version 3.0\n" 1354 append out "[hints label]\n" 1355 append out "ASCII\n" 1356 append out [$_comp2unirect2d($cname) vtkdata] 1357 append out "POINT_DATA $numValues\n" 1358 if {$elemSize == 3} { 1359 append out "VECTORS $label double\n" 1360 } else { 1361 append out "SCALARS $label double $elemSize\n" 1362 append out "LOOKUP_TABLE default\n" 1363 } 1364 # values for VTK are x-fastest 1365 append out $_values 1366 append out "\n" 1367 return $out 1307 1368 } 1308 1369 # unirect3d (deprecated)
Note: See TracChangeset
for help on using the changeset viewer.