Changeset 5594 for branches/1.4


Ignore:
Timestamp:
May 21, 2015, 4:59:20 AM (9 years ago)
Author:
ldelgass
Message:

Merge r5581:5591 from trunk

Location:
branches/1.4
Files:
1 deleted
8 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/1.4

  • branches/1.4/examples/flow/demo1/Makefile.in

    r1944 r5594  
    1717FILES           = \
    1818                $(srcdir)/demo1.tcl \
    19                 $(srcdir)/data-unirect3d.tcl \
     19                $(srcdir)/data-demo1.tcl \
    2020                $(srcdir)/tool.xml
    2121
  • branches/1.4/examples/flow/demo1/demo1.tcl

    r1480 r5594  
    11
    22# 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
     4source data-demo1.tcl
    45
    56package require Rappture
  • branches/1.4/examples/flow/demo2/Makefile.in

    r1944 r5594  
    1717FILES           = \
    1818                $(srcdir)/demo2.tcl \
     19                $(srcdir)/data-2dflow.tcl \
    1920                $(srcdir)/data-unirect2d.tcl \
    2021                $(srcdir)/tool.xml
  • branches/1.4/examples/flow/demo2/demo2.tcl

    r3484 r5594  
    11
    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.
     5if 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}
    414
    515package require Rappture
     
    717set driver [Rappture::library [lindex $argv 0]]
    818
    9 set elements {
     19set elements [subst {
    1020    output.field.about.label "Flow 2d half"
    1121    output.field.component.flow.axis z
     
    2737    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"
    2838    output.field.camera.position {
    29         qw 1 qx 0 qy 0 qz 0 pan-x 0 pan-y 0 zoom 1.0
     39        -qw 1 -qx 0 -qy 0 -qz 0 -xpan 0 -ypan 0 -zoom 1.0
    3040    }
    31     output.field.component.extents 2
     41    output.field.component.extents $extents
    3242    output.field.component.mesh unirect2d
    3343    unirect2d.xaxis.min -0.5
     
    3848    unirect2d.yaxis.numpoints  109
    3949    unirect2d.components 2
    40 }
     50}]
    4151
    4252puts stdout "Setting attributes for demo1"
  • branches/1.4/examples/flow/demo3/demo3.tcl

    r1464 r5594  
    11
    22# Example of using dx file in a vector field.
     3# This is included for testing purposes, since DX file data is deprecated
    34source data-dx.tcl
    45
  • branches/1.4/examples/flow/flowtest.tcl

    r4727 r5594  
    11
    2 # Example of using unirect2d meshes in a field object in Rappture.
     2# Example of using the flow object in Rappture.
    33
    44package require Rappture
    5 
    65
    76# Open an XML run file to write into
    87set driver [Rappture::library [lindex $argv 0]]
    98
    10 # Create 3 "field" objects to display the different flows.
     9# Create 3 <mesh> and <field> objects to display the different flows.
    1110
     11set m1 output.mesh(jwire)
    1212set f1 output.field(jwire)
     13
     14set m2 output.mesh(half)
    1315set f2 output.field(half)
    14 set f3 output.field(si02)
     16
     17set m3 output.mesh(sio2)
     18set f3 output.field(sio2)
    1519
    1620set elements [subst {
     
    5256    $f1.component.flow.box(three).corner(1) "1000 -150 -100"
    5357    $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
    6574    $f2.about.label "Flow 2d half"
    6675    $f2.component.flow.axis z
     
    7786    $f2.component.style  "-color rainbow -levels 6"
    7887    $f2.camera.position {
    79         qw 1 qx 0 qy 0 qz 0 pan-x 0 pan-y 0 zoom 1.0
     88        -qw 1 -qx 0 -qy 0 -qz 0 -xpan 0 -ypan 0 -zoom 1.0
    8089    }
    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
    89103    $f3.about.label "SiO2"
    90104    $f3.about.view "flowvis"
     
    100114    $f3.component.flow.particles(right).color khaki
    101115    $f3.component.flow.particles(right).position 90%
    102     $f3.component.style  "-color blue:red -levels 6"
     116    $f3.component.style "-color blue:red -levels 6"
    103117    $f3.component.elemtype vectors
    104118    $f3.component.elemsize 3
    105     $f3.component.mesh output.mesh(sio2)
    106     output.mesh(sio2).about.label "SiO2"
    107     output.mesh(sio2).dim 3
    108     output.mesh(sio2).units "um"
    109     output.mesh(sio2).hide yes
    110     output.mesh(sio2).grid.xaxis.min 0
    111     output.mesh(sio2).grid.xaxis.max 29.75206608
    112     output.mesh(sio2).grid.xaxis.numpoints 121
    113     output.mesh(sio2).grid.yaxis.min -1.5
    114     output.mesh(sio2).grid.yaxis.max 2.82
    115     output.mesh(sio2).grid.yaxis.numpoints 25
    116     output.mesh(sio2).grid.zaxis.min -1
    117     output.mesh(sio2).grid.zaxis.max 4.304347828
    118     output.mesh(sio2).grid.zaxis.numpoints 23
     119    $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
    119133}]
    120134
     
    125139}
    126140
    127 source demo1/data-unirect3d.tcl
     141source demo1/data-demo1.tcl
    128142$driver put $f1.component.values $values
    129143
    130 source demo2/data-unirect2d.tcl
     144source demo2/data-2dflow.tcl
    131145$driver put $f2.component.values $values
    132 
    133 #source demo3/data-dx.tcl
    134 #set data [Rappture::encoding::encode -as zb64 "<DX>$dx"]
    135 #$driver put $f3.component.dx $data
    136146
    137147source demo3/data-values.tcl
     
    143153flush stdout
    144154exit 0
    145 
  • branches/1.4/gui/scripts/field.tcl

    r5580 r5594  
    158158    private variable _comp2style;       # cname => style settings
    159159    private variable _comp2cntls;       # cname => x,y control points (1D only)
    160     private variable _comp2limits;      # Array of limits per component
    161     private variable _comp2flowhints
     160    private variable _comp2limits;      # cname => List of axis, min/max list
     161    private variable _comp2flowhints;   # cname => Rappture::FlowHints obj
    162162    private variable _comp2mesh;        # list: mesh obj, BLT vector of values
    163 
     163                                        # valid for cloud,mesh,unirect2d
    164164    private variable _values "";        # Only for unirect2d - list of values
    165165
     
    802802        GetAssociation $cname
    803803
     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
    804841        if { [$_field element $cname.flow] != "" } {
    805842            set haveFlow 1
     
    13051342        set data [Rappture::encoding::decode -as zb64 $data]
    13061343        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
    13071368    }
    13081369    # unirect3d (deprecated)
Note: See TracChangeset for help on using the changeset viewer.