Changeset 5215 for branches


Ignore:
Timestamp:
Apr 14, 2015 1:44:58 PM (9 years ago)
Author:
ldelgass
Message:

merge r4997:5000 from trunk

Location:
branches/1.3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/1.3

  • branches/1.3/gui/scripts/field.tcl

    r5180 r5215  
    7777    private variable _hints
    7878    private variable _viewer "";        # Hints which viewer to use
    79     private variable _xv "";            # For 1D meshes only.  Holds the points
    8079    private variable _isValid 0;        # Indicates if the field contains
    8180                                        # valid data.
     
    148147    private variable _type ""
    149148    private variable _comp2flowhints
    150     private variable _comp2mesh
     149    private variable _comp2mesh  ;# list of: mesh object, BLT vector of values
     150    private variable _values ""  ;# Only used for unirect2d - list of values
    151151    private common _counter 0    ;# counter for unique vector names
    152152
     
    161161    private method VerifyVtkDataSet { contents }
    162162    private method VectorLimits { vector vectorsize {comp -1} }
    163     private variable _values ""
    164163}
    165164
     
    302301# USAGE: mesh ?<name>?
    303302#
    304 # Returns a list {xvec yvec} for the specified field component <name>.
    305 # If the name is not specified, then it returns the vectors for the
    306 # overall field (sum of all components).
     303# For 1D data (curve), returns a BLT vector of x values for the field
     304# component <name>.  Otherwise, this method is unused
    307305# ----------------------------------------------------------------------
    308306itcl::body Rappture::Field::mesh {{cname -overall}} {
     
    313311        return [lindex $_comp2xy($cname) 0]  ;# return xv
    314312    }
    315     if { [info exists _comp2vtk($cname)] } {
     313    if {[info exists _comp2vtk($cname)]} {
    316314        # FIXME: extract mesh from VTK file data.
    317         if { $_comp2dims($cname) == "1D" } {
    318             return $_xv
    319         }
    320315        error "method \"mesh\" is not implemented for VTK file data"
    321316    }
    322317    if {[info exists _comp2dx($cname)]} {
    323         return ""  ;# no mesh -- it's embedded in the blob data
     318        error "method \"mesh\" is not implemented for DX file data"
    324319    }
    325320    if {[info exists _comp2mesh($cname)]} {
    326         return ""  ;# no mesh -- it's embedded in the value data
     321        # FIXME: This only works for cloud
     322        set mesh [lindex $_comp2mesh($cname) 0]
     323        return [$mesh points]
    327324    }
    328325    if {[info exists _comp2unirect2d($cname)]} {
    329         set mobj [lindex $_comp2unirect2d($cname) 0]
    330         return [$mobj mesh]
     326        # FIXME: unirect2d mesh is a list: xMin xMax xNum yMin yMax yNum
     327        return [$_comp2unirect2d($cname) mesh]
    331328    }
    332329    if {[info exists _comp2unirect3d($cname)]} {
    333         set mobj [lindex $_comp2unirect3d($cname) 0]
    334         return [$mobj mesh]
     330        # This returns a list of x,y,z points
     331        return [$_comp2unirect3d($cname) mesh]
    335332    }
    336333    error "can't get field mesh: Unknown component \"$cname\": should be one of [join [lsort [array names _comp2dims]] {, }]"
     
    340337# USAGE: values ?<name>?
    341338#
    342 # Returns a list {xvec yvec} for the specified field component <name>.
    343 # If the name is not specified, then it returns the vectors for the
    344 # overall field (sum of all components).
     339# For 1D data (curve), returns a BLT vector of field values (y coords)
     340# for the field component <name>.  Otherwise, this method is unused
    345341# ----------------------------------------------------------------------
    346342itcl::body Rappture::Field::values {cname} {
     
    351347        return [lindex $_comp2xy($cname) 1]  ;# return yv
    352348    }
    353     # VTK file data
    354349    if { [info exists _comp2vtk($cname)] } {
    355350        # FIXME: extract the values from the VTK file data
    356         if { $_comp2dims($cname) == "1D" } {
    357             return $_values
    358         }
    359         error "method \"values\" is not implemented for vtk file data"
    360     }
    361     # Points-on-mesh
     351        error "method \"values\" is not implemented for VTK file data"
     352    }
     353    if {[info exists _comp2dx($cname)]} {
     354        error "method \"values\" is not implemented for DX file data"
     355    }
    362356    if { [info exists _comp2mesh($cname)] } {
    363357        set vector [lindex $_comp2mesh($cname) 1]
    364358        return [$vector range 0 end]
    365359    }
    366     if {[info exists _comp2dx($cname)]} {
    367         error "method \"values\" is not implemented for dx file data"
    368     }
    369360    if {[info exists _comp2unirect2d($cname)]} {
    370361        return $_values
    371362    }
    372363    if {[info exists _comp2unirect3d($cname)]} {
    373         return [$_comp2unirect3d($cname) blob]
    374     }
    375     error "can't get field values. Unknown component \"$cname\": should be [join [lsort [array names _comp2dims]] {, }]"
     364        return [$_comp2unirect3d($cname) values]
     365    }
     366    error "can't get field values. Unknown component \"$cname\": should be one of [join [lsort [array names _comp2dims]] {, }]"
    376367}
    377368
     
    13231314        return [Rappture::DxToVtk $data]
    13241315    }
    1325     # Unirect3d: isosurface
    1326     if {[info exists _comp2unirect3d($cname)]} {
    1327         return [$_comp2unirect3d($cname) vtkdata]
    1328     }
    13291316    # VTK file data:
    13301317    if { [info exists _comp2vtk($cname)] } {
     
    14471434        }
    14481435        # Get the data limits
    1449         set vector [$_comp2unirect3d($cname) valuesObj]
     1436        set vector [$_comp2unirect3d($cname) values]
    14501437        set minmax [VectorLimits $vector $vectorsize]
    14511438        lappend limits $cname $minmax
  • branches/1.3/gui/scripts/unirect3d.tcl

    r4790 r5215  
    2727    public method mesh {}
    2828    public method values {}
    29     public method valuesObj {}
    3029    public method units { axis }
    3130    public method label { axis }
     
    141140# ----------------------------------------------------------------------
    142141# method mesh
    143 #       Returns a Tcl list that represents the points  of the uniform
    144 #       grid.
     142#       Returns a Tcl list that represents the points of the uniform
     143#       grid.  Each point has x,y and z values in the list.
    145144# ----------------------------------------------------------------------
    146145itcl::body Rappture::Unirect3d::mesh {} {
     
    163162
    164163# ----------------------------------------------------------------------
    165 # method values 
    166 #       Returns a Tcl list that represents the field values
     164# method values
     165#       Returns a BLT vector that represents the field values
    167166# ----------------------------------------------------------------------
    168167itcl::body Rappture::Unirect3d::values {} {
    169     if { [$_values length] > 0 } {
    170         return [$_values range 0 end]
    171     }
    172     return ""
    173 }
    174 
    175 # ----------------------------------------------------------------------
    176 # method valuesObj
    177 #       Returns a BLT vector that represents the field values
    178 # ----------------------------------------------------------------------
    179 itcl::body Rappture::Unirect3d::valuesObj {} {
    180168    return $_values
    181169}
Note: See TracChangeset for help on using the changeset viewer.