Changeset 5850


Ignore:
Timestamp:
Aug 28, 2015 10:12:22 AM (9 years ago)
Author:
gah
Message:

merge accumulative changes from 1.3 branch into uq branch

Location:
branches/uq
Files:
37 edited

Legend:

Unmodified
Added
Removed
  • branches/uq

  • branches/uq/examples/zoo/field/field.py

    r5534 r5850  
    141141    """
    142142
    143 if vizmethod == "dx":
    144     #
    145     # Generate a uniform 3D mesh in OpenDX format...
    146     #
    147     f3d = rx['output.field(f3d)']
    148     f3d['about.label'] = "3D Field"
    149     f3d['component.style'] = "-color blue:yellow:red -levels 6"
    150 
    151     dx = """object 1 class gridpositions counts 5 5 2
    152         origin 0 0 0
    153         delta 1 0 0
    154         delta 0 1 0
    155         delta 0 0 1
    156         object 2 class gridconnections counts 5 5 2
    157         object 3 class array type double rank 0 items 50 data follows
    158     """
    159 
    160     xx, yy, zz = np.mgrid[xmin:xmax:5j, ymin:ymax:5j, 0:1:2j]
    161     pts = formula(xx, yy, zz)
    162     # Axis ordering for OpenDX is reversed (z fastest)
    163     dx += '\n'.join(map(str, (pts.ravel())))
    164 
    165     dx += """attribute "dep" string "positions"
    166     object "regular positions regular connections" class field
    167     component "positions" value 1
    168     component "connections" value 2
    169     component "data" value 3"""
    170 
    171     data = Rappture.encoding.encode(dx, Rappture.RPENC_ZB64)
    172     f3d['component.dx'] = data
    173 
    174 
    175143rx.close()
  • branches/uq/examples/zoo/field/field.tcl

    r3692 r5850  
    115115}
    116116
    117 if {$vizmethod == "dx"} {
    118     #
    119     # Generate a uniform 3D mesh in OpenDX format...
    120     #
    121     $driver put output.field(f3d).about.label "3D Field"
    122     $driver put output.field(f3d).component.style "-color blue:yellow:red -levels 6"
    123 
    124     set dx "object 1 class gridpositions counts 5 5 2
    125 origin 0 0 0
    126 delta 1 0 0
    127 delta 0 1 0
    128 delta 0 0 1
    129 object 2 class gridconnections counts 5 5 2
    130 object 3 class array type double rank 0 items 50 data follows
    131 "
    132     # Axis ordering for OpenDX is reversed (z fastest)
    133     for {set x 0} {$x < 5} {incr x} {
    134         for {set y 0} {$y < 5} {incr y} {
    135             for {set z 0} {$z < 2} {incr z} {
    136                 set fval [expr $formula]
    137                 append dx "$fval\n"
    138             }
    139         }
    140     }
    141     append dx {attribute "dep" string "positions"
    142     object "regular positions regular connections" class field
    143     component "positions" value 1
    144     component "connections" value 2
    145     component "data" value 3}
    146 
    147     set data [Rappture::encoding::encode -as zb64 $dx]
    148     $driver put output.field(f3d).component.dx $data
    149 }
    150 
    151117#
    152118# Save the updated XML describing the run...
  • branches/uq/examples/zoo/field/tool.xml

    r5534 r5850  
    4646      <value>unstructured</value>
    4747    </option>
    48     <option>
    49       <about>
    50         <label>Volume (OpenDX)</label>
    51         <description>Renders a 3D volume using the deprecated OpenDX mesh/field format.</description>
    52       </about>
    53       <value>dx</value>
    54     </option>
    5548    <default>grid</default>
    5649  </choice>
  • branches/uq/examples/zoo/mesh/mesh.m

    r3752 r5850  
    9393                 0, 0);
    9494
    95   case 'generic'
    96     mesh = 'output.mesh';
    97     rpLibPutString(lib, 'output.mesh.about.label', \
    98                    'nodes and elements mesh', 0);
    99     rpLibPutString(lib, 'output.mesh.dim', '2', 0);
    100     rpLibPutString(lib, 'output.mesh.units', 'm', 0);
    101     rpLibPutString(lib, 'output.mesh.hide', 'yes', 0);
    102 
    103     f = fopen('triangles.txt');
    104     triangles = fscanf(f, '%d');
    105     fclose(f);
    106 
    107     % TO BE COMPLETED
    108 
    10995  case 'unstructured'
    11096    mesh = 'output.mesh';
  • branches/uq/examples/zoo/mesh/mesh.py

    r5627 r5850  
    8484    mesh.put('unstructured.triangles', 'triangles.txt', type='file')
    8585
    86 if meshtype == 'generic':
    87     mesh['about.label'] = "nodes and elements mesh"
    88     with open('points.txt') as f:
    89         data = f.read()
    90     for i, line in enumerate(data.split('\n')):
    91         if line == '':
    92             break
    93         x, y = line.split()
    94         mesh['node(%s)' % i] = "%s %s" % (x, y)
    95     with open('triangles.txt') as f:
    96         data = f.read()
    97     for i, line in enumerate(data.split('\n')):
    98         if line == '':
    99             break
    100         x, y, z = line.split()
    101         mesh['element(%s).nodes' % i] = "%s %s %s" % (x, y, z)
    102 
    10386if meshtype == 'unstructured':
    10487    mesh['about.label'] = "Unstructured Grid"
  • branches/uq/examples/zoo/mesh/mesh.tcl

    r5679 r5850  
    117117            triangles.txt
    118118    }
    119     "generic" {
    120         set mesh output.mesh
    121 
    122         $driver put $mesh.about.label "Mesh"
    123         $driver put $mesh.about.description "nodes and elements mesh"
    124         $driver put $mesh.dim  2
    125         $driver put $mesh.units "m"
    126         $driver put $mesh.hide $hide
    127 
    128         set count 0
    129         set f [open "points.txt" "r"]
    130         set points [read $f]
    131         close $f
    132         foreach { x y } $points {
    133             $driver put $mesh.node($count) "$x $y"
    134             incr count
    135         }
    136         set count 0
    137         set f [open "triangles.txt" "r"]
    138         set triangles [read $f]
    139         close $f
    140         foreach { a b c } $triangles {
    141             $driver put $mesh.element($count).nodes "$a $b $c"
    142             incr count
    143         }
    144     }
    145119    "unstructured" {
    146120        set mesh output.mesh
  • branches/uq/examples/zoo/mesh/tool.xml

    r5679 r5850  
    6565    <option>
    6666     <about>
    67       <label>general nodes and elements description</label>
    68       <description>Unstructured 2 dimensional grid of cells using nodes and elements.</description>
    69      </about>
    70      <value>generic</value>
    71     </option>
    72     <option>
    73      <about>
    7467      <label>VTK mesh</label>
    7568      <description>Partial VTK file representing the mesh.</description>
  • branches/uq/examples/zoo/mesh/tool_octave.xml

    • Property svn:mime-type changed from application/xml to text/xml
    r3752 r5850  
    5858    <option>
    5959     <about>
    60       <label>general nodes and elements description</label>
    61       <description>Unstructured 2 dimensional grid of cells using nodes and elements.</description>
    62      </about>
    63      <value>generic</value>
    64     </option>
    65     <option>
    66      <about>
    6760      <label>VTK mesh</label>
    6861      <description>Partial VTK file representing the mesh.</description>
  • branches/uq/gui/apps/execute.tcl

    r5679 r5850  
    3232Rappture::resources::load
    3333
     34# Parse command line options
     35# ----------------------------------------------------------------------
     36Rappture::getopts argv params {
     37    value -tool ""
     38    value -status ""
     39    value -output ""
     40    value -cleanup no
     41}
     42
    3443# load the XML info in the driver file
    3544if {[catch {Rappture::library $driverxml} result]} {
     
    4150
    4251# If tool.xml is not specified, try to find it the way Rappture would.
     52if {$params(-tool) ne ""} {
     53    set toolxml $params(-tool)
     54}
    4355if {$toolxml eq ""} {
    4456    if {[file isfile tool.xml]} {
     
    120132}
    121133
    122 # Parse command line options to see
     134# Apply effects of all other command line options
    123135# ----------------------------------------------------------------------
    124 Rappture::getopts argv params {
    125     value -status ""
    126     value -output ""
    127     value -cleanup no
    128 }
    129 
    130136if {$params(-status) ne ""} {
    131137    set LogFid [open $params(-status) w]
  • branches/uq/gui/scripts/drawing.tcl

    r5679 r5850  
    9393    }
    9494    foreach {key path} {
     95        camera  about.camera
     96        color   about.color
    9597        group   about.group
    9698        label   about.label
    97         color   about.color
    98         camera  about.camera
    9999        type    about.type
     100        xdesc   xaxis.description
     101        ydesc   yaxis.description
     102        zdesc   zaxis.description
    100103        xlabel  xaxis.label
    101         xdesc   xaxis.description
     104        ylabel  yaxis.label
     105        zlabel  zaxis.label
     106        xscale  xaxis.scale
     107        yscale  yaxis.scale
     108        zscale  zaxis.scale
    102109        xunits  xaxis.units
    103         xscale  xaxis.scale
     110        yunits  yaxis.units
     111        zunits  zaxis.units
    104112        xmin    xaxis.min
    105113        xmax    xaxis.max
    106         ylabel  yaxis.label
    107         ydesc   yaxis.description
    108         yunits  yaxis.units
    109         yscale  yaxis.scale
    110114        ymin    yaxis.min
    111115        ymax    yaxis.max
    112         zlabel  zaxis.label
    113         zdesc   zaxis.description
    114         zunits  zaxis.units
    115         zscale  zaxis.scale
    116116        zmin    zaxis.min
    117117        zmax    zaxis.max
  • branches/uq/gui/scripts/field.tcl

    r5679 r5850  
    651651# ----------------------------------------------------------------------
    652652itcl::body Rappture::Field::InitHints {} {
     653    # Order of duplicate keys matters here: later entries override
     654    # earlier ones.  For example: camera.position is deprecated in
     655    # favor of about.camera, so about.camera is listed after
     656    # camera.position
    653657    foreach {key path} {
    654658        camera          camera.position
     659        camera          about.camera
    655660        color           about.color
    656         default         about.default
    657661        group           about.group
    658662        label           about.label
     
    11421146}
    11431147
     1148#
     1149# FIXME: Allowing a VTK file to be used as a Field <component> means
     1150# there can be multiple VTK fields with different association, type, and
     1151# number of components (array elements) within a single Rappture::Field.
     1152# This breaks the concept of the Field object since the <component>'s
     1153# <association>, <elemtype> and <elemsize> can't be set to a single
     1154# value in this case.
     1155#
     1156# Rappture needs a Dataset object with a single Mesh and multiple Fields.
     1157#
    11441158itcl::body Rappture::Field::ReadVtkDataSet { cname contents } {
    11451159    package require vtk
     
    11911205    lappend limits y [list $ymin $ymax]
    11921206    lappend limits z [list $zmin $zmax]
     1207    set vmin 0
     1208    set vmax 1
     1209    set foundDefaultArray 0
    11931210    set dataAttrs [$dataset GetPointData]
    11941211    if { $dataAttrs == ""} {
    1195         puts stderr "WARNING: No point data found in \"$_path\""
     1212        puts stderr "ERROR: Can't get point data attributes in \"$_path\""
    11961213        rename $reader ""
    11971214        return 0
    11981215    }
    1199     set vmin 0
    1200     set vmax 1
    12011216    set numArrays [$dataAttrs GetNumberOfArrays]
    1202     if { $numArrays > 0 } {
    1203         for {set i 0} {$i < [$dataAttrs GetNumberOfArrays] } {incr i} {
    1204             set array [$dataAttrs GetArray $i]
    1205             set fname  [$dataAttrs GetArrayName $i]
    1206             foreach {min max} [$array GetRange -1] break
    1207             if {$i == 0} {
    1208                 set vmin $min
    1209                 set vmax $max
    1210             }
     1217    for {set i 0} {$i < $numArrays} {incr i} {
     1218        set array [$dataAttrs GetArray $i]
     1219        set fname [$dataAttrs GetArrayName $i]
     1220        foreach {min max} [$array GetRange -1] break
     1221        if {!$foundDefaultArray} {
     1222            set vmin $min
     1223            set vmax $max
     1224            set foundDefaultArray 1
     1225        }
     1226        lappend limits $fname [list $min $max]
     1227        set _fld2Units($fname) ""
     1228        set _fld2Label($fname) $fname
     1229        # Let the VTK file override the <elemsize>
     1230        set _fld2Components($fname) [$array GetNumberOfComponents]
     1231        lappend _comp2fldName($cname) $fname
     1232    }
     1233    # FIXME: Can't properly handle field names that are re-used in point data
     1234    # cell data and/or field data even though this is permitted in VTK.
     1235    # For now, we'll use the first field found of point, cell, then field data
     1236    set dataAttrs [$dataset GetCellData]
     1237    if { $dataAttrs == ""} {
     1238        puts stderr "ERROR: Can't get cell data attributes found in \"$_path\""
     1239        rename $reader ""
     1240        return 0
     1241    }
     1242    set numArrays [$dataAttrs GetNumberOfArrays]
     1243    for {set i 0} {$i < $numArrays} {incr i} {
     1244        set array [$dataAttrs GetArray $i]
     1245        set fname [$dataAttrs GetArrayName $i]
     1246        foreach {min max} [$array GetRange -1] break
     1247        if {!$foundDefaultArray} {
     1248            set vmin $min
     1249            set vmax $max
     1250            set foundDefaultArray 1
     1251        }
     1252        if {[info exists _fld2Components($fname)]} {
     1253            puts stderr "WARNING: Re-use of field name within cell data attributes"
     1254        } else {
    12111255            lappend limits $fname [list $min $max]
    12121256            set _fld2Units($fname) ""
    12131257            set _fld2Label($fname) $fname
    1214             # Let the VTK file override the <type> designated.
     1258            # Let the VTK file override the <elemsize>
    12151259            set _fld2Components($fname) [$array GetNumberOfComponents]
    12161260            lappend _comp2fldName($cname) $fname
    12171261        }
    12181262    }
    1219 
     1263    set dataAttrs [$dataset GetFieldData]
     1264    if { $dataAttrs == ""} {
     1265        puts stderr "ERROR: Can't get field data attributes found in \"$_path\""
     1266        rename $reader ""
     1267        return 0
     1268    }
     1269    set numArrays [$dataAttrs GetNumberOfArrays]
     1270    for {set i 0} {$i < $numArrays} {incr i} {
     1271        set array [$dataAttrs GetArray $i]
     1272        set fname [$dataAttrs GetArrayName $i]
     1273        foreach {min max} [$array GetRange -1] break
     1274        if {!$foundDefaultArray} {
     1275            set vmin $min
     1276            set vmax $max
     1277            set foundDefaultArray 1
     1278        }
     1279        if {[info exists _fld2Components($fname)]} {
     1280            puts stderr "WARNING: Re-use of field name within field data attributes"
     1281        } else {
     1282            lappend limits $fname [list $min $max]
     1283            set _fld2Units($fname) ""
     1284            set _fld2Label($fname) $fname
     1285            # Let the VTK file override the <elemsize>
     1286            set _fld2Components($fname) [$array GetNumberOfComponents]
     1287            lappend _comp2fldName($cname) $fname
     1288        }
     1289    }
     1290    # This is set to the range of the first array found
    12201291    lappend limits v [list $vmin $vmax]
    12211292    set _comp2limits($cname) $limits
  • branches/uq/gui/scripts/flowvisviewer.tcl

    r5679 r5850  
    33#  COMPONENT: flowvisviewer - 3D flow rendering
    44#
    5 #  This widget performs volume and flow rendering on 3D scalar/vector datasets.
     5#  This widget performs volume and flow rendering on 3D vector datasets.
    66#  It connects to the Nanovis server running on a rendering farm,
    77#  transmits data, and displays the results.
    88# ======================================================================
    99#  AUTHOR:  Michael McLennan, Purdue University
    10 #  Copyright (c) 2004-2012  HUBzero Foundation, LLC
     10#  Copyright (c) 2004-2015  HUBzero Foundation, LLC
    1111#
    1212#  See the file "license.terms" for information on usage and
     
    172172    set _serverType "nanovis"
    173173
    174     # Draw legend event
     174    #DebugOn
     175    EnableWaitDialog 900
     176
     177    # Rebuild event
     178    $_dispatcher register !rebuild
     179    $_dispatcher dispatch $this !rebuild "[itcl::code $this Rebuild]; list"
     180
     181    # Resize event
     182    $_dispatcher register !resize
     183    $_dispatcher dispatch $this !resize "[itcl::code $this DoResize]; list"
     184
     185    # Legend event
    175186    $_dispatcher register !legend
    176187    $_dispatcher dispatch $this !legend "[itcl::code $this FixLegend]; list"
     
    180191    $_dispatcher dispatch $this !send_transfunc \
    181192        "[itcl::code $this SendTransferFunctions]; list"
    182 
    183     # Rebuild event
    184     $_dispatcher register !rebuild
    185     $_dispatcher dispatch $this !rebuild "[itcl::code $this Rebuild]; list"
    186 
    187     # Resize event
    188     $_dispatcher register !resize
    189     $_dispatcher dispatch $this !resize "[itcl::code $this DoResize]; list"
    190193
    191194    $_dispatcher register !play
     
    212215    # Initialize the view to some default parameters.
    213216    array set _view {
    214         -qw      0.853553
    215         -qx      -0.353553
    216         -qy      0.353553
    217         -qz      0.146447
    218         -xpan    0
    219         -ypan    0
    220         -zoom    1.0
     217        -qw       0.853553
     218        -qx       -0.353553
     219        -qy       0.353553
     220        -qz       0.146447
     221        -xpan     0
     222        -ypan     0
     223        -zoom     1.0
    221224    }
    222225    set _arcball [blt::arcball create 100 100]
     
    266269    }]
    267270
    268     itk_component add 3dview {
     271    itk_component add view {
    269272        label $itk_component(plotarea).view -image $_image(plot) \
    270273            -highlightthickness 0 -borderwidth 0
     
    273276        ignore -highlightthickness -borderwidth  -background
    274277    }
    275     bind $itk_component(3dview) <Control-F1> [itcl::code $this ToggleConsole]
     278    bind $itk_component(view) <Control-F1> [itcl::code $this ToggleConsole]
    276279
    277280    set f [$itk_component(main) component controls]
     
    317320            -onimage [Rappture::icon volume-on] \
    318321            -offimage [Rappture::icon volume-off] \
    319             -command [itcl::code $this AdjustSetting -volume] \
    320             -variable [itcl::scope _settings(-volume)]
     322            -variable [itcl::scope _settings(-volume)] \
     323            -command [itcl::code $this AdjustSetting -volume]
    321324    }
    322325    $itk_component(volume) select
     
    362365    # the server.  So the panewindow uses the tiny size.
    363366    set w 10000
    364     pack forget $itk_component(3dview)
     367    pack forget $itk_component(view)
    365368    blt::table $itk_component(plotarea) \
    366         0,0 $itk_component(3dview) -fill both -reqwidth $w \
     369        0,0 $itk_component(view) -fill both -reqwidth $w \
    367370        1,0 $itk_component(legend) -fill x
    368371    blt::table configure $itk_component(plotarea) r1 -resize none
     
    511514    blt::table configure $itk_component(flowcontrols) r0 -pady 1
    512515    # Bindings for rotation via mouse
    513     bind $itk_component(3dview) <ButtonPress-1> \
     516    bind $itk_component(view) <ButtonPress-1> \
    514517        [itcl::code $this Rotate click %x %y]
    515     bind $itk_component(3dview) <B1-Motion> \
     518    bind $itk_component(view) <B1-Motion> \
    516519        [itcl::code $this Rotate drag %x %y]
    517     bind $itk_component(3dview) <ButtonRelease-1> \
     520    bind $itk_component(view) <ButtonRelease-1> \
    518521        [itcl::code $this Rotate release %x %y]
    519522
    520     bind $itk_component(3dview) <Configure> \
     523    bind $itk_component(view) <Configure> \
    521524        [itcl::code $this EventuallyResize %w %h]
    522525
    523526    # Bindings for panning via mouse
    524     bind $itk_component(3dview) <ButtonPress-2> \
     527    bind $itk_component(view) <ButtonPress-2> \
    525528        [itcl::code $this Pan click %x %y]
    526     bind $itk_component(3dview) <B2-Motion> \
     529    bind $itk_component(view) <B2-Motion> \
    527530        [itcl::code $this Pan drag %x %y]
    528     bind $itk_component(3dview) <ButtonRelease-2> \
     531    bind $itk_component(view) <ButtonRelease-2> \
    529532        [itcl::code $this Pan release %x %y]
    530533
    531534    # Bindings for panning via keyboard
    532     bind $itk_component(3dview) <KeyPress-Left> \
     535    bind $itk_component(view) <KeyPress-Left> \
    533536        [itcl::code $this Pan set -10 0]
    534     bind $itk_component(3dview) <KeyPress-Right> \
     537    bind $itk_component(view) <KeyPress-Right> \
    535538        [itcl::code $this Pan set 10 0]
    536     bind $itk_component(3dview) <KeyPress-Up> \
     539    bind $itk_component(view) <KeyPress-Up> \
    537540        [itcl::code $this Pan set 0 -10]
    538     bind $itk_component(3dview) <KeyPress-Down> \
     541    bind $itk_component(view) <KeyPress-Down> \
    539542        [itcl::code $this Pan set 0 10]
    540     bind $itk_component(3dview) <Shift-KeyPress-Left> \
     543    bind $itk_component(view) <Shift-KeyPress-Left> \
    541544        [itcl::code $this Pan set -2 0]
    542     bind $itk_component(3dview) <Shift-KeyPress-Right> \
     545    bind $itk_component(view) <Shift-KeyPress-Right> \
    543546        [itcl::code $this Pan set 2 0]
    544     bind $itk_component(3dview) <Shift-KeyPress-Up> \
     547    bind $itk_component(view) <Shift-KeyPress-Up> \
    545548        [itcl::code $this Pan set 0 -2]
    546     bind $itk_component(3dview) <Shift-KeyPress-Down> \
     549    bind $itk_component(view) <Shift-KeyPress-Down> \
    547550        [itcl::code $this Pan set 0 2]
    548551
    549552    # Bindings for zoom via keyboard
    550     bind $itk_component(3dview) <KeyPress-Prior> \
     553    bind $itk_component(view) <KeyPress-Prior> \
    551554        [itcl::code $this Zoom out]
    552     bind $itk_component(3dview) <KeyPress-Next> \
     555    bind $itk_component(view) <KeyPress-Next> \
    553556        [itcl::code $this Zoom in]
    554557
    555     bind $itk_component(3dview) <Enter> "focus $itk_component(3dview)"
     558    bind $itk_component(view) <Enter> "focus $itk_component(view)"
    556559
    557560    if {[string equal "x11" [tk windowingsystem]]} {
    558561        # Bindings for zoom via mouse
    559         bind $itk_component(3dview) <4> [itcl::code $this Zoom out]
    560         bind $itk_component(3dview) <5> [itcl::code $this Zoom in]
     562        bind $itk_component(view) <4> [itcl::code $this Zoom out]
     563        bind $itk_component(view) <5> [itcl::code $this Zoom in]
    561564    }
    562565
     
    565568    eval itk_initialize $args
    566569
    567     EnableWaitDialog 900
    568570    Connect
    569571}
     
    626628# ----------------------------------------------------------------------
    627629# USAGE: get ?-objects?
    628 # USAGE: get ?-image 3dview|legend?
     630# USAGE: get ?-image view|legend?
    629631#
    630632# Clients use this to query the list of objects being plotted, in
     
    656658        -image {
    657659            if {[llength $args] != 2} {
    658                 error "wrong # args: should be \"get -image 3dview|legend\""
     660                error "wrong # args: should be \"get -image view|legend\""
    659661            }
    660662            switch -- [lindex $args end] {
    661                 3dview {
     663                view {
    662664                    return $_image(plot)
    663665                }
     
    666668                }
    667669                default {
    668                     error "bad image name \"[lindex $args end]\": should be 3dview or legend"
     670                    error "bad image name \"[lindex $args end]\": should be view or legend"
    669671                }
    670672            }
     
    679681# USAGE: delete ?<dataobj1> <dataobj2> ...?
    680682#
    681 #       Clients use this to delete a dataobj from the plot.  If no dataobjs
    682 #       are specified, then all dataobjs are deleted.  No data objects are
    683 #       deleted.  They are only removed from the display list.
    684 #
     683# Clients use this to delete a dataobj from the plot.  If no dataobjs
     684# are specified, then all dataobjs are deleted.  No data objects are
     685# deleted.  They are only removed from the display list.
    685686# ----------------------------------------------------------------------
    686687itcl::body Rappture::FlowvisViewer::delete {args} {
     
    881882        }
    882883
    883         set w [winfo width $itk_component(3dview)]
    884         set h [winfo height $itk_component(3dview)]
     884        set w [winfo width $itk_component(view)]
     885        set h [winfo height $itk_component(view)]
    885886        EventuallyResize $w $h
    886887    }
     
    891892# isconnected --
    892893#
    893 #       Indicates if we are currently connected to the visualization server.
     894# Indicates if we are currently connected to the visualization server.
    894895#
    895896itcl::body Rappture::FlowvisViewer::isconnected {} {
     
    907908# Disconnect --
    908909#
    909 #       Clients use this method to disconnect from the current rendering
    910 #       server.
     910# Clients use this method to disconnect from the current rendering server.
    911911#
    912912itcl::body Rappture::FlowvisViewer::Disconnect {} {
     
    10331033# ReceiveLegend --
    10341034#
    1035 #       The procedure is the response from the render server to each "legend"
    1036 #       command.  The server sends back a "legend" command invoked our
    1037 #       the slave interpreter.  The purpose is to collect data of the image
    1038 #       representing the legend in the canvas.  In addition, the
    1039 #       active transfer function is displayed.
     1035# The procedure is the response from the render server to each "legend"
     1036# command.  The server sends back a "legend" command invoked our
     1037# the slave interpreter.  The purpose is to collect data of the image
     1038# representing the legend in the canvas.  In addition, the
     1039# active transfer function is displayed.
    10401040#
    10411041itcl::body Rappture::FlowvisViewer::ReceiveLegend { tag vmin vmax size } {
     
    10531053# ReceiveData --
    10541054#
    1055 #       The procedure is the response from the render server to each "data
    1056 #       follows" command.  The server sends back a "data" command invoked our
    1057 #       the slave interpreter.  The purpose is to collect the min/max of the
    1058 #       volume sent to the render server.  Since the client (flowvisviewer)
    1059 #       doesn't parse 3D data formats, we rely on the server (nanovis) to
    1060 #       tell us what the limits are.  Once we've received the limits to all
    1061 #       the data we've sent (tracked by _recvdDatasets) we can then determine
    1062 #       what the transfer functions are for these volumes.
     1055# The procedure is the response from the render server to each "data
     1056# follows" command.  The server sends back a "data" command invoked our
     1057# the slave interpreter.  The purpose is to collect the min/max of the
     1058# volume sent to the render server.  Since the client (flowvisviewer)
     1059# doesn't parse 3D data formats, we rely on the server (nanovis) to
     1060# tell us what the limits are.  Once we've received the limits to all
     1061# the data we've sent (tracked by _recvdDatasets) we can then determine
     1062# what the transfer functions are for these volumes.
    10631063#
    10641064#
     
    11041104# ----------------------------------------------------------------------
    11051105itcl::body Rappture::FlowvisViewer::Rebuild {} {
    1106     set w [winfo width $itk_component(3dview)]
    1107     set h [winfo height $itk_component(3dview)]
     1106    set w [winfo width $itk_component(view)]
     1107    set h [winfo height $itk_component(view)]
    11081108    if { $w < 2 || $h < 2 } {
    11091109        update
     
    12151215            NameTransferFunction $dataobj $cname
    12161216        }
     1217        set _reset 0
    12171218    }
    12181219
     
    12461247    StopBufferingCommands
    12471248    blt::busy release $itk_component(hull)
    1248     set _reset 0
    12491249}
    12501250
     
    13441344    switch -- $option {
    13451345        click {
    1346             $itk_component(3dview) configure -cursor fleur
     1346            $itk_component(view) configure -cursor fleur
    13471347            set _click(x) $x
    13481348            set _click(y) $y
     
    13521352                Rotate click $x $y
    13531353            } else {
    1354                 set w [winfo width $itk_component(3dview)]
    1355                 set h [winfo height $itk_component(3dview)]
     1354                set w [winfo width $itk_component(view)]
     1355                set h [winfo height $itk_component(view)]
    13561356                if {$w <= 0 || $h <= 0} {
    13571357                    return
     
    13801380        release {
    13811381            Rotate drag $x $y
    1382             $itk_component(3dview) configure -cursor ""
     1382            $itk_component(view) configure -cursor ""
    13831383            catch {unset _click}
    13841384        }
     
    13991399itcl::body Rappture::FlowvisViewer::Pan {option x y} {
    14001400    # Experimental stuff
    1401     set w [winfo width $itk_component(3dview)]
    1402     set h [winfo height $itk_component(3dview)]
     1401    set w [winfo width $itk_component(view)]
     1402    set h [winfo height $itk_component(view)]
    14031403    if { $option == "set" } {
    14041404        set x [expr $x / double($w)]
     
    14141414        set _click(x) $x
    14151415        set _click(y) $y
    1416         $itk_component(3dview) configure -cursor hand1
     1416        $itk_component(view) configure -cursor hand1
    14171417    }
    14181418    if { $option == "drag" || $option == "release" } {
     
    14281428    }
    14291429    if { $option == "release" } {
    1430         $itk_component(3dview) configure -cursor ""
     1430        $itk_component(view) configure -cursor ""
    14311431    }
    14321432}
     
    15011501            if { $_settings($what) } {
    15021502                blt::table $itk_component(plotarea) \
    1503                     0,0 $itk_component(3dview) -fill both \
     1503                    0,0 $itk_component(view) -fill both \
    15041504                    1,0 $itk_component(legend) -fill x
    15051505                blt::table configure $itk_component(plotarea) r1 -resize none
     
    16161616# NameTransferFunction --
    16171617#
    1618 #       Creates a transfer function name based on the <style> settings in the
    1619 #       library run.xml file. This placeholder will be used later to create
    1620 #       and send the actual transfer function once the data info has been sent
    1621 #       to us by the render server. [We won't know the volume limits until the
    1622 #       server parses the 3D data and sends back the limits via ReceiveData.]
     1618# Creates a transfer function name based on the <style> settings in the
     1619# library run.xml file. This placeholder will be used later to create
     1620# and send the actual transfer function once the data info has been sent
     1621# to us by the render server. [We won't know the volume limits until the
     1622# server parses the 3D data and sends back the limits via ReceiveData.]
    16231623#
    16241624itcl::body Rappture::FlowvisViewer::NameTransferFunction { dataobj cname } {
     
    16421642# ComputeTransferFunction --
    16431643#
    1644 #       Computes and sends the transfer function to the render server.  It's
    1645 #       assumed that the volume data limits are known and that the global
    1646 #       transfer-functions slider values have been set up.  Both parts are
    1647 #       needed to compute the relative value (location) of the marker, and
    1648 #       the alpha map of the transfer function.
     1644# Computes and sends the transfer function to the render server.  It's
     1645# assumed that the volume data limits are known and that the global
     1646# transfer-functions slider values have been set up.  Both parts are
     1647# needed to compute the relative value (location) of the marker, and
     1648# the alpha map of the transfer function.
    16491649#
    16501650itcl::body Rappture::FlowvisViewer::ComputeTransferFunction { tf } {
     
    26342634        }
    26352635        "next" {
    2636             if { ![winfo viewable $itk_component(3dview)] } {
     2636            if { ![winfo viewable $itk_component(view)] } {
    26372637                flow stop
    26382638                return
     
    29492949# BuildVolumeComponents --
    29502950#
    2951 #    This is called from the "scale" method which is called when a new
    2952 #    dataset is added or deleted.  It repopulates the dropdown menu of
    2953 #    volume component names.  It sets the current component to the first
    2954 #    component in the list (of components found).  Finally, if there is
    2955 #    only one component, don't display the label or the combobox in the
    2956 #    volume settings tab.
     2951# This is called from the "scale" method which is called when a new
     2952# dataset is added or deleted.  It repopulates the dropdown menu of
     2953# volume component names.  It sets the current component to the first
     2954# component in the list (of components found).  Finally, if there is
     2955# only one component, don't display the label or the combobox in the
     2956# volume settings tab.
    29572957#
    29582958itcl::body Rappture::FlowvisViewer::BuildVolumeComponents {} {
     
    29682968# GetDatasetsWithComponents --
    29692969#
    2970 #    Returns a list of all the datasets (known by the combination of their
    2971 #    data object and component name) that match the given component name.
    2972 #    For example, this is used where we want to change the settings of
    2973 #    volumes that have the current component.
     2970# Returns a list of all the datasets (known by the combination of their
     2971# data object and component name) that match the given component name.
     2972# For example, this is used where we want to change the settings of
     2973# volumes that have the current component.
    29742974#
    29752975itcl::body Rappture::FlowvisViewer::GetDatasetsWithComponent { cname } {
  • branches/uq/gui/scripts/molvisviewer.tcl

    r5679 r5850  
    88# ======================================================================
    99#  AUTHOR:  Michael McLennan, Purdue University
    10 #  Copyright (c) 2004-2012  HUBzero Foundation, LLC
     10#  Copyright (c) 2004-2015  HUBzero Foundation, LLC
    1111#
    1212#  See the file "license.terms" for information on usage and
     
    2626    Rappture::resources::register \
    2727        molvis_server Rappture::MolvisViewer::SetServerList
    28 }
    29 
    30 set debug 0
    31 proc debug { args } {
    32     global debug
    33     if { $debug } {
    34         puts stderr "[info level -1]: $args"
    35     }
    3628}
    3729
     
    160152    set _serverType "pymol"
    161153
     154    #DebugOn
     155
    162156    # Register events to the dispatcher.  Base class expects !rebuild
    163157    # event to be registered.
     
    236230    }]
    237231
    238     itk_component add 3dview {
     232    itk_component add view {
    239233        label $itk_component(plotarea).view -image $_image(plot) \
    240234            -highlightthickness 0 -borderwidth 0
     
    243237        ignore -highlightthickness -borderwidth  -background
    244238    }
    245     bind $itk_component(3dview) <Control-F1> [itcl::code $this ToggleConsole]
     239    bind $itk_component(view) <Control-F1> [itcl::code $this ToggleConsole]
    246240
    247241    set f [$itk_component(main) component controls]
     
    318312    BuildSettingsTab
    319313
    320     # HACK ALERT. Initially force a requested width of the 3dview label.
    321 
    322     # It's a chicken-and-the-egg problem.  The size of the 3dview label is set
     314    # HACK ALERT. Initially force a requested width of the view label.
     315
     316    # It's a chicken-and-the-egg problem.  The size of the view label is set
    323317    # from the size of the image retrieved from the server.  But the size of
    324318    # the image is specified by the viewport which is the size of the label.
     
    330324    # (that's why we're using the blt::table to manage the geometry).  It has
    331325    # to be big, because we don't know how big the user may want to stretch
    332     # the window.  This at least forces the sidebarframe to give the 3dview
     326    # the window.  This at least forces the sidebarframe to give the view
    333327    # the maximum size available, which is perfect for an initially closed
    334328    # sidebar.
    335329
    336330    blt::table $itk_component(plotarea) \
    337         0,0 $itk_component(3dview) -fill both -reqwidth 10000
     331        0,0 $itk_component(view) -fill both -reqwidth 10000
    338332    #
    339333    # RENDERING AREA
     
    344338    if { $_useVmouseEvents } {
    345339        # set up bindings to bridge mouse events to server
    346         bind $itk_component(3dview) <ButtonPress> \
     340        bind $itk_component(view) <ButtonPress> \
    347341            [itcl::code $this Vmouse click %b %s %x %y]
    348         bind $itk_component(3dview) <ButtonRelease> \
     342        bind $itk_component(view) <ButtonRelease> \
    349343            [itcl::code $this Vmouse release %b %s %x %y]
    350         bind $itk_component(3dview) <B1-Motion> \
     344        bind $itk_component(view) <B1-Motion> \
    351345            [itcl::code $this Vmouse drag 1 %s %x %y]
    352         bind $itk_component(3dview) <B2-Motion> \
     346        bind $itk_component(view) <B2-Motion> \
    353347            [itcl::code $this Vmouse drag 2 %s %x %y]
    354         bind $itk_component(3dview) <B3-Motion> \
     348        bind $itk_component(view) <B3-Motion> \
    355349            [itcl::code $this Vmouse drag 3 %s %x %y]
    356         bind $itk_component(3dview) <Motion> \
     350        bind $itk_component(view) <Motion> \
    357351            [itcl::code $this Vmouse move 0 %s %x %y]
    358352    } else {
    359353        # set up bindings for rotation with mouse
    360         bind $itk_component(3dview) <ButtonPress-1> \
     354        bind $itk_component(view) <ButtonPress-1> \
    361355            [itcl::code $this Rotate click %x %y]
    362         bind $itk_component(3dview) <B1-Motion> \
     356        bind $itk_component(view) <B1-Motion> \
    363357            [itcl::code $this Rotate drag %x %y]
    364         bind $itk_component(3dview) <ButtonRelease-1> \
     358        bind $itk_component(view) <ButtonRelease-1> \
    365359            [itcl::code $this Rotate release %x %y]
    366360
    367361        # set up bindings for panning with mouse
    368         bind $itk_component(3dview) <ButtonPress-2> \
     362        bind $itk_component(view) <ButtonPress-2> \
    369363            [itcl::code $this Pan click %x %y]
    370         bind $itk_component(3dview) <B2-Motion> \
     364        bind $itk_component(view) <B2-Motion> \
    371365            [itcl::code $this Pan drag %x %y]
    372         bind $itk_component(3dview) <ButtonRelease-2> \
     366        bind $itk_component(view) <ButtonRelease-2> \
    373367            [itcl::code $this Pan release %x %y]
    374368
    375369        # scroll wheel zoom
    376370        if {[string equal "x11" [tk windowingsystem]]} {
    377             bind $itk_component(3dview) <4> [itcl::code $this Zoom out 2]
    378             bind $itk_component(3dview) <5> [itcl::code $this Zoom in 2]
     371            bind $itk_component(view) <4> [itcl::code $this Zoom out 2]
     372            bind $itk_component(view) <5> [itcl::code $this Zoom in 2]
    379373        }
    380374    }
    381375
    382376    # Set up bindings for panning with keyboard
    383     bind $itk_component(3dview) <KeyPress-Left> \
     377    bind $itk_component(view) <KeyPress-Left> \
    384378        [itcl::code $this Pan set -10 0]
    385     bind $itk_component(3dview) <KeyPress-Right> \
     379    bind $itk_component(view) <KeyPress-Right> \
    386380        [itcl::code $this Pan set 10 0]
    387     bind $itk_component(3dview) <KeyPress-Up> \
     381    bind $itk_component(view) <KeyPress-Up> \
    388382        [itcl::code $this Pan set 0 -10]
    389     bind $itk_component(3dview) <KeyPress-Down> \
     383    bind $itk_component(view) <KeyPress-Down> \
    390384        [itcl::code $this Pan set 0 10]
    391     bind $itk_component(3dview) <Shift-KeyPress-Left> \
     385    bind $itk_component(view) <Shift-KeyPress-Left> \
    392386        [itcl::code $this Pan set -50 0]
    393     bind $itk_component(3dview) <Shift-KeyPress-Right> \
     387    bind $itk_component(view) <Shift-KeyPress-Right> \
    394388        [itcl::code $this Pan set 50 0]
    395     bind $itk_component(3dview) <Shift-KeyPress-Up> \
     389    bind $itk_component(view) <Shift-KeyPress-Up> \
    396390        [itcl::code $this Pan set 0 -50]
    397     bind $itk_component(3dview) <Shift-KeyPress-Down> \
     391    bind $itk_component(view) <Shift-KeyPress-Down> \
    398392        [itcl::code $this Pan set 0 50]
    399393
    400394    # Set up bindings for zoom with keyboard
    401     bind $itk_component(3dview) <KeyPress-Prior> \
     395    bind $itk_component(view) <KeyPress-Prior> \
    402396        [itcl::code $this Zoom out 2]
    403     bind $itk_component(3dview) <KeyPress-Next> \
     397    bind $itk_component(view) <KeyPress-Next> \
    404398        [itcl::code $this Zoom in 2]
    405399
    406     bind $itk_component(3dview) <Enter> "focus $itk_component(3dview)"
    407 
    408     bind $itk_component(3dview) <Configure> \
     400    bind $itk_component(view) <Enter> "focus $itk_component(view)"
     401
     402    bind $itk_component(view) <Configure> \
    409403        [itcl::code $this EventuallyResize %w %h]
    410     bind $itk_component(3dview) <Unmap> \
     404    bind $itk_component(view) <Unmap> \
    411405        [itcl::code $this Unmap]
    412     bind $itk_component(3dview) <Map> \
     406    bind $itk_component(view) <Map> \
    413407        [itcl::code $this Map]
    414408
     
    468462        }
    469463        set _dobj2raise($dataobj) $params(-raise)
    470         debug "setting parameters for $dataobj"
     464        DebugTrace "setting parameters for $dataobj"
    471465
    472466        if { [isconnected] } {
     
    726720
    727721itcl::body Rappture::MolvisViewer::SendCmd { cmd } {
    728     debug "cmd: ($cmd)"
     722    DebugTrace "cmd: ($cmd)"
    729723
    730724    if { $_state(server) != $_state(client) } {
     
    758752    }
    759753    set data [ReceiveBytes $size]
    760     #debug "success: reading $size bytes from proxy"
     754    #DebugTrace "success: reading $size bytes from proxy"
    761755    if { [string match "print*" $cacheid] } {
    762756        # $frame is the token that we sent to the proxy.
     
    765759    } else {
    766760        set _imagecache($tag) $data
    767         #debug "CACHED: $tag,$cacheid"
     761        #DebugTrace "CACHED: $tag,$cacheid"
    768762        $_image(plot) configure -data $data
    769763        set _image(id) $tag
     
    872866# ----------------------------------------------------------------------
    873867itcl::body Rappture::MolvisViewer::Rebuild {} {
    874     debug "Enter"
     868    DebugTrace "Enter"
    875869    set changed 0
    876870
     
    11121106        # Set or restore viewing parameters.  We do this for the first
    11131107        # model and assume this works for everything else.
    1114         set w  [winfo width $itk_component(3dview)]
    1115         set h  [winfo height $itk_component(3dview)]
     1108        set w  [winfo width $itk_component(view)]
     1109        set h  [winfo height $itk_component(view)]
    11161110        SendCmd "reset"
    11171111        SendCmd "screen $w $h"
     
    11191113        SendCmd "pan $_view(xpan) $_view(ypan)"
    11201114        SendCmd "zoom $_view(zoom)"
    1121         debug "rotate $_view(mx) $_view(my) $_view(mz)"
     1115        DebugTrace "rotate $_view(mx) $_view(my) $_view(mz)"
    11221116
    11231117        SendCmd "raw -defer {zoom complete=1}"
     
    11511145    blt::busy release $itk_component(hull)
    11521146
    1153     debug "Exit"
     1147    DebugTrace "Exit"
    11541148}
    11551149
     
    12461240    }
    12471241    if { $option == "click" } {
    1248         $itk_component(3dview) configure -cursor hand1
     1242        $itk_component(view) configure -cursor hand1
    12491243    }
    12501244    if { $option == "drag" || $option == "release" } {
     
    12591253    set _mevent(y) $y
    12601254    if { $option == "release" } {
    1261         $itk_component(3dview) configure -cursor ""
     1255        $itk_component(view) configure -cursor ""
    12621256    }
    12631257}
     
    13131307        unset _rocker(afterid)
    13141308    }
    1315     if { ![winfo viewable $itk_component(3dview)] } {
     1309    if { ![winfo viewable $itk_component(view)] } {
    13161310        return
    13171311    }
     
    13851379    }
    13861380    if { $option == "click" } {
    1387         $itk_component(3dview) configure -cursor fleur
     1381        $itk_component(view) configure -cursor fleur
    13881382    }
    13891383    if { $option == "drag" || $option == "release" } {
     
    13941388            return
    13951389        }
    1396         set w [winfo width $itk_component(3dview)]
    1397         set h [winfo height $itk_component(3dview)]
     1390        set w [winfo width $itk_component(view)]
     1391        set h [winfo height $itk_component(view)]
    13981392        if {$w <= 0 || $h <= 0} {
    13991393            return
     
    14301424        #SendCmd "rotate $mx $my $mz"
    14311425        EventuallyRotate $mx $my $mz
    1432         debug "rotate $_view(mx) $_view(my) $_view(mz)"
     1426        DebugTrace "rotate $_view(mx) $_view(my) $_view(mz)"
    14331427    }
    14341428    set _mevent(x) $x
     
    14361430    set _mevent(time) $now
    14371431    if { $option == "release" } {
    1438         $itk_component(3dview) configure -cursor ""
     1432        $itk_component(view) configure -cursor ""
    14391433    }
    14401434}
     
    14581452    switch -- $option {
    14591453        click {
    1460             $itk_component(3dview) configure -cursor fleur
     1454            $itk_component(view) configure -cursor fleur
    14611455            set _click(x) $x
    14621456            set _click(y) $y
     
    14681462                Rotate.old click $x $y
    14691463            } else {
    1470                 set w [winfo width $itk_component(3dview)]
    1471                 set h [winfo height $itk_component(3dview)]
     1464                set w [winfo width $itk_component(view)]
     1465                set h [winfo height $itk_component(view)]
    14721466                if {$w <= 0 || $h <= 0} {
    14731467                    return
     
    15271521                EventuallyRotate $a $b $c
    15281522                #SendCmd "rotate $a $b $c"
    1529                 debug "x,y: $x $y: rotate $_view(vx) $_view(vy) $_view(vz)"
     1523                DebugTrace "x,y: $x $y: rotate $_view(vx) $_view(vy) $_view(vz)"
    15301524                set _click(x) $x
    15311525                set _click(y) $y
     
    15341528        release {
    15351529            Rotate.old drag $x $y
    1536             $itk_component(3dview) configure -cursor ""
     1530            $itk_component(view) configure -cursor ""
    15371531            catch {unset _click}
    15381532        }
     
    16921686    DoResize
    16931687    SendCmd "rotate $_view(mx) $_view(my) $_view(mz)"
    1694     debug "rotate $_view(mx) $_view(my) $_view(mz)"
     1688    DebugTrace "rotate $_view(mx) $_view(my) $_view(mz)"
    16951689    SendCmd "pan $_view(xpan) $_view(ypan)"
    16961690    SendCmd "zoom $_view(zoom)"
  • branches/uq/gui/scripts/nanovisviewer.tcl

    r5679 r5850  
    88# ======================================================================
    99#  AUTHOR:  Michael McLennan, Purdue University
    10 #  Copyright (c) 2004-2012  HUBzero Foundation, LLC
     10#  Copyright (c) 2004-2015  HUBzero Foundation, LLC
    1111#
    1212#  See the file "license.terms" for information on usage and
     
    153153    set _serverType "nanovis"
    154154
    155     # Draw legend event
     155    #DebugOn
     156    EnableWaitDialog 900
     157
     158    # Rebuild event
     159    $_dispatcher register !rebuild
     160    $_dispatcher dispatch $this !rebuild "[itcl::code $this Rebuild]; list"
     161
     162    # Resize event
     163    $_dispatcher register !resize
     164    $_dispatcher dispatch $this !resize "[itcl::code $this DoResize]; list"
     165
     166    # Legend event
    156167    $_dispatcher register !legend
    157168    $_dispatcher dispatch $this !legend "[itcl::code $this FixLegend]; list"
     
    161172    $_dispatcher dispatch $this !send_transfunc \
    162173        "[itcl::code $this SendTransferFunctions]; list"
    163 
    164     # Rebuild event
    165     $_dispatcher register !rebuild
    166     $_dispatcher dispatch $this !rebuild "[itcl::code $this Rebuild]; list"
    167 
    168     # Resize event
    169     $_dispatcher register !resize
    170     $_dispatcher dispatch $this !resize "[itcl::code $this DoResize]; list"
    171174
    172175    #
     
    179182    # Initialize the view to some default parameters.
    180183    array set _view {
    181         -qw      0.853553
    182         -qx      -0.353553
    183         -qy      0.353553
    184         -qz      0.146447
    185         -xpan    0
    186         -ypan    0
    187         -zoom    1.0
     184        -qw       0.853553
     185        -qx       -0.353553
     186        -qy       0.353553
     187        -qz       0.146447
     188        -xpan     0
     189        -ypan     0
     190        -zoom     1.0
    188191    }
    189192    set _arcball [blt::arcball create 100 100]
     
    192195    set _limits(vmin) 0.0
    193196    set _limits(vmax) 1.0
    194     set _reset 1
    195197
    196198    array set _settings [subst {
     
    223225    }]
    224226
    225     itk_component add 3dview {
     227    itk_component add view {
    226228        label $itk_component(plotarea).view -image $_image(plot) \
    227229            -highlightthickness 0 -borderwidth 0
     
    230232        ignore -highlightthickness -borderwidth  -background
    231233    }
    232     bind $itk_component(3dview) <Control-F1> [itcl::code $this ToggleConsole]
     234    bind $itk_component(view) <Control-F1> [itcl::code $this ToggleConsole]
    233235
    234236    set f [$itk_component(main) component controls]
     
    274276            -onimage [Rappture::icon volume-on] \
    275277            -offimage [Rappture::icon volume-off] \
    276             -command [itcl::code $this AdjustSetting -volume] \
    277             -variable [itcl::scope _settings(-volume)]
     278            -variable [itcl::scope _settings(-volume)] \
     279            -command [itcl::code $this AdjustSetting -volume]
    278280    }
    279281    $itk_component(volume) select
     
    319321    # the server.  So the panewindow uses the tiny size.
    320322    set w 10000
    321     pack forget $itk_component(3dview)
     323    pack forget $itk_component(view)
    322324    blt::table $itk_component(plotarea) \
    323         0,0 $itk_component(3dview) -fill both -reqwidth $w \
     325        0,0 $itk_component(view) -fill both -reqwidth $w \
    324326        1,0 $itk_component(legend) -fill x
    325327    blt::table configure $itk_component(plotarea) r1 -resize none
    326328
    327329    # Bindings for rotation via mouse
    328     bind $itk_component(3dview) <ButtonPress-1> \
     330    bind $itk_component(view) <ButtonPress-1> \
    329331        [itcl::code $this Rotate click %x %y]
    330     bind $itk_component(3dview) <B1-Motion> \
     332    bind $itk_component(view) <B1-Motion> \
    331333        [itcl::code $this Rotate drag %x %y]
    332     bind $itk_component(3dview) <ButtonRelease-1> \
     334    bind $itk_component(view) <ButtonRelease-1> \
    333335        [itcl::code $this Rotate release %x %y]
    334     bind $itk_component(3dview) <Configure> \
     336    bind $itk_component(view) <Configure> \
    335337        [itcl::code $this EventuallyResize %w %h]
    336338
    337339    # Bindings for panning via mouse
    338     bind $itk_component(3dview) <ButtonPress-2> \
     340    bind $itk_component(view) <ButtonPress-2> \
    339341        [itcl::code $this Pan click %x %y]
    340     bind $itk_component(3dview) <B2-Motion> \
     342    bind $itk_component(view) <B2-Motion> \
    341343        [itcl::code $this Pan drag %x %y]
    342     bind $itk_component(3dview) <ButtonRelease-2> \
     344    bind $itk_component(view) <ButtonRelease-2> \
    343345        [itcl::code $this Pan release %x %y]
    344346
    345347    # Bindings for panning via keyboard
    346     bind $itk_component(3dview) <KeyPress-Left> \
     348    bind $itk_component(view) <KeyPress-Left> \
    347349        [itcl::code $this Pan set -10 0]
    348     bind $itk_component(3dview) <KeyPress-Right> \
     350    bind $itk_component(view) <KeyPress-Right> \
    349351        [itcl::code $this Pan set 10 0]
    350     bind $itk_component(3dview) <KeyPress-Up> \
     352    bind $itk_component(view) <KeyPress-Up> \
    351353        [itcl::code $this Pan set 0 -10]
    352     bind $itk_component(3dview) <KeyPress-Down> \
     354    bind $itk_component(view) <KeyPress-Down> \
    353355        [itcl::code $this Pan set 0 10]
    354     bind $itk_component(3dview) <Shift-KeyPress-Left> \
     356    bind $itk_component(view) <Shift-KeyPress-Left> \
    355357        [itcl::code $this Pan set -2 0]
    356     bind $itk_component(3dview) <Shift-KeyPress-Right> \
     358    bind $itk_component(view) <Shift-KeyPress-Right> \
    357359        [itcl::code $this Pan set 2 0]
    358     bind $itk_component(3dview) <Shift-KeyPress-Up> \
     360    bind $itk_component(view) <Shift-KeyPress-Up> \
    359361        [itcl::code $this Pan set 0 -2]
    360     bind $itk_component(3dview) <Shift-KeyPress-Down> \
     362    bind $itk_component(view) <Shift-KeyPress-Down> \
    361363        [itcl::code $this Pan set 0 2]
    362364
    363365    # Bindings for zoom via keyboard
    364     bind $itk_component(3dview) <KeyPress-Prior> \
     366    bind $itk_component(view) <KeyPress-Prior> \
    365367        [itcl::code $this Zoom out]
    366     bind $itk_component(3dview) <KeyPress-Next> \
     368    bind $itk_component(view) <KeyPress-Next> \
    367369        [itcl::code $this Zoom in]
    368370
    369     bind $itk_component(3dview) <Enter> "focus $itk_component(3dview)"
     371    bind $itk_component(view) <Enter> "focus $itk_component(view)"
    370372
    371373    if {[string equal "x11" [tk windowingsystem]]} {
    372374        # Bindings for zoom via mouse
    373         bind $itk_component(3dview) <4> [itcl::code $this Zoom out]
    374         bind $itk_component(3dview) <5> [itcl::code $this Zoom in]
     375        bind $itk_component(view) <4> [itcl::code $this Zoom out]
     376        bind $itk_component(view) <5> [itcl::code $this Zoom in]
    375377    }
    376378
     
    378380
    379381    eval itk_initialize $args
    380 
    381     EnableWaitDialog 900
    382382    Connect
    383383}
     
    435435# ----------------------------------------------------------------------
    436436# USAGE: get ?-objects?
    437 # USAGE: get ?-image 3dview|legend?
     437# USAGE: get ?-image view|legend?
    438438#
    439439# Clients use this to query the list of objects being plotted, in
     
    465465        -image {
    466466            if {[llength $args] != 2} {
    467                 error "wrong # args: should be \"get -image 3dview|legend\""
     467                error "wrong # args: should be \"get -image view|legend\""
    468468            }
    469469            switch -- [lindex $args end] {
    470                 3dview {
     470                view {
    471471                    return $_image(plot)
    472472                }
     
    475475                }
    476476                default {
    477                     error "bad image name \"[lindex $args end]\": should be 3dview or legend"
     477                    error "bad image name \"[lindex $args end]\": should be view or legend"
    478478                }
    479479            }
     
    488488# USAGE: delete ?<dataobj1> <dataobj2> ...?
    489489#
    490 #       Clients use this to delete a dataobj from the plot.  If no dataobjs
    491 #       are specified, then all dataobjs are deleted.  No data objects are
    492 #       deleted.  They are only removed from the display list.
    493 #
     490# Clients use this to delete a dataobj from the plot.  If no dataobjs
     491# are specified, then all dataobjs are deleted.  No data objects are
     492# deleted.  They are only removed from the display list.
    494493# ----------------------------------------------------------------------
    495494itcl::body Rappture::NanovisViewer::delete {args} {
     
    647646        }
    648647
    649         set w [winfo width $itk_component(3dview)]
    650         set h [winfo height $itk_component(3dview)]
     648        set w [winfo width $itk_component(view)]
     649        set h [winfo height $itk_component(view)]
    651650        EventuallyResize $w $h
    652651    }
     
    657656# isconnected --
    658657#
    659 #       Indicates if we are currently connected to the visualization server.
     658# Indicates if we are currently connected to the visualization server.
    660659#
    661660itcl::body Rappture::NanovisViewer::isconnected {} {
     
    673672# Disconnect --
    674673#
    675 #       Clients use this method to disconnect from the current rendering
    676 #       server.
     674# Clients use this method to disconnect from the current rendering server.
    677675#
    678676itcl::body Rappture::NanovisViewer::Disconnect {} {
     
    814812# ReceiveLegend --
    815813#
    816 #       The procedure is the response from the render server to each "legend"
    817 #       command.  The server sends back a "legend" command invoked our
    818 #       the slave interpreter.  The purpose is to collect data of the image
    819 #       representing the legend in the canvas.  In addition, the
    820 #       active transfer function is displayed.
     814# The procedure is the response from the render server to each "legend"
     815# command.  The server sends back a "legend" command invoked our
     816# the slave interpreter.  The purpose is to collect data of the image
     817# representing the legend in the canvas.  In addition, the
     818# active transfer function is displayed.
    821819#
    822820itcl::body Rappture::NanovisViewer::ReceiveLegend { tf vmin vmax size } {
     
    834832# ReceiveData --
    835833#
    836 #       The procedure is the response from the render server to each "data
    837 #       follows" command.  The server sends back a "data" command invoked our
    838 #       the slave interpreter.  The purpose is to collect the min/max of the
    839 #       volume sent to the render server.  Since the client (nanovisviewer)
    840 #       doesn't parse 3D data formats, we rely on the server (nanovis) to
    841 #       tell us what the limits are.  Once we've received the limits to all
    842 #       the data we've sent (tracked by _recvdDatasets) we can then determine
    843 #       what the transfer functions are for these volumes.
     834# The procedure is the response from the render server to each "data
     835# follows" command.  The server sends back a "data" command invoked our
     836# the slave interpreter.  The purpose is to collect the min/max of the
     837# volume sent to the render server.  Since the client (nanovisviewer)
     838# doesn't parse 3D data formats, we rely on the server (nanovis) to
     839# tell us what the limits are.  Once we've received the limits to all
     840# the data we've sent (tracked by _recvdDatasets) we can then determine
     841# what the transfer functions are for these volumes.
    844842#
    845843#
     
    893891# ----------------------------------------------------------------------
    894892itcl::body Rappture::NanovisViewer::Rebuild {} {
    895     set w [winfo width $itk_component(3dview)]
    896     set h [winfo height $itk_component(3dview)]
     893    set w [winfo width $itk_component(view)]
     894    set h [winfo height $itk_component(view)]
    897895    if { $w < 2 || $h < 2 } {
    898896        update
     
    10041002            }
    10051003        }
     1004        set _reset 0
    10061005    }
    10071006
     
    10251024    StopBufferingCommands
    10261025    blt::busy release $itk_component(hull)
    1027     set _reset 0
    10281026}
    10291027
     
    11231121    switch -- $option {
    11241122        click {
    1125             $itk_component(3dview) configure -cursor fleur
     1123            $itk_component(view) configure -cursor fleur
    11261124            set _click(x) $x
    11271125            set _click(y) $y
     
    11311129                Rotate click $x $y
    11321130            } else {
    1133                 set w [winfo width $itk_component(3dview)]
    1134                 set h [winfo height $itk_component(3dview)]
     1131                set w [winfo width $itk_component(view)]
     1132                set h [winfo height $itk_component(view)]
    11351133                if {$w <= 0 || $h <= 0} {
    11361134                    return
     
    11591157        release {
    11601158            Rotate drag $x $y
    1161             $itk_component(3dview) configure -cursor ""
     1159            $itk_component(view) configure -cursor ""
    11621160            catch {unset _click}
    11631161        }
     
    11781176itcl::body Rappture::NanovisViewer::Pan {option x y} {
    11791177    # Experimental stuff
    1180     set w [winfo width $itk_component(3dview)]
    1181     set h [winfo height $itk_component(3dview)]
     1178    set w [winfo width $itk_component(view)]
     1179    set h [winfo height $itk_component(view)]
    11821180    if { $option == "set" } {
    11831181        set x [expr $x / double($w)]
     
    11931191        set _click(x) $x
    11941192        set _click(y) $y
    1195         $itk_component(3dview) configure -cursor hand1
     1193        $itk_component(view) configure -cursor hand1
    11961194    }
    11971195    if { $option == "drag" || $option == "release" } {
     
    12071205    }
    12081206    if { $option == "release" } {
    1209         $itk_component(3dview) configure -cursor ""
     1207        $itk_component(view) configure -cursor ""
    12101208    }
    12111209}
     
    12731271            if { $_settings($what) } {
    12741272                blt::table $itk_component(plotarea) \
    1275                     0,0 $itk_component(3dview) -fill both \
     1273                    0,0 $itk_component(view) -fill both \
    12761274                    1,0 $itk_component(legend) -fill x
    12771275                blt::table configure $itk_component(plotarea) r1 -resize none
     
    13711369# NameTransferFunction --
    13721370#
    1373 #       Creates a transfer function name based on the <style> settings in the
    1374 #       library run.xml file. This placeholder will be used later to create
    1375 #       and send the actual transfer function once the data info has been sent
    1376 #       to us by the render server. [We won't know the volume limits until the
    1377 #       server parses the 3D data and sends back the limits via ReceiveData.]
     1371# Creates a transfer function name based on the <style> settings in the
     1372# library run.xml file. This placeholder will be used later to create
     1373# and send the actual transfer function once the data info has been sent
     1374# to us by the render server. [We won't know the volume limits until the
     1375# server parses the 3D data and sends back the limits via ReceiveData.]
    13781376#
    13791377#       FIXME: The current way we generate transfer-function names completely
     
    13981396# ComputeTransferFunction --
    13991397#
    1400 #       Computes and sends the transfer function to the render server.  It's
    1401 #       assumed that the volume data limits are known and that the global
    1402 #       transfer-functions slider values have been set up.  Both parts are
    1403 #       needed to compute the relative value (location) of the marker, and
    1404 #       the alpha map of the transfer function.
     1398# Computes and sends the transfer function to the render server.  It's
     1399# assumed that the volume data limits are known and that the global
     1400# transfer-functions slider values have been set up.  Both parts are
     1401# needed to compute the relative value (location) of the marker, and
     1402# the alpha map of the transfer function.
    14051403#
    14061404itcl::body Rappture::NanovisViewer::ComputeTransferFunction { tf } {
  • branches/uq/gui/scripts/visviewer.tcl

    r5679 r5850  
    4343    #private variable _idleTimeout 0;       # No timeout
    4444
     45    protected variable _debug 0
    4546    protected variable _serverType "???";# Type of server.
    4647    protected variable _sid ""      ;   # socket connection to server
     
    8485    protected method ColorsToColormap { colors }
    8586    protected method Connect { servers }
     87    protected method DebugOff {} {
     88        set _debug 0
     89    }
     90    protected method DebugOn {} {
     91        set _debug 1
     92    }
     93    protected method DebugTrace { args } {
     94        if { $_debug } {
     95            puts stderr "[info level -1]: $args"
     96        }
     97    }
    8698    protected method DisableWaitDialog {}
    8799    protected method Disconnect {}
  • branches/uq/gui/scripts/vtkglyphviewer.tcl

    r5679 r5850  
    132132    private variable _start 0
    133133    private variable _title ""
    134 
    135     private common _downloadPopup;      # download options from popup
    136     private common _hardcopy
    137134    private variable _width 0
    138135    private variable _height 0
     
    143140    private variable _field      ""
    144141    private variable _colorMode "vmag"; #  Mode of colormap (vmag or scalar)
    145     private variable _fieldNames {}
    146142    private variable _fields
    147143    private variable _curFldName ""
    148144    private variable _curFldLabel ""
     145
     146    private common _downloadPopup;      # download options from popup
     147    private common _hardcopy
    149148}
    150149
     
    15521551    }
    15531552    # Set the legend on the first heightmap dataset.
    1554     if { $_currentColormap != ""  } {
     1553    if { $_currentColormap != "" } {
    15551554        set cmap $_currentColormap
    15561555        if { ![info exists _colormaps($cmap)] } {
  • branches/uq/gui/scripts/vtkheightmapviewer.tcl

    r5679 r5850  
    143143    private variable _isolines
    144144    private variable _contourList ""
    145 
    146     private common _downloadPopup;      # download options from popup
    147     private common _hardcopy
    148145    private variable _width 0
    149146    private variable _height 0
     
    153150    private variable _rotatePending 0
    154151    private variable _legendPending 0
    155     private variable _fieldNames {}
    156152    private variable _fields
    157153    private variable _curFldName ""
    158154    private variable _curFldLabel ""
    159155    private variable _colorMode "scalar";#  Mode of colormap (vmag or scalar)
     156
     157    private common _downloadPopup;      # download options from popup
     158    private common _hardcopy
    160159}
    161160
     
    942941        # controls on the axis settings tab if necessary.
    943942        # -Leif
    944         SendCmd "axis exp 0 0 0 1"
     943        #SendCmd "axis exp 0 0 0 1"
    945944
    946945        SendCmd "axis lrot z 90"
     
    10421041    if { $_reset } {
    10431042        SendCmd "axis tickpos outside"
    1044         SendCmd "axis lformat all %g"
     1043        #SendCmd "axis lformat all %g"
    10451044
    10461045        foreach axis { x y z } {
     
    14901489            ResetAxes
    14911490            SendCmd "dataset scalar $_curFldName"
    1492             SendCmd "heightmap colormode scalar $_curFldName"
     1491            SendCmd "heightmap colormode $_colorMode $_curFldName"
     1492            UpdateContourList
     1493            SendCmd "heightmap contourlist [list $_contourList]"
    14931494            Zoom reset
    1494             UpdateContourList
    14951495            DrawLegend
    14961496        }
     
    17241724    }
    17251725    # Set the legend on the first heightmap dataset.
    1726     if { $_currentColormap != ""  } {
     1726    if { $_currentColormap != "" } {
    17271727        set cmap $_currentColormap
    17281728        if { ![info exists _colormaps($cmap)] } {
  • branches/uq/gui/scripts/vtkimageviewer.tcl

    r5679 r5850  
    138138    private variable _isolines
    139139    private variable _contourList ""
    140 
    141     private common _downloadPopup;      # download options from popup
    142     private common _hardcopy
    143140    private variable _width 0
    144141    private variable _height 0
     
    148145    private variable _rotatePending 0
    149146    private variable _legendPending 0
    150     private variable _fieldNames {}
    151147    private variable _fields
    152148    private variable _curFldName ""
    153149    private variable _curFldLabel ""
    154150    private variable _colorMode "scalar";#  Mode of colormap (vmag or scalar)
     151
     152    private common _downloadPopup;      # download options from popup
     153    private common _hardcopy
    155154}
    156155
  • branches/uq/gui/scripts/vtkisosurfaceviewer.tcl

    r5679 r5850  
    153153    private variable _currentLimits ""
    154154    private variable _widget
    155 
    156     private common _downloadPopup;      # download options from popup
    157     private common _hardcopy
    158155    private variable _width 0
    159156    private variable _height 0
     
    164161    private variable _field      ""
    165162    private variable _colorMode "scalar";   #  Mode of colormap (vmag or scalar)
    166     private variable _fieldNames {}
    167163    private variable _fields
    168164    private variable _curFldName ""
    169165    private variable _curFldLabel ""
    170 
    171166    private variable _mouseOver "";     # what called LegendRangeAction, vmin or vmax
    172167    private variable _customRangeClick 1;   # what called ToggleCustomRange
     168
     169    private common _downloadPopup;      # download options from popup
     170    private common _hardcopy
    173171}
    174172
     
    16701668    }
    16711669    # Set the legend on the first isosurface dataset.
    1672     if { $_currentColormap != ""  } {
     1670    if { $_currentColormap != "" } {
    16731671        set cmap $_currentColormap
    16741672        if { ![info exists _colormaps($cmap)] } {
  • branches/uq/gui/scripts/vtkmeshviewer.tcl

    r5679 r5850  
    113113    private variable _start 0
    114114    private variable _title ""
    115 
    116     private common _downloadPopup;      # download options from popup
    117     private common _hardcopy
    118115    private variable _width 0
    119116    private variable _height 0
     
    123120    private variable _rotateDelay 150
    124121    private variable _opacityDelay 150
     122
     123    private common _downloadPopup;      # download options from popup
     124    private common _hardcopy
    125125}
    126126
     
    860860    }
    861861    if {"" != $_first} {
    862         set location [$_first hints camera]
    863         if { $location != "" } {
    864             array set view $location
    865         }
    866 
    867862        foreach axis { x y z } {
    868863            set label [$_first label ${axis}]
  • branches/uq/gui/scripts/vtkstreamlinesviewer.tcl

    r5679 r5850  
    6666    private method BuildAxisTab {}
    6767    private method BuildCameraTab {}
    68     private method BuildColormap { name colors }
     68    private method BuildColormap { name }
    6969    private method BuildCutplaneTab {}
    7070    private method BuildDownloadPopup { widget command }
    7171    private method BuildStreamsTab {}
    72     private method BuildVolumeTab {}
     72    private method BuildSurfaceTab {}
    7373    private method DrawLegend {}
    7474    private method Combo { option }
     
    102102    private method RequestLegend {}
    103103    private method Rotate {option x y}
    104     private method SetColormap { dataobj comp }
    105     private method ChangeColormap { dataobj comp color }
     104    private method SetCurrentColormap { color }
    106105    private method SetLegendTip { x y }
    107106    private method SetObjectStyle { dataobj comp }
     
    121120    private variable _colormaps    ;    # contains all the colormaps
    122121                                   ;    # in the server.
    123     private variable _dataset2style    ;# maps dataobj-component to transfunc
     122    private variable _currentColormap ""
    124123
    125124    private variable _click        ;    # info used for rotate operations
     
    127126    private variable _view         ;    # view params for 3D view
    128127    private variable _settings
    129     private variable _style;            # Array of current component styles.
    130     private variable _initialStyle;     # Array of initial component styles.
    131128    private variable _reset 1;          # Connection to server has been reset.
    132129
     
    135132    private variable _title ""
    136133    private variable _seeds
    137 
    138     private common _downloadPopup;      # download options from popup
    139     private common _hardcopy
    140134    private variable _width 0
    141135    private variable _height 0
     
    145139    private variable _cutplanePending 0
    146140    private variable _legendPending 0
    147     private variable _vectorFields
    148     private variable _scalarFields
    149141    private variable _fields
    150142    private variable _curFldName ""
     
    153145    private variable _numSeeds 200
    154146    private variable _colorMode "vmag";#  Mode of colormap (vmag or scalar)
     147
     148    private common _downloadPopup;      # download options from popup
     149    private common _hardcopy
    155150}
    156151
     
    245240        -streamlinesnumseeds        200
    246241        -streamlinesopacity         100
    247         -streamlinesscale           1
     242        -streamlineslength          70
    248243        -streamlinesseedsvisible    0
    249244        -streamlinesvisible         1
    250         -volumeedges                0
    251         -volumelighting             1
    252         -volumeopacity              40
    253         -volumevisible              1
    254         -volumewireframe            0
     245        -surfaceedges               0
     246        -surfacelighting            1
     247        -surfaceopacity             40
     248        -surfacevisible             1
     249        -surfacewireframe           0
    255250        -xgrid                      0
    256251        -ygrid                      0
     
    330325    Rappture::Tooltip::for $itk_component(zoomout) "Zoom out"
    331326
    332     itk_component add volume {
    333         Rappture::PushButton $f.volume \
     327    itk_component add surface {
     328        Rappture::PushButton $f.surface \
    334329            -onimage [Rappture::icon volume-on] \
    335330            -offimage [Rappture::icon volume-off] \
    336             -variable [itcl::scope _settings(-volumevisible)] \
    337             -command [itcl::code $this AdjustSetting -volumevisible]
    338     }
    339     $itk_component(volume) select
    340     Rappture::Tooltip::for $itk_component(volume) \
    341         "Don't display the volume"
    342     pack $itk_component(volume) -padx 2 -pady 2
     331            -variable [itcl::scope _settings(-surfacevisible)] \
     332            -command [itcl::code $this AdjustSetting -surfacevisible]
     333    }
     334    $itk_component(surface) select
     335    Rappture::Tooltip::for $itk_component(surface) \
     336        "Show/Hide the boundary surface"
     337    pack $itk_component(surface) -padx 2 -pady 2
    343338
    344339    itk_component add streamlines {
     
    351346    $itk_component(streamlines) select
    352347    Rappture::Tooltip::for $itk_component(streamlines) \
    353         "Toggle the streamlines on/off"
     348        "Show/Hide the streamlines"
    354349    pack $itk_component(streamlines) -padx 2 -pady 2
    355350
     
    362357    }
    363358    Rappture::Tooltip::for $itk_component(cutplane) \
    364         "Show/Hide cutplanes"
     359        "Show/Hide the cutplanes"
    365360    pack $itk_component(cutplane) -padx 2 -pady 2
    366361
    367 
    368362    if { [catch {
    369         BuildVolumeTab
     363        BuildSurfaceTab
    370364        BuildStreamsTab
    371365        BuildCutplaneTab
     
    852846    array unset _colormaps
    853847    array unset _seeds
    854     array unset _dataset2style
    855848}
    856849
     
    10131006    }
    10141007    if {"" != $_first} {
    1015         set location [$_first hints camera]
    1016         if { $location != "" } {
    1017             array set view $location
    1018         }
    10191008        foreach axis { x y z } {
    10201009            set label [$_first hints ${axis}label]
     
    10311020        array unset _fields
    10321021        set _curFldName ""
     1022        set _curFldLabel ""
    10331023        foreach cname [$_first components] {
    10341024            foreach fname [$_first fieldnames $cname] {
     
    10471037                    -command [itcl::code $this Combo invoke]
    10481038                set _fields($fname) [list $label $units $components]
    1049                 if { $_curFldName == "" } {
     1039                if { $_curFldName == "" && $components == 3 } {
    10501040                    set _curFldName $fname
    10511041                    set _curFldLabel $label
     
    10611051            -streamlineslighting \
    10621052            -streamlinescolormap -field \
    1063             -volumevisible -volumeedges -volumelighting -volumeopacity \
    1064             -volumewireframe \
     1053            -surfacevisible -surfaceedges -surfacelighting -surfaceopacity \
     1054            -surfacewireframe \
    10651055            -cutplanevisible \
    10661056            -cutplanexposition -cutplaneyposition -cutplanezposition \
     
    13431333            set bool $_settings($what)
    13441334            SendCmd "cutplane visible $bool"
     1335            if { $bool } {
     1336                Rappture::Tooltip::for $itk_component(cutplane) \
     1337                    "Hide the cutplanes"
     1338            } else {
     1339                Rappture::Tooltip::for $itk_component(cutplane) \
     1340                    "Show the cutplanes"
     1341            }
    13451342        }
    13461343        "-cutplanewireframe" {
     
    14391436            set colormap [$itk_component(colormap) value]
    14401437            set _settings($what) $colormap
    1441             foreach dataset [CurrentDatasets -visible $_first] {
    1442                 foreach {dataobj comp} [split $dataset -] break
    1443                 ChangeColormap $dataobj $comp $colormap
    1444             }
     1438            SetCurrentColormap $colormap
    14451439            set _legendPending 1
    14461440        }
     
    14501444            SendCmd "streamlines opacity $sval"
    14511445        }
    1452         "-streamlinesscale" {
     1446        "-streamlineslength" {
    14531447            set val $_settings($what)
    1454             set sval [expr { 0.01 * double($val) }]
    1455             SendCmd "streamlines scale $sval $sval $sval"
     1448            set sval [expr { (0.01 * double($val)) / 0.7 }]
     1449            foreach axis {x y z} {
     1450                foreach {min max} $_limits($axis) break
     1451                set ${axis}len [expr double($max) - double($min)]
     1452            }
     1453            set length [expr { $sval * ($xlen + $ylen + $zlen) } ]
     1454            SendCmd "streamlines length $length"
    14561455        }
    14571456        "-streamlineslighting" {
     
    14591458            SendCmd "streamlines lighting $bool"
    14601459        }
    1461         "-volumeopacity" {
     1460        "-surfaceopacity" {
    14621461            set val $_settings($what)
    14631462            set sval [expr { 0.01 * double($val) }]
    14641463            SendCmd "polydata opacity $sval"
    14651464        }
    1466         "-volumewireframe" {
     1465        "-surfacewireframe" {
    14671466            set bool $_settings($what)
    14681467            SendCmd "polydata wireframe $bool"
    14691468        }
    1470         "-volumevisible" {
     1469        "-surfacevisible" {
    14711470            set bool $_settings($what)
    14721471            SendCmd "polydata visible $bool"
    14731472            if { $bool } {
    1474                 Rappture::Tooltip::for $itk_component(volume) \
    1475                     "Hide the volume"
     1473                Rappture::Tooltip::for $itk_component(surface) \
     1474                    "Hide the boundary surface"
    14761475            } else {
    1477                 Rappture::Tooltip::for $itk_component(volume) \
    1478                     "Show the volume"
    1479             }
    1480         }
    1481         "-volumelighting" {
     1476                Rappture::Tooltip::for $itk_component(surface) \
     1477                    "Show the boundary surface"
     1478            }
     1479        }
     1480        "-surfacelighting" {
    14821481            set bool $_settings($what)
    14831482            SendCmd "polydata lighting $bool"
    14841483        }
    1485         "-volumeedges" {
     1484        "-surfaceedges" {
    14861485            set bool $_settings($what)
    14871486            SendCmd "polydata edges $bool"
     
    15141513    }
    15151514    # Set the legend on the first streamlines dataset.
    1516     foreach dataset [CurrentDatasets -visible $_first] {
    1517         foreach {dataobj comp} [split $dataset -] break
    1518         if { [info exists _dataset2style($dataset)] } {
    1519             SendCmd \
    1520                 "legend $_dataset2style($dataset) $_colorMode $_curFldName {} $w $h 0"
    1521             break;
    1522         }
    1523     }
    1524 }
    1525 
    1526 #
    1527 # ChangeColormap --
    1528 #
    1529 itcl::body Rappture::VtkStreamlinesViewer::ChangeColormap {dataobj comp color} {
    1530     set tag $dataobj-$comp
    1531     if { ![info exist _style($tag)] } {
    1532         error "no initial colormap"
    1533     }
    1534     array set style $_style($tag)
    1535     set style(-color) $color
    1536     set _style($tag) [array get style]
    1537     SetColormap $dataobj $comp
    1538 }
    1539 
    1540 #
    1541 # SetColormap --
    1542 #
    1543 itcl::body Rappture::VtkStreamlinesViewer::SetColormap { dataobj comp } {
    1544     array set style {
    1545         -color BCGYR
    1546         -levels 6
    1547         -opacity 1.0
    1548     }
    1549     set tag $dataobj-$comp
    1550     if { ![info exists _initialStyle($tag)] } {
    1551         # Save the initial component style.
    1552         set _initialStyle($tag) [$dataobj style $comp]
    1553     }
    1554 
    1555     # Override defaults with initial style defined in xml.
    1556     array set style $_initialStyle($tag)
    1557 
    1558     if { ![info exists _style($tag)] } {
    1559         set _style($tag) [array get style]
    1560     }
    1561     # Override initial style with current style.
    1562     array set style $_style($tag)
    1563 
    1564     set name "$style(-color):$style(-levels):$style(-opacity)"
     1515    if { $_currentColormap != "" } {
     1516        set cmap $_currentColormap
     1517        if { ![info exists _colormaps($cmap)] } {
     1518            BuildColormap $cmap
     1519            set _colormaps($cmap) 1
     1520        }
     1521        #SendCmd "legend $cmap $_colorMode $_curFldName {} $w $h 0"
     1522        SendCmd "legend2 $cmap $w $h"
     1523    }
     1524}
     1525
     1526#
     1527# SetCurrentColormap --
     1528#
     1529itcl::body Rappture::VtkStreamlinesViewer::SetCurrentColormap { name } {
     1530    # Keep track of the colormaps that we build.
    15651531    if { ![info exists _colormaps($name)] } {
    1566         BuildColormap $name [array get style]
     1532        BuildColormap $name
    15671533        set _colormaps($name) 1
    15681534    }
    1569     if { ![info exists _dataset2style($tag)] ||
    1570          $_dataset2style($tag) != $name } {
    1571         SendCmd "streamlines colormap $name $tag"
    1572         SendCmd "cutplane colormap $name $tag"
    1573         set _dataset2style($tag) $name
    1574     }
     1535    set _currentColormap $name
     1536    SendCmd "streamlines colormap $_currentColormap"
     1537    SendCmd "cutplane colormap $_currentColormap"
    15751538}
    15761539
     
    15781541# BuildColormap --
    15791542#
    1580 itcl::body Rappture::VtkStreamlinesViewer::BuildColormap { name styles } {
    1581     array set style $styles
    1582     set cmap [ColorsToColormap $style(-color)]
     1543itcl::body Rappture::VtkStreamlinesViewer::BuildColormap { name } {
     1544    set cmap [ColorsToColormap $name]
    15831545    if { [llength $cmap] == 0 } {
    15841546        set cmap "0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0"
    15851547    }
    1586     if { ![info exists _settings(-volumeopacity)] } {
    1587         set _settings(-volumeopacity) $style(-opacity)
    1588     }
    1589     set max $_settings(-volumeopacity)
    1590 
    15911548    set amap "0.0 1.0 1.0 1.0"
    15921549    SendCmd "colormap add $name { $cmap } { $amap }"
     
    16151572}
    16161573
    1617 itcl::body Rappture::VtkStreamlinesViewer::BuildVolumeTab {} {
     1574itcl::body Rappture::VtkStreamlinesViewer::BuildSurfaceTab {} {
    16181575
    16191576    set fg [option get $itk_component(hull) font Font]
     
    16211578
    16221579    set inner [$itk_component(main) insert end \
    1623         -title "Volume Settings" \
     1580        -title "Boundary Surface Settings" \
    16241581        -icon [Rappture::icon volume-on]]
    16251582    $inner configure -borderwidth 4
    16261583
    1627     checkbutton $inner.volume \
    1628         -text "Show Volume" \
    1629         -variable [itcl::scope _settings(-volumevisible)] \
    1630         -command [itcl::code $this AdjustSetting -volumevisible] \
     1584    checkbutton $inner.surface \
     1585        -text "Show Surface" \
     1586        -variable [itcl::scope _settings(-surfacevisible)] \
     1587        -command [itcl::code $this AdjustSetting -surfacevisible] \
    16311588        -font "Arial 9"
    16321589
    16331590    checkbutton $inner.wireframe \
    16341591        -text "Show Wireframe" \
    1635         -variable [itcl::scope _settings(-volumewireframe)] \
    1636         -command [itcl::code $this AdjustSetting -volumewireframe] \
     1592        -variable [itcl::scope _settings(-surfacewireframe)] \
     1593        -command [itcl::code $this AdjustSetting -surfacewireframe] \
    16371594        -font "Arial 9"
    16381595
    16391596    checkbutton $inner.lighting \
    16401597        -text "Enable Lighting" \
    1641         -variable [itcl::scope _settings(-volumelighting)] \
    1642         -command [itcl::code $this AdjustSetting -volumelighting] \
     1598        -variable [itcl::scope _settings(-surfacelighting)] \
     1599        -command [itcl::code $this AdjustSetting -surfacelighting] \
    16431600        -font "Arial 9"
    16441601
    16451602    checkbutton $inner.edges \
    16461603        -text "Show Edges" \
    1647         -variable [itcl::scope _settings(-volumeedges)] \
    1648         -command [itcl::code $this AdjustSetting -volumeedges] \
     1604        -variable [itcl::scope _settings(-surfaceedges)] \
     1605        -command [itcl::code $this AdjustSetting -surfaceedges] \
    16491606        -font "Arial 9"
    16501607
    16511608    label $inner.opacity_l -text "Opacity" -font "Arial 9"
    16521609    ::scale $inner.opacity -from 0 -to 100 -orient horizontal \
    1653         -variable [itcl::scope _settings(-volumeopacity)] \
     1610        -variable [itcl::scope _settings(-surfaceopacity)] \
    16541611        -width 10 \
    16551612        -showvalue off \
    1656         -command [itcl::code $this AdjustSetting -volumeopacity]
     1613        -command [itcl::code $this AdjustSetting -surfaceopacity]
    16571614
    16581615    blt::table $inner \
     
    17201677        -command [itcl::code $this AdjustSetting -streamlinesnumseeds]
    17211678
    1722     label $inner.scale_l -text "Scale" -font "Arial 9"
     1679    label $inner.scale_l -text "Length" -font "Arial 9"
    17231680    ::scale $inner.scale -from 1 -to 100 -orient horizontal \
    1724         -variable [itcl::scope _settings(-streamlinesscale)] \
     1681        -variable [itcl::scope _settings(-streamlineslength)] \
    17251682        -width 10 \
    17261683        -showvalue off \
    1727         -command [itcl::code $this AdjustSetting -streamlinesscale]
     1684        -command [itcl::code $this AdjustSetting -streamlineslength]
    17281685
    17291686    label $inner.field_l -text "Color by" -font "Arial 9"
     
    17531710        3,0 $inner.opacity_l   -anchor w -pady 2  \
    17541711        3,1 $inner.opacity     -fill x -pady 2 \
    1755         5,0 $inner.lighting    -anchor w -pady 2 -cspan 2 \
    1756         6,0 $inner.seeds       -anchor w -pady 2 -cspan 2 \
    1757         7,0 $inner.density_l   -anchor w -pady 2  \
    1758         7,1 $inner.density     -fill x   -pady 2  \
     1712        4,0 $inner.lighting    -anchor w -pady 2 -cspan 2 \
     1713        5,0 $inner.seeds       -anchor w -pady 2 -cspan 2 \
     1714        6,0 $inner.density_l   -anchor w -pady 2  \
     1715        6,1 $inner.density     -fill x   -pady 2  \
    17591716
    17601717    blt::table configure $inner r* c* -resize none
    1761     blt::table configure $inner r10 c1 c2 -resize expand
     1718    blt::table configure $inner r7 c1 c2 -resize expand
    17621719}
    17631720
     
    21352092    # Parse style string.
    21362093    set tag $dataobj-$comp
    2137     set style [$dataobj style $comp]
    2138     array set settings {
    2139         -color \#808080
     2094    array set style {
     2095        -color BCGYR
     2096        -constcolor white
     2097        -edgecolor black
    21402098        -edges 0
    2141         -edgecolor black
     2099        -lighting 1
    21422100        -linewidth 1.0
    2143         -opacity 0.4
    2144         -wireframe 0
    2145         -lighting 1
     2101        -mode lines
     2102        -numseeds 200
     2103        -opacity 1.0
    21462104        -seeds 1
    21472105        -seedcolor white
     2106        -streamlineslength 0.7
     2107        -surfacecolor white
     2108        -surfaceedgecolor black
     2109        -surfaceedges 0
     2110        -surfacelighting 1
     2111        -surfaceopacity 0.4
     2112        -surfacevisible 1
     2113        -surfacewireframe 0
    21482114        -visible 1
    21492115    }
     2116    array set style [$dataobj style $comp]
    21502117    if { $dataobj != $_first } {
    2151         set settings(-opacity) 1
    2152     }
    2153     array set settings $style
     2118        set style(-opacity) 1.0
     2119    }
    21542120    StartBufferingCommands
    21552121    SendCmd "streamlines add $tag"
    2156     SendCmd "streamlines seed visible off $tag"
     2122    SendCmd "streamlines color [Color2RGB $style(-constcolor)] $tag"
     2123    SendCmd "streamlines edges $style(-edges) $tag"
     2124    SendCmd "streamlines linecolor [Color2RGB $style(-edgecolor)] $tag"
     2125    SendCmd "streamlines linewidth $style(-linewidth) $tag"
     2126    SendCmd "streamlines lighting $style(-lighting) $tag"
     2127    SendCmd "streamlines opacity $style(-opacity) $tag"
     2128    SendCmd "streamlines seed color [Color2RGB $style(-seedcolor)] $tag"
     2129    SendCmd "streamlines seed visible $style(-seeds) $tag"
     2130    SendCmd "streamlines visible $style(-visible) $tag"
    21572131    set seeds [$dataobj hints seeds]
    21582132    if { $seeds != "" && ![info exists _seeds($dataobj)] } {
    21592133        set length [string length $seeds]
    2160         SendCmd "streamlines seed fmesh 200 data follows $length $tag"
     2134        SendCmd "streamlines seed fmesh $style(-numseeds) data follows $length $tag"
    21612135        SendData $seeds
    21622136        set _seeds($dataobj) 1
    21632137    }
     2138    set _settings(-streamlineslighting) $style(-lighting)
     2139    $itk_component(streammode) value $style(-mode)
     2140    AdjustSetting -streamlinesmode
     2141    set _settings(-streamlinesnumseeds) $style(-numseeds)
     2142    set _settings(-streamlinesopacity) [expr $style(-opacity) * 100.0]
     2143    set _settings(-streamlineslength) [expr $style(-streamlineslength) * 100.0]
     2144    set _settings(-streamlinesseedsvisible) $style(-seeds)
     2145    set _settings(-streamlinesvisible) $style(-visible)
     2146
    21642147    SendCmd "cutplane add $tag"
     2148
    21652149    SendCmd "polydata add $tag"
     2150    SendCmd "polydata color [Color2RGB $style(-surfacecolor)] $tag"
    21662151    SendCmd "polydata colormode constant {} $tag"
    2167     set _settings(-volumeedges) $settings(-edges)
    2168     set _settings(-volumelighting) $settings(-lighting)
    2169     set _settings(-volumeopacity) $settings(-opacity)
    2170     set _settings(-volumewireframe) $settings(-wireframe)
    2171     set _settings(-volumeopacity) [expr $settings(-opacity) * 100.0]
     2152    SendCmd "polydata edges $style(-surfaceedges) $tag"
     2153    SendCmd "polydata linecolor [Color2RGB $style(-surfaceedgecolor)] $tag"
     2154    SendCmd "polydata lighting $style(-surfacelighting) $tag"
     2155    SendCmd "polydata opacity $style(-surfaceopacity) $tag"
     2156    SendCmd "polydata wireframe $style(-surfacewireframe) $tag"
     2157    SendCmd "polydata visible $style(-surfacevisible) $tag"
     2158    set _settings(-surfaceedges) $style(-surfaceedges)
     2159    set _settings(-surfacelighting) $style(-surfacelighting)
     2160    set _settings(-surfaceopacity) [expr $style(-surfaceopacity) * 100.0]
     2161    set _settings(-surfacewireframe) $style(-surfacewireframe)
     2162    set _settings(-surfacevisible) $style(-surfacevisible)
    21722163    StopBufferingCommands
    2173     SetColormap $dataobj $comp
     2164    SetCurrentColormap $style(-color)
     2165    $itk_component(colormap) value $style(-color)
    21742166}
    21752167
  • branches/uq/gui/scripts/vtksurfaceviewer.tcl

    r5679 r5850  
    134134    private variable _isolines
    135135    private variable _contourList ""
    136 
    137     private common _downloadPopup;      # download options from popup
    138     private common _hardcopy
    139136    private variable _width 0
    140137    private variable _height 0
     
    143140    private variable _legendPending 0
    144141    private variable _field      ""
    145     private variable _colorMode "scalar";        #  Mode of colormap (vmag or scalar)
    146     private variable _fieldNames {}
     142    private variable _colorMode "scalar"; #  Mode of colormap (vmag or scalar)
    147143    private variable _fields
    148144    private variable _curFldName ""
    149145    private variable _curFldLabel ""
     146
     147    private common _downloadPopup;      # download options from popup
     148    private common _hardcopy
    150149}
    151150
     
    13221321            #SendCmd "contour2d colormode $_colorMode $_curFldName"
    13231322            SendCmd "polydata colormode $_colorMode $_curFldName"
     1323            UpdateContourList
     1324            SendCmd "contour2d contourlist [list $_contourList]"
    13241325            SendCmd "camera reset"
    1325             UpdateContourList
    13261326            DrawLegend
    13271327        }
     
    14651465    }
    14661466    # Set the legend on the first heightmap dataset.
    1467     if { $_currentColormap != ""  } {
     1467    if { $_currentColormap != "" } {
    14681468        set cmap $_currentColormap
    14691469        if { ![info exists _colormaps($cmap)] } {
     
    23332333                -activeforeground $itk_option(-plotforeground) \
    23342334                -font "Arial 8" \
    2335                 -command [itcl::code $this LegendTitleAction save]
     2335                -command [itcl::code $this Combo invoke]
    23362336            set _fields($fname) [list $label $units $components]
    23372337            if { $_curFldName == "" } {
  • branches/uq/gui/scripts/vtkviewer.tcl

    r5679 r5850  
    6767    private method BuildAxisTab {}
    6868    private method BuildCameraTab {}
    69     private method BuildColormap { name styles }
     69    private method BuildColormap { name }
    7070    private method BuildCutawayTab {}
    7171    private method BuildDownloadPopup { widget command }
     
    147147    private variable _start 0
    148148    private variable _title ""
    149 
    150     private common _downloadPopup;      # download options from popup
    151     private common _hardcopy
    152149    private variable _width 0
    153150    private variable _height 0
     
    162159    private variable _rotateDelay 150
    163160    private variable _scaleDelay 100
     161
     162    private common _downloadPopup;      # download options from popup
     163    private common _hardcopy
    164164}
    165165
     
    10901090    }
    10911091    if {"" != $_first} {
    1092         set location [$_first hints camera]
    1093         if { $location != "" } {
    1094             array set view $location
    1095         }
    1096 
    10971092        foreach axis { x y z } {
    10981093            set label [$_first hints ${axis}label]
     
    18081803    array set style {
    18091804        -color BCGYR
    1810         -levels 6
    1811         -opacity 1.0
    18121805    }
    18131806    if {[$dataobj type $comp] == "molecule"} {
     
    18291822    array set style $_style($tag)
    18301823
    1831     if { $style(-color) == "elementDefault" } {
    1832         set name "$style(-color)"
    1833     } else {
    1834         set name "$style(-color):$style(-levels):$style(-opacity)"
    1835     }
     1824    set name "$style(-color)"
    18361825    if { ![info exists _colormaps($name)] } {
    1837         BuildColormap $name [array get style]
     1826        BuildColormap $name
    18381827        set _colormaps($name) 1
    18391828    }
     
    18581847# BuildColormap --
    18591848#
    1860 itcl::body Rappture::VtkViewer::BuildColormap { name styles } {
    1861     if { $name ==  "elementDefault" } {
     1849itcl::body Rappture::VtkViewer::BuildColormap { name } {
     1850    if { $name == "elementDefault" } {
    18621851        return
    18631852    }
    1864     array set style $styles
    1865     set cmap [ColorsToColormap $style(-color)]
     1853    set cmap [ColorsToColormap $name]
    18661854    if { [llength $cmap] == 0 } {
    18671855        set cmap "0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0"
    18681856    }
    1869     if { ![info exists _settings(polydata-opacity)] } {
    1870         set _settings(polydata-opacity) $style(-opacity)
    1871     }
    1872     set max $_settings(polydata-opacity)
    1873 
    18741857    set amap "0.0 1.0 1.0 1.0"
    18751858    SendCmd "colormap add $name { $cmap } { $amap }"
     
    26652648                -normscale 0
    26662649                -opacity 1.0
    2667                 -orientGlyphs 0
     2650                -orientglyphs 0
    26682651                -outline 0
    26692652                -ptsize 1.0
    26702653                -quality 1
    2671                 -scaleMode "vcomp"
     2654                -scalemode "vcomp"
    26722655                -shape "sphere"
    26732656                -visible 1
     
    26782661            if {$shape != ""} {
    26792662                set settings(-shape) $shape
     2663            }
     2664            # Backwards compat with camel case style option
     2665            if { [info exists settings(-orientGlyphs)] } {
     2666                set settings(-orientglyphs) $settings(-orientGlyphs)
     2667                array unset settings -orientGlyphs
     2668            }
     2669            # Backwards compat with camel case style option
     2670            if { [info exists settings(-scaleMode)] } {
     2671                set settings(-scalemode) $settings(-scaleMode)
     2672                array unset settings -scaleMode
    26802673            }
    26812674            SendCmd "outline add $tag"
     
    26922685            # Omitting field name for gorient and smode commands
    26932686            # defaults to active scalars or vectors depending on mode
    2694             SendCmd "glyphs gorient $settings(-orientGlyphs) {} $tag"
    2695             SendCmd "glyphs smode $settings(-scaleMode) {} $tag"
     2687            SendCmd "glyphs gorient $settings(-orientglyphs) {} $tag"
     2688            SendCmd "glyphs smode $settings(-scalemode) {} $tag"
    26962689            SendCmd "glyphs edges $settings(-edges) $tag"
    26972690            SendCmd "glyphs linecolor [Color2RGB $settings(-edgecolor)] $tag"
  • branches/uq/gui/scripts/vtkvolumeviewer.tcl

    r5679 r5850  
    537537# USAGE: delete ?<dataobj1> <dataobj2> ...?
    538538#
    539 #       Clients use this to delete a dataobj from the plot.  If no dataobjs
    540 #       are specified, then all dataobjs are deleted.  No data objects are
    541 #       deleted.  They are only removed from the display list.
    542 #
     539# Clients use this to delete a dataobj from the plot.  If no dataobjs
     540# are specified, then all dataobjs are deleted.  No data objects are
     541# deleted.  They are only removed from the display list.
    543542# ----------------------------------------------------------------------
    544543itcl::body Rappture::VtkVolumeViewer::delete {args} {
     
    818817# isconnected --
    819818#
    820 #       Indicates if we are currently connected to the visualization server.
     819# Indicates if we are currently connected to the visualization server.
    821820#
    822821itcl::body Rappture::VtkVolumeViewer::isconnected {} {
     
    834833# Disconnect --
    835834#
    836 #       Clients use this method to disconnect from the current rendering
    837 #       server.
     835# Clients use this method to disconnect from the current rendering server.
    838836#
    839837itcl::body Rappture::VtkVolumeViewer::Disconnect {} {
     
    10291027    }
    10301028    if {"" != $_first} {
    1031         set location [$_first hints camera]
    1032         if { $location != "" } {
    1033             array set view $location
    1034         }
    1035 
    10361029        foreach axis { x y z } {
    10371030            set label [$_first hints ${axis}label]
     
    13191312# AdjustSetting --
    13201313#
    1321 #       Changes/updates a specific setting in the widget.  There are
    1322 #       usually user-setable option.  Commands are sent to the render
    1323 #       server.
     1314# Changes/updates a specific setting in the widget.  There are
     1315# usually user-setable option.  Commands are sent to the render
     1316# server.
    13241317#
    13251318itcl::body Rappture::VtkVolumeViewer::AdjustSetting {what {value ""}} {
     
    15171510# RequestLegend --
    15181511#
    1519 #       Request a new legend from the server.  The size of the legend
    1520 #       is determined from the height of the canvas.
     1512# Request a new legend from the server.  The size of the legend
     1513# is determined from the height of the canvas.
    15211514#
    15221515itcl::body Rappture::VtkVolumeViewer::RequestLegend {} {
     
    24142407# GetDatasetsWithComponent --
    24152408#
    2416 #       Returns a list of all the datasets (known by the combination of
    2417 #       their data object and component name) that match the given
    2418 #       component name.  For example, this is used where we want to change
    2419 #       the settings of volumes that have the current component.
     2409# Returns a list of all the datasets (known by the combination of
     2410# their data object and component name) that match the given
     2411# component name.  For example, this is used where we want to change
     2412# the settings of volumes that have the current component.
    24202413#
    24212414itcl::body Rappture::VtkVolumeViewer::GetDatasetsWithComponent { cname } {
  • branches/uq/src/core/Makefile.in

    r4545 r5850  
    3636                  -DRAPPTURE_VERSION=\"$(RAPPTURE_VERSION)\"
    3737
    38 CC_SWITCHES     = $(CFLAGS) $(CFLAGS_DEBUG) $(INCLUDES) $(DEFINES) 
    39 CXX_SWITCHES    = $(CFLAGS) $(CFLAGS_DEBUG) $(INCLUDES) $(DEFINES) 
     38CC_SWITCHES     = $(CFLAGS) $(CFLAGS_DEBUG) $(INCLUDES) $(DEFINES)
     39CXX_SWITCHES    = $(CFLAGS) $(CFLAGS_DEBUG) $(INCLUDES) $(DEFINES)
    4040
    4141INCLUDES        = \
     
    104104                xerror.h
    105105
    106 # Build the scew and b64 libraries directly into Rappture for now. 
     106# Build the scew and b64 libraries directly into Rappture for now.
    107107# Note: This works because of viewpath-ing. See the VPATH variable.
    108108B64_OBJS        = \
     
    153153                RpDXWriter.h \
    154154                RpDXWriterFInterface.h \
    155                 RpDXWriterFStubs.h 
     155                RpDXWriterFStubs.h
    156156OBJS +=         \
    157157                RpDXWriter.o \
    158                 RpDXWriterFInterface.o 
     158                RpDXWriterFInterface.o
    159159endif
    160160
     
    192192.cc.o:
    193193        $(CXX) $(CXX_SWITCHES) -c $?
    194 .c.o: 
     194.c.o:
    195195        $(CCC) $(CC_SWITCHES) -c $?
    196196
  • branches/uq/src/core/RpBindingsDict.cc

    r5679 r5850  
    2626 * function's caller.
    2727 *
    28  * Returns the key of the object in the dictionary 
     28 * Returns the key of the object in the dictionary
    2929 * On Error, returns 0 (which also means nothing can be stored at 0)
    3030 */
     
    120120 * This function stores the RpUnits names specified by 'objectName'
    121121 * into the UnitsStr dictionary. This is helpful for writing bindings
    122  * for languages that can not accept pointers to provide back to the 
     122 * for languages that can not accept pointers to provide back to the
    123123 * function's caller.
    124124 *
     
    152152 * This function retrieves the RpUnits name referenced to by 'objKey'
    153153 * from the UnitsStr dictionary. This is helpful for writing bindings
    154  * for languages that can not accept pointers to provide back to the 
     154 * for languages that can not accept pointers to provide back to the
    155155 * function's caller.
    156156 *
  • branches/uq/src/core/RpBuffer.cc

    r5679 r5850  
    3737{}
    3838
    39 
    4039/**
    4140 * Construct an empty Buffer of specified size.
     
    4847{}
    4948
    50 
    5149/**
    5250 * Construct a Buffer loaded with initial data.
     
    8987}
    9088
    91 
    9289Buffer
    9390Buffer::operator+(const Buffer& b) const
     
    9895}
    9996
    100 
    10197Buffer&
    10298Buffer::operator+=(const Buffer& b)
     
    106102}
    107103
    108 
    109104Buffer::~Buffer()
    110105{}
    111 
    112106
    113107bool
     
    142136    }   
    143137    // Read the file contents directly onto the end of the old buffer.
    144     numBytesRead = fread((char *)bytes() + oldSize, sizeof(char), 
     138    numBytesRead = fread((char *)bytes() + oldSize, sizeof(char),
    145139        stat.st_size, f);
    146140    fclose(f);
    147141    if (numBytesRead != (size_t)stat.st_size) {
    148         status.addError("can't read %ld bytes from \"%s\": %s", stat.st_size, 
     142        status.addError("can't read %ld bytes from \"%s\": %s", stat.st_size,
    149143                        path, strerror(errno));
    150144        return false;
     
    155149}
    156150
    157 
    158 bool
    159 Buffer::dump (Outcome &status, const char* path)
     151bool
     152Buffer::dump(Outcome &status, const char* path)
    160153{
    161154    status.addContext("Rappture::Buffer::dump()");
     
    179172}
    180173
    181 
    182174bool
    183175Buffer::encode(Outcome &status, unsigned int flags)
     
    218210    return true;
    219211}
    220 
    221212
    222213bool
     
    273264}
    274265
    275 
    276 bool
    277 Buffer::do_compress(Outcome& status, SimpleCharBuffer& bin,
     266bool
     267Buffer::do_compress(Outcome& status, SimpleCharBuffer& bin,
    278268                    SimpleCharBuffer& bout)
    279269{
     
    419409}
    420410
    421 
    422411bool
    423412Buffer::do_base64_enc(Outcome& status, const SimpleCharBuffer& bin,
     
    439428}
    440429
    441 
    442430bool
    443431Buffer::do_base64_dec(Outcome& status, const SimpleCharBuffer& bin,
     
    458446}
    459447
    460 
    461 }
    462 
    463 
    464 
     448}
  • branches/uq/src/core/RpBuffer.h

    r5679 r5850  
    2525};
    2626
    27 
    2827#ifdef __cplusplus
    29     extern "C" {
     28extern "C" {
    3029#endif // ifdef __cplusplus
    3130
     
    4443 */
    4544
    46 class Buffer : public SimpleCharBuffer{
     45class Buffer : public SimpleCharBuffer {
    4746public:
    4847    Buffer();
     
    7473
    7574    bool do_compress(Outcome& status, SimpleCharBuffer& bin,
    76                      SimpleCharBuffer& bout  );
    77     bool do_decompress( Outcome& status, SimpleCharBuffer& bin,
    78                         SimpleCharBuffer& bout  );
     75                     SimpleCharBuffer& bout);
     76    bool do_decompress(Outcome& status, SimpleCharBuffer& bin,
     77                       SimpleCharBuffer& bout);
    7978    bool do_base64_enc(Outcome& status, const SimpleCharBuffer& bin,
    80                        SimpleCharBuffer& bout  );
     79                       SimpleCharBuffer& bout);
    8180    bool do_base64_dec(Outcome& status, const SimpleCharBuffer& bin,
    82                        SimpleCharBuffer& bout  );
     81                       SimpleCharBuffer& bout);
    8382};
    8483
     
    8685
    8786#ifdef __cplusplus
    88     }
     87}
    8988#endif // ifdef __cplusplus
    9089
  • branches/uq/src/core/RpBufferCInterface.cc

    r5679 r5850  
    249249        flags |= RPENC_B64;
    250250    }
    251     ((Rappture::Buffer*)buf->_buf)->encode(s, flags); 
    252     RpOutcomeToCOutcome(&s,&status);
    253     return status;
    254 }
    255 
    256 RapptureOutcome
    257 RapptureBufferDecode(RapptureBuffer* buf, int decompress, int base64 )
     251    ((Rappture::Buffer*)buf->_buf)->encode(s, flags);
     252    RpOutcomeToCOutcome(&s,&status);
     253    return status;
     254}
     255
     256RapptureOutcome
     257RapptureBufferDecode(RapptureBuffer* buf, int decompress, int base64)
    258258{
    259259    Rappture::Outcome s;
     
    289289
    290290#ifdef __cplusplus
    291     }
     291}
    292292#endif // ifdef __cplusplus
  • branches/uq/src/core/RpBufferCInterface.h

    r5679 r5850  
    1 
    21/*
    32 * ----------------------------------------------------------------------
     
    1211 * ======================================================================
    1312 */
    14 
    1513
    1614#ifndef _RAPPTURE_BUFFER_C_H
     
    3937    bool (*decode)(Outcome &result, bool, bool);
    4038    */
    41 }RapptureBuffer;
     39} RapptureBuffer;
    4240
    4341int RapptureBufferInit(RapptureBuffer* buf);
     
    5351RapptureOutcome RapptureBufferDump(RapptureBuffer* buf, const char* filename);
    5452RapptureOutcome RapptureBufferEncode(RapptureBuffer* buf, int compress,
    55         int base64 );
    56 RapptureOutcome RapptureBufferDecode(RapptureBuffer* buf, 
    57         int decompress, int base64 );
     53                                     int base64);
     54RapptureOutcome RapptureBufferDecode(RapptureBuffer* buf,
     55                                     int decompress, int base64);
    5856
    5957#ifdef __cplusplus
  • branches/uq/src/core/RpDict.h

    r5679 r5850  
    2222/**************************************************************************/
    2323
    24 template <  typename KeyType,
    25             typename ValType,
    26             class _Compare=std::equal_to<KeyType> >
     24template <typename KeyType,
     25          typename ValType,
     26          class _Compare=std::equal_to<KeyType> >
    2727    class RpDict;
    2828
    29 template <  typename KeyType,
    30             typename ValType,
    31             class _Compare=std::equal_to<KeyType> >
     29template <typename KeyType,
     30          typename ValType,
     31          class _Compare=std::equal_to<KeyType> >
    3232    class RpDictEntry;
    3333
    34 template <  typename KeyType,
    35             typename ValType,
    36             class _Compare=std::equal_to<KeyType> >
     34template <typename KeyType,
     35          typename ValType,
     36          class _Compare=std::equal_to<KeyType> >
    3737    class RpDictIterator;
    38 
    3938
    4039/*
     
    4847 * because RpBindingsDict uses it.
    4948 */
    50 
    5149
    5250/**************************************************************************/
     
    9391    private:
    9492
    95         RpDict<KeyType,ValType,_Compare>& 
    96             tablePtr;                   /* pointer to the table we want to 
     93        RpDict<KeyType,ValType,_Compare>&
     94            tablePtr;                   /* pointer to the table we want to
    9795                                         * iterate */
    9896        int srchNextIndex;              /* Index of next bucket to be
    9997                                         * enumerated after present one. */
    100         RpDictEntry<KeyType,ValType,_Compare>* 
     98        RpDictEntry<KeyType,ValType,_Compare>*
    10199            srchNextEntryPtr;           /* Next entry to be enumerated in the
    102100                                         * the current bucket. */
    103101
    104102};
    105 
    106103
    107104template <typename KeyType, typename ValType, class _Compare>
     
    113110        // operator==(const RpDictEntry& entry) const;
    114111        //
    115         //operator!=(const RpDictEntry& lhs, const RpDictEntry& rhs) const 
     112        //operator!=(const RpDictEntry& lhs, const RpDictEntry& rhs) const
    116113        //{
    117114        //    if (lhs.key != rhs.key)
     
    189186};
    190187
    191 
    192188template <typename KeyType, typename ValType, class _Compare>
    193189class RpDict
     
    207203        //
    208204        /*virtual*/ RpDict<KeyType,ValType,_Compare>&
    209                         set(    KeyType& key,
    210                                 ValType& value,
    211                                 RpDictHint hint=NULL,
    212                                 int *newPtr=NULL,
    213                                 bool ci=false);
     205                        set(KeyType& key,
     206                            ValType& value,
     207                            RpDictHint hint=NULL,
     208                            int *newPtr=NULL,
     209                            bool ci=false);
    214210
    215211        // find an RpUnits object that should exist in RpUnitsTable
    216         // 
     212        //
    217213        /*virtual*/ RpDictEntry<KeyType,ValType,_Compare>&
    218                         find(   KeyType& key,
    219                                 RpDictHint hint = NULL,
    220                                 bool ci=false   );
    221 
    222         /*virtual*/ RpDictEntry<KeyType,ValType,_Compare>& operator[]( KeyType& key)
     214                        find(KeyType& key,
     215                             RpDictHint hint = NULL,
     216                             bool ci=false);
     217
     218        /*virtual*/ RpDictEntry<KeyType,ValType,_Compare>& operator[](KeyType& key)
    223219        {
    224220            return find(key,NULL);
    225221        }
    226222
    227         RpDict<KeyType,ValType,_Compare>& setCI( bool val );
     223        RpDict<KeyType,ValType,_Compare>& setCI(bool val);
    228224        bool getCI();
    229225        RpDict<KeyType,ValType,_Compare>& toggleCI();
     
    263259        }
    264260
    265         // copy constructor 
     261        // copy constructor
    266262        // RpDict (const RpDict& dict);
    267263
     
    283279        const int REBUILD_MULTIPLIER;
    284280
    285         RpDictEntry<KeyType,ValType,_Compare> 
     281        RpDictEntry<KeyType,ValType,_Compare>
    286282                    **buckets;        /* Pointer to bucket array.  Each
    287283                                       * element points to first entry in
     
    314310
    315311        RpDictEntry<KeyType,ValType,_Compare>*
    316             search( KeyType& key, RpDictHint hint = NULL, bool ci = false );
     312            search(KeyType& key, RpDictHint hint = NULL, bool ci = false);
    317313
    318314        // static void RpDict::RebuildTable ();
     
    326322};
    327323
    328 
    329324/*--------------------------------------------------------------------------*/
    330325/*--------------------------------------------------------------------------*/
     
    340335 * Side Effects:
    341336 *  none.
    342  * 
     337 *
    343338 *
    344339 *************************************************************************/
    345 
    346340template <typename KeyType, typename ValType, class _Compare>
    347341int
     
    350344    return numEntries;
    351345}
    352 
    353346
    354347/**************************************************************************
     
    359352 *
    360353 * Results:
    361  *  Returns a reference to the RpDict object allowing the user to chain 
     354 *  Returns a reference to the RpDict object allowing the user to chain
    362355 *  together different commands such as
    363356 *      rpdict_obj.set(key).find(a).erase(a);
     
    370363template <typename KeyType, typename ValType, class _Compare>
    371364RpDict<KeyType,ValType,_Compare>&
    372 RpDict<KeyType,ValType,_Compare>::set(  KeyType& key,
    373                                         ValType& value,
    374                                         RpDictHint hint,
    375                                         int* newPtr,
    376                                         bool ci )
     365RpDict<KeyType,ValType,_Compare>::set(KeyType& key,
     366                                      ValType& value,
     367                                      RpDictHint hint,
     368                                      int* newPtr,
     369                                      bool ci)
    377370{
    378371    RpDictEntry<KeyType,ValType,_Compare> *hPtr = NULL;
     
    466459 *----------------------------------------------------------------------
    467460 */
    468 
    469461template <typename KeyType, typename ValType, class _Compare>
    470462RpDictEntry<KeyType,ValType,_Compare>&
    471 RpDict<KeyType,ValType,_Compare>::find( KeyType& key,
    472                                         RpDictHint hint,
    473                                         bool ci )
     463RpDict<KeyType,ValType,_Compare>::find(KeyType& key,
     464                                       RpDictHint hint,
     465                                       bool ci)
    474466{
    475467    RpDictEntry<KeyType,ValType,_Compare> *hPtr = NULL;
     
    503495 *----------------------------------------------------------------------
    504496 */
    505 
    506497template <typename KeyType, typename ValType, class _Compare>
    507498RpDictEntry<KeyType,ValType,_Compare>*
    508 RpDict<KeyType,ValType,_Compare>::search(   KeyType& key,
    509                                             RpDictHint hint,
    510                                             bool ci )
    511                                             // bool ci,
    512                                             // RpDictEntryList* entryList)
     499RpDict<KeyType,ValType,_Compare>::search(KeyType& key,
     500                                         RpDictHint hint,
     501                                         bool ci)
     502                                         // bool ci,
     503                                         // RpDictEntryList* entryList)
    513504{
    514505    RpDictEntry<KeyType,ValType,_Compare> *hPtr = NULL;
     
    572563}
    573564
    574 
    575 
    576565/**************************************************************************
    577566 *
     
    589578/*
    590579template <typename KeyType,typename ValType,class _Compare>
    591 RpDict<KeyType,ValType,_Compare>& 
    592 RpDictIterator<KeyType,ValType,_Compare>::getTable() 
     580RpDict<KeyType,ValType,_Compare>&
     581RpDictIterator<KeyType,ValType,_Compare>::getTable()
    593582{
    594583    return tablePtr;
     
    606595 * Side Effects:
    607596 *  moves iterator to the beginning of the hash table.
    608  * 
     597 *
    609598 *
    610599 *************************************************************************/
     
    630619 * Side Effects:
    631620 *  moves iterator to the next entry of the hash table if it exists.
    632  * 
     621 *
    633622 *
    634623 *************************************************************************/
    635 
    636624template <typename KeyType,typename ValType,class _Compare>
    637625RpDictEntry<KeyType,ValType,_Compare>*
     
    669657template <typename KeyType, typename ValType, class _Compare>
    670658RpDict<KeyType,ValType,_Compare>&
    671 RpDict<KeyType,ValType,_Compare>::setCI( bool val )
     659RpDict<KeyType,ValType,_Compare>::setCI(bool val)
    672660{
    673661    caseInsensitive = val;
     
    764752    return *nullEntry;
    765753}
    766 
    767754
    768755/*
     
    784771 *----------------------------------------------------------------------
    785772 */
    786 
    787773template <typename KeyType, typename ValType, class _Compare>
    788774void
     
    794780
    795781    // check to see if the object is associated with a table
    796     // if object is not associated with a table, there is no 
     782    // if object is not associated with a table, there is no
    797783    // need to try to remove it from the table.
    798784    if (tablePtr) {
     
    804790
    805791        // remove the entry from the buckets
    806         // 
     792        //
    807793        // if entry is the first entry in the bucket
    808794        // move the bucket to point to the next entry
     
    812798        else {
    813799            // if the entry is not the first entry in the bucket
    814             // search for the entry 
     800            // search for the entry
    815801            for (prevPtr = *bucketPtr; ; prevPtr = prevPtr->nextPtr) {
    816802
     
    821807                    prevPtr->nextPtr = nextPtr;
    822808                    break;
    823                 } 
     809                }
    824810            } // end for loop
    825811        } // end else
     
    843829}
    844830
    845 
    846831/*
    847832 *----------------------------------------------------------------------
     
    859844 *----------------------------------------------------------------------
    860845 */
    861 
    862846template <typename KeyType, typename ValType, class _Compare>
    863847const KeyType*
     
    884868 *----------------------------------------------------------------------
    885869 */
    886 
    887870template <typename KeyType, typename ValType, class _Compare>
    888871const ValType*
     
    907890 *----------------------------------------------------------------------
    908891 */
    909 
    910892template <typename KeyType, typename ValType, class _Compare>
    911893const ValType*
     
    944926 *----------------------------------------------------------------------
    945927 */
    946 
    947928template <typename KeyType, typename ValType, class _Compare>
    948929bool
     
    954935    return false;
    955936}
    956 
    957937
    958938/*************************************************************************/
     
    978958 *----------------------------------------------------------------------
    979959 */
    980 
    981960template <typename KeyType, typename ValType, class _Compare>
    982961void
    983962RpDict<KeyType,ValType,_Compare>::RebuildTable()
    984963{
    985     int oldSize=0, count=0, index=0; 
     964    int oldSize=0, count=0, index=0;
    986965    RpDictEntry<KeyType,ValType,_Compare> **oldBuckets = NULL;
    987966    RpDictEntry<KeyType,ValType,_Compare> **oldChainPtr = NULL, **newChainPtr = NULL;
     
    996975     */
    997976
    998 
    999977    numBuckets *= 4;
    1000978
     
    10541032 *----------------------------------------------------------------------
    10551033 */
    1056 
    10571034template <typename KeyType, typename ValType, class _Compare>
    10581035unsigned int
     
    10821059 * I chose the one below (multiply by 9 and add new character)
    10831060 * because of the following reasons:
    1084  * 
     1061 *
    10851062 * 1. Multiplying by 10 is perfect for keys that are decimal strings,
    10861063 *    and multiplying by 9 is just about as good.
     
    10911068 *    works well both for decimal and non-decimal strings.
    10921069 */
    1093 
    1094 
    10951070template <typename KeyType, typename ValType, class _Compare>
    10961071unsigned int
     
    11581133 * ---------------------------------------------------------------------
    11591134 */
    1160 
    11611135template <typename KeyType, typename ValType, class _Compare>
    11621136int
     
    11661140}
    11671141
    1168 
    1169 
    11701142#endif
  • branches/uq/src/core/b64/cdecode.h

    r5679 r5850  
    2424int base64_decode_value(char value_in);
    2525
    26 int base64_decode_block(const char* code_in, const int length_in, 
     26int base64_decode_block(const char* code_in, const int length_in,
    2727        char* plaintext_out, base64_decodestate* state_in);
    2828
  • branches/uq/src/core/b64/decode.h

    r5679 r5850  
    2222    base64_decodestate _state;
    2323    int _buffersize;
    24    
     24
    2525    decoder(int buffersize_in = 4096)
    2626        : _buffersize(buffersize_in)
  • branches/uq/src/core/b64/encode.h

    r5679 r5850  
    1515{
    1616       
    17         extern "C" 
     17        extern "C"
    1818        {
    1919                #include "cencode.h"
  • branches/uq/src/core/rappture_fortran.c

    r5679 r5850  
    100100#   define rp_lib_element_id       RP_LIB_ELEMENT_ID
    101101#   define rp_lib_element_type     RP_LIB_ELEMENT_TYPE
    102 #   define rp_lib_element_str      RP_LIB_ELEMENT_STR 
     102#   define rp_lib_element_str      RP_LIB_ELEMENT_STR
    103103#   define rp_lib_element_obj      RP_LIB_ELEMENT_OBJ
    104104#   define rp_lib_child_num        RP_LIB_CHILD_NUM
     
    130130
    131131extern "C"
    132 void rp_lib_element_comp( int* handle,
    133                             char* path,
    134                             char* retText,
    135                             int path_len,
    136                             int retText_len );
    137 
    138 extern "C"
    139 void rp_lib_element_id(   int* handle,
    140                             char* path,
    141                             char* retText,
    142                             int path_len,
    143                             int retText_len );
    144 
    145 extern "C"
    146 void rp_lib_element_type( int* handle,
    147                             char* path,
    148                             char* retText,
    149                             int path_len,
    150                             int retText_len );
    151 
    152 extern "C"
    153 void rp_lib_element_str(  int* handle,
    154                             char* path,
    155                             char* flavor,
    156                             char* retText,
    157                             int path_len,
    158                             int flavor_len,
    159                             int retText_len );
    160 
    161 extern "C"
    162 int rp_lib_element_obj(   int* handle,
    163                             char* path,
    164                             int path_len );
    165 
    166 extern "C"
    167 int rp_lib_child_num(    int* handle,
    168                             char* path,
    169                             int path_len);
    170 
    171 extern "C"
    172 int rp_lib_child_comp(   int* handle,    /* integer handle of library */
    173                             char* path,     /* DOM path of requested object */
    174                             char* type,     /* specific name of element */
    175                             int* childNum,  /* child number for iteration */
    176                             char* retText,  /* buffer to store return text */
    177                             int path_len,   /* length of path */
    178                             int type_len,   /* length of type */
    179                             int retText_len /* length of return text buffer */
    180                        );
    181 
    182 extern "C"
    183 int rp_lib_child_id(     int* handle,    /* integer handle of library */
    184                             char* path,     /* DOM path of requested object */
    185                             char* type,     /* specific name of element */
    186                             int* childNum,  /* child number for iteration */
    187                             char* retText,  /* buffer to store return text */
    188                             int path_len,   /* length of path */
    189                             int type_len,   /* length of type */
    190                             int retText_len /* length of return text buffer */
    191                        );
    192 
    193 extern "C"
    194 int rp_lib_child_type(   int* handle,    /* integer handle of library */
    195                             char* path,     /* DOM path of requested object */
    196                             char* type,     /* specific name of element */
    197                             int* childNum,  /* child number for iteration */
    198                             char* retText,  /* buffer to store return text */
    199                             int path_len,   /* length of path */
    200                             int type_len,   /* length of type */
    201                             int retText_len /* length of return text buffer */
    202                        );
    203 
    204 extern "C"
    205 int rp_lib_child_str(    int* handle,    /* integer handle of library */
    206                             char* path,     /* DOM path of requested object */
    207                             char* flavor,   /* information you want returned*/
    208                             char* type,     /* specific name of element */
    209                             int* childNum,  /* child number for iteration */
    210                             char* retText,  /* buffer to store return text */
    211                             int path_len,   /* length of path */
    212                             int flavor_len, /* length of flavor */
    213                             int type_len,   /* length of type */
    214                             int retText_len /* length of return text buffer */
    215                        );
    216 
    217 extern "C"
    218 int rp_lib_child_obj(    int* handle,
    219                             char* path,
    220                             char* type,
    221                             int path_len,
    222                             int type_len
    223                           );
    224 
    225 extern "C"
    226 void rp_lib_get(          int* handle,
    227                             char* path,
    228                             char* retText,
    229                             int path_len,
    230                             int retText_len );
    231 
    232 extern "C"
    233 double rp_lib_get_double( int* handle,
    234                             char* path,
    235                             int path_len);
    236 
    237 extern "C"
    238 void rp_lib_put_str(     int* handle,
    239                             char* path,
    240                             char* value,
    241                             int* append,
    242                             int path_len,
    243                             int value_len );
    244 
    245 extern "C"
    246 void rp_lib_put_id_str(  int* handle,
    247                             char* path,
    248                             char* value,
    249                             char* id,
    250                             int* append,
    251                             int path_len,
    252                             int value_len,
    253                             int id_len );
    254 
    255 extern "C"
    256 void rp_lib_put_obj(     int* handle,
    257                             char* path,
    258                             int* valHandle,
    259                             int* append,
    260                             int path_len );
    261 
    262 extern "C"
    263 void rp_lib_put_id_obj(  int* handle,
    264                             char* path,
    265                             int* valHandle,
    266                             char* id,
    267                             int* append,
    268                             int path_len,
    269                             int id_len );
    270 
    271 extern "C"
    272 int rp_lib_remove(       int* handle,
    273                             char* path,
    274                             int path_len);
    275 
    276 extern "C"
    277 int rp_lib_xml_len(      int* handle);
    278 
    279 extern "C"
    280 void rp_lib_xml(         int* handle,
    281                             char* retText,
    282                             int retText_len);
    283 
    284 extern "C"
    285 int rp_lib_write_xml(     int* handle,
    286                             char* outFile,
    287                             int outFile_len);
     132void rp_lib_element_comp(int* handle,
     133                         char* path,
     134                         char* retText,
     135                         int path_len,
     136                         int retText_len);
     137
     138extern "C"
     139void rp_lib_element_id(int* handle,
     140                       char* path,
     141                       char* retText,
     142                       int path_len,
     143                       int retText_len);
     144
     145extern "C"
     146void rp_lib_element_type(int* handle,
     147                         char* path,
     148                         char* retText,
     149                         int path_len,
     150                         int retText_len);
     151
     152extern "C"
     153void rp_lib_element_str(int* handle,
     154                        char* path,
     155                        char* flavor,
     156                        char* retText,
     157                        int path_len,
     158                        int flavor_len,
     159                        int retText_len);
     160
     161extern "C"
     162int rp_lib_element_obj(int* handle,
     163                       char* path,
     164                       int path_len);
     165
     166extern "C"
     167int rp_lib_child_num(int* handle,
     168                     char* path,
     169                     int path_len);
     170
     171extern "C"
     172int rp_lib_child_comp(int* handle,    /* integer handle of library */
     173                      char* path,     /* DOM path of requested object */
     174                      char* type,     /* specific name of element */
     175                      int* childNum,  /* child number for iteration */
     176                      char* retText,  /* buffer to store return text */
     177                      int path_len,   /* length of path */
     178                      int type_len,   /* length of type */
     179                      int retText_len /* length of return text buffer */
     180                      );
     181
     182extern "C"
     183int rp_lib_child_id(int* handle,    /* integer handle of library */
     184                    char* path,     /* DOM path of requested object */
     185                    char* type,     /* specific name of element */
     186                    int* childNum,  /* child number for iteration */
     187                    char* retText,  /* buffer to store return text */
     188                    int path_len,   /* length of path */
     189                    int type_len,   /* length of type */
     190                    int retText_len /* length of return text buffer */
     191                    );
     192
     193extern "C"
     194int rp_lib_child_type(int* handle,    /* integer handle of library */
     195                      char* path,     /* DOM path of requested object */
     196                      char* type,     /* specific name of element */
     197                      int* childNum,  /* child number for iteration */
     198                      char* retText,  /* buffer to store return text */
     199                      int path_len,   /* length of path */
     200                      int type_len,   /* length of type */
     201                      int retText_len /* length of return text buffer */
     202                      );
     203
     204extern "C"
     205int rp_lib_child_str(int* handle,    /* integer handle of library */
     206                     char* path,     /* DOM path of requested object */
     207                     char* flavor,   /* information you want returned*/
     208                     char* type,     /* specific name of element */
     209                     int* childNum,  /* child number for iteration */
     210                     char* retText,  /* buffer to store return text */
     211                     int path_len,   /* length of path */
     212                     int flavor_len, /* length of flavor */
     213                     int type_len,   /* length of type */
     214                     int retText_len /* length of return text buffer */
     215                     );
     216
     217extern "C"
     218int rp_lib_child_obj(int* handle,
     219                     char* path,
     220                     char* type,
     221                     int path_len,
     222                     int type_len);
     223
     224extern "C"
     225void rp_lib_get(int* handle,
     226                char* path,
     227                char* retText,
     228                int path_len,
     229                int retText_len);
     230
     231extern "C"
     232double rp_lib_get_double(int* handle,
     233                         char* path,
     234                         int path_len);
     235
     236extern "C"
     237void rp_lib_put_str(int* handle,
     238                    char* path,
     239                    char* value,
     240                    int* append,
     241                    int path_len,
     242                    int value_len);
     243
     244extern "C"
     245void rp_lib_put_id_str(int* handle,
     246                       char* path,
     247                       char* value,
     248                       char* id,
     249                       int* append,
     250                       int path_len,
     251                       int value_len,
     252                       int id_len);
     253
     254extern "C"
     255void rp_lib_put_obj(int* handle,
     256                    char* path,
     257                    int* valHandle,
     258                    int* append,
     259                    int path_len);
     260
     261extern "C"
     262void rp_lib_put_id_obj(int* handle,
     263                       char* path,
     264                       int* valHandle,
     265                       char* id,
     266                       int* append,
     267                       int path_len,
     268                       int id_len);
     269
     270extern "C"
     271int rp_lib_remove(int* handle,
     272                  char* path,
     273                  int path_len);
     274
     275extern "C"
     276int rp_lib_xml_len(int* handle);
     277
     278extern "C"
     279void rp_lib_xml(int* handle,
     280                char* retText,
     281                int retText_len);
     282
     283extern "C"
     284int rp_lib_write_xml(int* handle,
     285                     char* outFile,
     286                     int outFile_len);
     287
    288288extern "C"
    289289void rp_quit();
     
    306306
    307307// global vars
    308 // dictionary to hold the python objects that 
     308// dictionary to hold the python objects that
    309309// cannot be sent to fortran
    310310
     
    313313int rapptureStarted = 0;
    314314
    315 void rp_init() {
     315void rp_init()
     316{
    316317    //
    317318    PyObject* rpClass = NULL;
    318319    int retVal = 0;
    319    
     320
    320321    // initialize the interpreter
    321322    Py_Initialize();
     
    329330}
    330331
    331 int rp_lib(const char* filePath, int filePath_len) 
     332int rp_lib(const char* filePath, int filePath_len)
    332333{
    333334    PyObject* lib = NULL;
     
    341342
    342343    inFilePath = null_terminate((char*)filePath, filePath_len);
    343    
     344
    344345    // error checking to make sure inText is valid???
    345    
     346
    346347    // grab the rappture class from the dictionary
    347348    rpClass = getObject(0);
     
    367368
    368369int rp_lib_element_obj(int* handle,     /* integer handle of library */
    369                           char* path,     /* null terminated path */
    370                           int path_len
    371                         )
     370                       char* path,     /* null terminated path */
     371                       int path_len)
    372372{
    373373    int newObjHandle = -1;
     
    388388            if (lib) {
    389389                retObj = (PyObject*) rpElement(lib, inPath, flavor);
    390                
     390
    391391                if (retObj) {
    392392
     
    406406}
    407407
    408 void rp_lib_element_comp( int* handle, /* integer handle of library */
    409                             char* path,      /* null terminated path */
    410                             char* retText,   /* return buffer for fortran*/
    411                             int path_len,
    412                             int retText_len /* length of return text buffer */
    413                           )
     408void rp_lib_element_comp(int* handle, /* integer handle of library */
     409                         char* path,      /* null terminated path */
     410                         char* retText,   /* return buffer for fortran*/
     411                         int path_len,
     412                         int retText_len /* length of return text buffer */
     413                         )
    414414{
    415415    char* inPath = NULL;
     
    426426
    427427    rp_lib_element_str(handle,inPath,"component",retText,path_len,10,retText_len);
    428    
    429     if (inPath) {
    430         free(inPath);
    431         inPath = NULL;
    432     }
    433 
    434 }
    435 
    436 void rp_lib_element_id(   int* handle, /* integer handle of library */
    437                             char* path,      /* null terminated path */
    438                             char* retText,   /* return buffer for fortran*/
    439                             int path_len,
    440                             int retText_len /* length of return text buffer */
    441                         )
     428
     429    if (inPath) {
     430        free(inPath);
     431        inPath = NULL;
     432    }
     433
     434}
     435
     436void rp_lib_element_id(int* handle, /* integer handle of library */
     437                       char* path,      /* null terminated path */
     438                       char* retText,   /* return buffer for fortran*/
     439                       int path_len,
     440                       int retText_len /* length of return text buffer */
     441                       )
    442442{
    443443    char* inPath = NULL;
     
    459459}
    460460
    461 void rp_lib_element_type( int* handle, /* integer handle of library */
    462                             char* path,      /* null terminated path */
    463                             char* retText,   /* return buffer for fortran*/
    464                             int path_len,
    465                             int retText_len /* length of return text buffer */
    466                           )
     461void rp_lib_element_type(int* handle, /* integer handle of library */
     462                         char* path,      /* null terminated path */
     463                         char* retText,   /* return buffer for fortran*/
     464                         int path_len,
     465                         int retText_len /* length of return text buffer */
     466                         )
    467467{
    468468    char* inPath = NULL;
     
    483483}
    484484
    485 void rp_lib_element_str(  int* handle, /* integer handle of library */
    486                             char* path,      /* null terminated path */
    487                             char* flavor,    /* null terminated flavor */
    488                             char* retText,   /* return buffer for fortran*/
    489                             int path_len,
    490                             int flavor_len,
    491                             int retText_len /* length of return text buffer */
     485void rp_lib_element_str(int* handle, /* integer handle of library */
     486                        char* path,      /* null terminated path */
     487                        char* flavor,    /* null terminated flavor */
     488                        char* retText,   /* return buffer for fortran*/
     489                        int path_len,
     490                        int flavor_len,
     491                        int retText_len /* length of return text buffer */
    492492                        )
    493493{
     
    498498
    499499    PyObject* lib = NULL;
    500    
     500
    501501    char* retObj = NULL;
    502    
     502
    503503    char* inPath = NULL;
    504504    char* inFlavor = NULL;
     
    517517                    if (retObj) {
    518518                        xmlText = retObj;
    519                    
     519
    520520                        fortranify(xmlText, retText, retText_len);
    521            
     521
    522522                        /*
    523523                        length_in = strlen(xmlText);
     
    534534                        *(retText+length_out-1) = ' ';
    535535                        */
    536                        
     536
    537537                        free(retObj);
    538538                        retObj = NULL;
    539539                    }
    540540                    else {
    541                        
     541
    542542                    }
    543543                }
     
    546546        }
    547547    }
    548    
     548
    549549    if (inPath) {
    550550        free(inPath);
     
    559559}
    560560
    561 int rp_lib_child_num( int* handle,
    562                          char* path,
    563                          int path_len
    564                        )
     561int rp_lib_child_num(int* handle,
     562                     char* path,
     563                     int path_len)
    565564{
    566565    int numChildren = 0;
     
    571570
    572571    inPath = null_terminate(path,path_len);
    573    
     572
    574573    if (rapptureStarted) {
    575574        if ((handle) && (*handle != 0)) {
     
    583582                }
    584583                else {
    585                    
     584
    586585                }
    587586            }
     
    599598
    600599
    601 int rp_lib_child_comp (   int* handle,    /* integer handle of library */
    602                             char* path,     /* DOM path of requested object */
    603                             char* type,     /* specific name of element */
    604                             int* childNum,  /* child number for iteration */
    605                             char* retText,  /* buffer to store return text */
    606                             int path_len,   /* length of path */
    607                             int type_len,   /* length of type */
    608                             int retText_len /* length of return text buffer */
    609                        )
     600int rp_lib_child_comp(int* handle,    /* integer handle of library */
     601                      char* path,     /* DOM path of requested object */
     602                      char* type,     /* specific name of element */
     603                      int* childNum,  /* child number for iteration */
     604                      char* retText,  /* buffer to store return text */
     605                      int path_len,   /* length of path */
     606                      int type_len,   /* length of type */
     607                      int retText_len /* length of return text buffer */
     608                      )
    610609{
    611610    int retVal = 0;
     
    631630    }
    632631
    633     retVal = rp_lib_child_str( handle,
    634                                  inPath,
    635                                  "component",
    636                                  inType,
    637                                  childNum,
    638                                  retText,
    639                                  path_len,
    640                                  10,
    641                                  type_len,
    642                                  retText_len
    643                                );
     632    retVal = rp_lib_child_str(handle,
     633                              inPath,
     634                              "component",
     635                              inType,
     636                              childNum,
     637                              retText,
     638                              path_len,
     639                              10,
     640                              type_len,
     641                              retText_len);
    644642
    645643    if (inPath) {
     
    656654}
    657655
    658 int rp_lib_child_id(   int* handle,    /* integer handle of library */
    659                           char* path,     /* DOM path of requested object */
    660                           char* type,     /* specific name of element */
    661                           int* childNum,  /* child number for iteration */
    662                           char* retText,  /* buffer to store return text */
    663                           int path_len,   /* length of path */
    664                           int type_len,   /* length of type */
    665                           int retText_len /* length of return text buffer */
    666                        )
     656int rp_lib_child_id(int* handle,    /* integer handle of library */
     657                    char* path,     /* DOM path of requested object */
     658                    char* type,     /* specific name of element */
     659                    int* childNum,  /* child number for iteration */
     660                    char* retText,  /* buffer to store return text */
     661                    int path_len,   /* length of path */
     662                    int type_len,   /* length of type */
     663                    int retText_len /* length of return text buffer */
     664                    )
    667665{
    668666    int retVal = 0;
     
    687685    }
    688686
    689     retVal = rp_lib_child_str( handle,
    690                                  inPath,
    691                                  "id",
    692                                  inType,
    693                                  childNum,
    694                                  retText,
    695                                  path_len,
    696                                  3,
    697                                  type_len,
    698                                  retText_len
    699                                );
     687    retVal = rp_lib_child_str(handle,
     688                              inPath,
     689                              "id",
     690                              inType,
     691                              childNum,
     692                              retText,
     693                              path_len,
     694                              3,
     695                              type_len,
     696                              retText_len);
    700697
    701698    if (inPath) {
     
    712709}
    713710
    714 int rp_lib_child_type (   int* handle,    /* integer handle of library */
    715                             char* path,     /* DOM path of requested object */
    716                             char* type,     /* specific name of element */
    717                             int* childNum,  /* child number for iteration */
    718                             char* retText,  /* buffer to store return text */
    719                             int path_len,   /* length of path */
    720                             int type_len,   /* length of type */
    721                             int retText_len /* length of return text buffer */
    722                        )
     711int rp_lib_child_type(int* handle,    /* integer handle of library */
     712                      char* path,     /* DOM path of requested object */
     713                      char* type,     /* specific name of element */
     714                      int* childNum,  /* child number for iteration */
     715                      char* retText,  /* buffer to store return text */
     716                      int path_len,   /* length of path */
     717                      int type_len,   /* length of type */
     718                      int retText_len /* length of return text buffer */
     719                      )
    723720{
    724721    int retVal = 0;
     
    743740    }
    744741
    745     retVal = rp_lib_child_str( handle,
    746                                  inPath,
    747                                  "type",
    748                                  inType,
    749                                  childNum,
    750                                  retText,
    751                                  path_len,
    752                                  5,
    753                                  type_len,
    754                                  retText_len
    755                                );
     742    retVal = rp_lib_child_str(handle,
     743                              inPath,
     744                              "type",
     745                              inType,
     746                              childNum,
     747                              retText,
     748                              path_len,
     749                              5,
     750                              type_len,
     751                              retText_len);
    756752
    757753    if (inPath) {
     
    768764}
    769765
    770 int rp_lib_child_str (    int* handle,    /* integer handle of library */
    771                             char* path,     /* DOM path of requested object */
    772                             char* flavor,   /* information you want returned*/
    773                             char* type,     /* specific name of element */
    774                             int* childNum,  /* child number for iteration */
    775                             char* retText,  /* buffer to store return text */
    776                             int path_len,   /* length of path */
    777                             int flavor_len, /* length of flavor */
    778                             int type_len,   /* length of type */
    779                             int retText_len /* length of return text buffer */
    780                        )
     766int rp_lib_child_str(int* handle,    /* integer handle of library */
     767                     char* path,     /* DOM path of requested object */
     768                     char* flavor,   /* information you want returned*/
     769                     char* type,     /* specific name of element */
     770                     int* childNum,  /* child number for iteration */
     771                     char* retText,  /* buffer to store return text */
     772                     int path_len,   /* length of path */
     773                     int flavor_len, /* length of flavor */
     774                     int type_len,   /* length of type */
     775                     int retText_len /* length of return text buffer */
     776                     )
    781777{
    782778    int retVal = 0;
     
    787783    PyObject* list = NULL;
    788784    PyObject* list_item = NULL;
    789    
     785
    790786    char* xmlChild = NULL;
    791787    char* inPath = NULL;
    792788    char* inType = NULL;
    793789    char* inFlavor = NULL;
    794    
     790
    795791    inPath = null_terminate(path,path_len);
    796792    inFlavor = null_terminate(flavor,flavor_len);
     
    801797            lib = getObject(*handle);
    802798            if (lib) {
    803                 if(objType(inFlavor) == 1) {
     799                if (objType(inFlavor) == 1) {
    804800
    805801                    list = rpChildren_f(lib, inPath, inFlavor);
     
    832828                        }
    833829                    }
    834                     else {
    835                        
    836                     }
    837830                }
    838831            }
     
    855848    }
    856849
    857 
    858850    return retVal;
    859851}
    860852
    861  int rp_lib_child_obj ( int* handle,
    862                             char* path,
    863                             char* type,
    864                             int path_len,
    865                             int type_len
    866                           )
     853int rp_lib_child_obj(int* handle,
     854                     char* path,
     855                     char* type,
     856                     int path_len,
     857                     int type_len)
    867858{
    868859    int newObjHandle = -1;
     
    870861    PyObject* lib = NULL;
    871862    PyObject* list = NULL;
    872    
     863
    873864    char* inPath = NULL;
    874865    char* inType = NULL;
     
    880871        if ((handle) && (*handle != 0)) {
    881872            lib = getObject(*handle);
    882            
     873
    883874            if (lib) {
    884875                list = rpChildren_f(lib, inPath, "object");
     
    889880                    // Py_DECREF(list);
    890881                }
    891                 else {
    892                    
    893                 }
    894882            }
    895883        }
     
    907895
    908896    return newObjHandle;
    909 
    910 }
    911 
    912 
    913 void rp_lib_get( int* handle, /* integer handle of library */
    914                    char* path,      /* null terminated path */
    915                    char* retText,   /* return text buffer for fortran*/
    916                    int path_len,
    917                    int retText_len /* length of return text buffer */
    918                  )
     897}
     898
     899
     900void rp_lib_get(int* handle, /* integer handle of library */
     901                char* path,      /* null terminated path */
     902                char* retText,   /* return text buffer for fortran*/
     903                int path_len,
     904                int retText_len /* length of return text buffer */
     905                )
    919906{
    920907    // int length_in = 0;
     
    924911
    925912    PyObject* lib = NULL;
    926    
     913
    927914    char* inPath = NULL;
    928915
     
    932919        if ((handle) && (*handle != 0)) {
    933920            lib = getObject(*handle);
    934            
     921
    935922            if (lib) {
    936                 // retObj is a borrowed object 
     923                // retObj is a borrowed object
    937924                // whose contents must not be modified
    938925                xmlText = rpGet(lib, inPath);
    939                
     926
    940927                if (xmlText) {
    941928
    942929                    fortranify(xmlText, retText, retText_len);
    943                    
     930
    944931                    /*
    945932                    length_in = strlen(xmlText);
     
    957944                    */
    958945                }
    959 
    960946            }
    961947        }
     
    966952        inPath = NULL;
    967953    }
    968 
    969 }
    970 
    971 double rp_lib_get_double( int* handle,   /* integer handle of library */
    972                             char* path,    /* null terminated path */
    973                             int path_len
    974                           )
     954}
     955
     956double rp_lib_get_double(int* handle,   /* integer handle of library */
     957                         char* path,    /* null terminated path */
     958                         int path_len)
    975959{
    976960    double retVal = 0.0;
     
    978962
    979963    PyObject* lib = NULL;
    980    
     964
    981965    char* inPath = NULL;
    982966
     
    988972        if ((handle) && (*handle != 0)) {
    989973            lib = getObject(*handle);
    990            
     974
    991975            if (lib) {
    992                 // retObj is a borrowed object 
     976                // retObj is a borrowed object
    993977                // whose contents must not be modified
    994978                xmlText = rpGet(lib, inPath);
    995                
     979
    996980                if (xmlText) {
    997981                    retVal = atof(xmlText);
    998982                }
    999 
    1000983            }
    1001984        }
     
    1011994
    1012995
    1013 void rp_lib_put_str( int* handle,
    1014                         char* path,
    1015                         char* value,
    1016                         int* append,
    1017                         int path_len,
    1018                         int value_len
    1019                       )
     996void rp_lib_put_str(int* handle,
     997                    char* path,
     998                    char* value,
     999                    int* append,
     1000                    int path_len,
     1001                    int value_len)
    10201002{
    10211003    char* inPath = NULL;
     
    10241006    inPath = null_terminate(path,path_len);
    10251007    inValue = null_terminate(value,value_len);
    1026 
    10271008
    10281009    if (inPath) {
     
    10541035
    10551036
    1056 void rp_lib_put_id_str ( int* handle,
    1057                         char* path,
    1058                         char* value,
    1059                         char* id,
    1060                         int* append,
    1061                         int path_len,
    1062                         int value_len,
    1063                         int id_len
    1064                       )
    1065 {
    1066     PyObject* lib = NULL;
    1067    
     1037void rp_lib_put_id_str(int* handle,
     1038                       char* path,
     1039                       char* value,
     1040                       char* id,
     1041                       int* append,
     1042                       int path_len,
     1043                       int value_len,
     1044                       int id_len)
     1045{
     1046    PyObject* lib = NULL;
     1047
    10681048    char* inPath = NULL;
    10691049    char* inValue = NULL;
     
    10771057        if ((handle) && (*handle != 0)) {
    10781058            lib = getObject(*handle);
    1079            
     1059
    10801060            if (lib) {
    10811061                rpPut(lib, inPath, inValue, inId, *append);
     
    10981078        inId = NULL;
    10991079    }
    1100 
    1101 }
    1102 
    1103 void rp_lib_put_obj( int* handle,
    1104                         char* path,
    1105                         int* valHandle,
    1106                         int* append,
    1107                         int path_len
    1108                       )
     1080}
     1081
     1082void rp_lib_put_obj(int* handle,
     1083                    char* path,
     1084                    int* valHandle,
     1085                    int* append,
     1086                    int path_len)
    11091087{
    11101088    char* inPath = NULL;
     
    11251103}
    11261104
    1127 void rp_lib_put_id_obj ( int* handle,
    1128                         char* path,
    1129                         int* valHandle,
    1130                         char* id,
    1131                         int* append,
    1132                         int path_len,
    1133                         int id_len
    1134                       )
     1105void rp_lib_put_id_obj(int* handle,
     1106                       char* path,
     1107                       int* valHandle,
     1108                       char* id,
     1109                       int* append,
     1110                       int path_len,
     1111                       int id_len)
    11351112{
    11361113    PyObject* lib = NULL;
    11371114    PyObject* value = NULL;
    1138    
     1115
    11391116    char* inPath = NULL;
    11401117    char* inId = NULL;
     
    11471124            lib = getObject(*handle);
    11481125            value = getObject(*valHandle);
    1149            
     1126
    11501127            if (lib && value) {
    1151                 // retObj is a borrowed object 
     1128                // retObj is a borrowed object
    11521129                // whose contents must not be modified
    11531130                rpPutObj(lib, inPath, value, inId, *append);
     
    11651142        inId = NULL;
    11661143    }
    1167 
    1168 }
    1169 
    1170 int rp_lib_remove (int* handle, char* path, int path_len)
     1144}
     1145
     1146int rp_lib_remove(int* handle, char* path, int path_len)
    11711147{
    11721148    int newObjHandle = -1;
     
    11741150    PyObject* lib = NULL;
    11751151    PyObject* removedObj = NULL;
    1176    
     1152
    11771153    char* inPath = NULL;
    11781154
     
    11851161            if (lib) {
    11861162                removedObj = rpRemove(lib, inPath);
    1187                
     1163
    11881164                if (removedObj) {
    11891165                    newObjHandle = storeObject(removedObj);
    11901166                    // Py_DECREF(removedObj);
    11911167                }
    1192 
    11931168            }
    11941169        }
    11951170    }
    1196    
     1171
    11971172    if (inPath) {
    11981173        free(inPath);
     
    12031178}
    12041179
    1205 int rp_lib_xml_len (int* handle)
     1180int rp_lib_xml_len(int* handle)
    12061181{
    12071182    int length = -1;
     
    12291204}
    12301205
    1231 void  rp_lib_xml(int* handle, char* retText, int retText_len)
     1206void rp_lib_xml(int* handle, char* retText, int retText_len)
    12321207{
    12331208    // int length_in = 0;
     
    12371212
    12381213    PyObject* lib = NULL;
    1239    
     1214
    12401215    if (rapptureStarted) {
    12411216        if ((handle) && (*handle != 0)) {
     
    12441219            if (lib) {
    12451220                xmlText = rpXml(lib);
    1246                
     1221
    12471222                if (xmlText) {
    12481223
     
    12661241                    free(xmlText);
    12671242                }
    1268                
    12691243            }
    12701244        }
     
    13211295
    13221296    RpDictEntry DICT_TEMPLATE *hPtr;
    1323     // RpDictIterator DICT_TEMPLATE iter((RpDict&)*this);                     
     1297    // RpDictIterator DICT_TEMPLATE iter((RpDict&)*this);
    13241298    RpDictIterator DICT_TEMPLATE iter(fortObjDict);
    1325    
    1326     hPtr = iter.first();                                                     
    1327    
     1299
     1300    hPtr = iter.first();
     1301
    13281302    while (hPtr) {
    13291303        Py_DECREF(*(hPtr->getValue()));
    13301304        hPtr->erase();
    1331         hPtr = iter.next();                                                   
     1305        hPtr = iter.next();
    13321306    }
    13331307
     
    13411315}
    13421316
    1343 void rp_result(int* handle) {
     1317void rp_result(int* handle)
     1318{
    13441319    PyObject* lib = NULL;
    13451320
     
    13531328}
    13541329
    1355 int objType( char* flavor) 
     1330int objType( char* flavor)
    13561331{
    13571332    if (flavor == NULL) {
     
    13591334        return 0;
    13601335    }
    1361     else if((*flavor == 'o')&&(strncmp(flavor,"object", 6)==0)){
     1336    else if ((*flavor == 'o') && (strncmp(flavor,"object", 6) == 0)) {
    13621337        // return a PyObject*
    13631338        return 0;
    13641339    }
    1365     else if (
    1366       ((*flavor == 't')&&(strncmp(flavor,"type", 4) == 0))
    1367     ||((*flavor == 'i')&&(strncmp(flavor,"id", 2) == 0))
    1368     ||((*flavor == 'c')&&(strncmp(flavor,"component", 9) == 0)))
     1340    else if (((*flavor == 't') && (strncmp(flavor,"type", 4) == 0)) ||
     1341             ((*flavor == 'i') && (strncmp(flavor,"id", 2) == 0)) ||
     1342             ((*flavor == 'c') && (strncmp(flavor,"component", 9) == 0)))
    13691343    {
    13701344        // return a char*
     
    13781352}
    13791353
    1380 int storeObject(PyObject* objectName) {
    1381 
     1354int storeObject(PyObject* objectName)
     1355{
    13821356    int retVal = -1;
    13831357    int dictKey = fortObjDict.size();
     
    13881362        // no error checking to make sure it was successful in entering
    13891363        // the new entry.
    1390         fortObjDict.set(dictKey,objectName, &newEntry); 
    1391     }
    1392    
     1364        fortObjDict.set(dictKey,objectName, &newEntry);
     1365    }
     1366
    13931367    retVal = dictKey;
    13941368    return retVal;
    13951369}
    13961370
    1397 PyObject* getObject(int objKey) {
    1398 
     1371PyObject* getObject(int objKey)
     1372{
    13991373    PyObject* retVal = *(fortObjDict.find(objKey).getValue());
    14001374
     
    14041378
    14051379   return retVal;
    1406 
    1407 }
     1380}
  • branches/uq/src/core/scew_extras.c

    r5679 r5850  
    119119}
    120120
    121 
    122121XML_Char const*
    123 scew_element_set_contents_binary(   scew_element* element,
    124                                     XML_Char const* bytes,
    125                                     unsigned int* nbytes    )
     122scew_element_set_contents_binary(scew_element* element,
     123                                 XML_Char const* bytes,
     124                                 unsigned int* nbytes)
    126125{
    127126    XML_Char* out = NULL;
Note: See TracChangeset for help on using the changeset viewer.