Changeset 2762 for trunk


Ignore:
Timestamp:
Jan 12, 2012, 3:45:04 PM (13 years ago)
Author:
gah
Message:

fix for right-click in streamlines viewer, about command now uses path to find rappture.

Location:
trunk/gui
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/apps/about.in

    r2415 r2762  
    2020# ======================================================================
    2121#\
    22 . rappture.env \
     22dir=`dirname $0` \
     23. $dir/rappture.env \
    2324exec wish "$0" $*
    2425# ----------------------------------------------------------------------
  • trunk/gui/scripts/barchartresult.tcl

    r2566 r2762  
    912912    set tip ""
    913913    if {$state == "at"} {
     914        set state 0
    914915        if {[$g element closest $x $y info -interpolate yes]} {
    915916            # for dealing with xy line plots
    916917            set elem $info(name)
    917 
     918           
    918919            # Some elements are generated dynamically and therefore will
    919920            # not have a dataobj associated with them.
     
    923924                foreach {mapx mapy} [_getAxes $_elem2dataobj($elem)] break
    924925            }
    925 
     926           
    926927            # search again for an exact point -- this time don't interpolate
    927928            set tip ""
    928929            array unset info
    929930            if {[$g element closest $x $y info -interpolate no]
    930                   && $info(name) == $elem} {
    931 
     931                && $info(name) == $elem} {
     932               
    932933                set x [$g axis transform $mapx $info(x)]
    933934                set y [$g axis transform $mapy $info(y)]
     
    952953            # for dealing with xy scatter plot
    953954            set elem $info(name)
    954 
     955           
    955956            # Some elements are generated dynamically and therefore will
    956957            # not have a dataobj associated with them.
     
    960961                foreach {mapx mapy} [_getAxes $_elem2dataobj($elem)] break
    961962            }
    962 
     963           
    963964            set tip ""
    964965            set x [$g axis transform $mapx $info(x)]
    965966            set y [$g axis transform $mapy $info(y)]
    966                
    967                 if {[info exists _elem2dataobj($elem)]} {
    968                     set dataobj $_elem2dataobj($elem)
    969                     set yunits [$dataobj hints yunits]
    970                     set xunits [$dataobj hints xunits]
    971                 } else {
    972                     set xunits ""
    973                     set yunits ""
    974                 }
    975                 set tip [$g element cget $elem -label]
    976                 set yval [_axis format y dummy $info(y)]
    977                 append tip "\n$yval$yunits"
    978                 set xval [_axis format x dummy $info(x)]
    979                 append tip " @ $xval$xunits"
    980                 set tip [string trim $tip]
    981                 set state 1
    982             } else {
    983                 set state 0
    984             }
    985         }
    986     }
    987 
    988     if {$state} {
     967           
     968            if {[info exists _elem2dataobj($elem)]} {
     969                set dataobj $_elem2dataobj($elem)
     970                set yunits [$dataobj hints yunits]
     971                set xunits [$dataobj hints xunits]
     972            } else {
     973                set xunits ""
     974                set yunits ""
     975            }
     976            set tip [$g element cget $elem -label]
     977            set yval [_axis format y dummy $info(y)]
     978            append tip "\n$yval$yunits"
     979            set xval [_axis format x dummy $info(x)]
     980            append tip " @ $xval$xunits"
     981            set tip [string trim $tip]
     982            set state 1
     983        }
     984    } else {
     985        set state 0
     986    }
     987
     988    if { $state } {
    989989        #
    990990        # Highlight ON:
     
    14901490itcl::body Rappture::BarchartResult::_getLineMarkerOptions {style} {
    14911491    array set lineOptions {
    1492         "-color"  "-color"
     1492        "-color"  "-outline"
    14931493        "-dashes" "-dashes"
    14941494        "-linecolor" "-foreground"
  • trunk/gui/scripts/vtkstreamlinesviewer.tcl

    r2756 r2762  
    8080    protected method Rotate {option x y}
    8181    protected method SendCmd {string}
    82     protected method SendCmdNoWait {string}
     82    protected method SendCmdNoSplash {string}
    8383    protected method Zoom {option}
    8484
     
    890890
    891891#
    892 # SendCmdNoWait
    893 #
    894 #       Send commands off to the rendering server.  If we're currently
    895 #       sending data objects to the server, buffer the commands to be
    896 #       sent later.
    897 #
    898 itcl::body Rappture::VtkStreamlinesViewer::SendCmdNoWait {string} {
     892# SendCmdNoSplash
     893#
     894#       Send commands off to the rendering server.  This method
     895#       doesn't initiate the slash screen.
     896#
     897itcl::body Rappture::VtkStreamlinesViewer::SendCmdNoSplash {string} {
    899898    if { $_buffering } {
    900899        append _outbuf $string "\n"
     
    12851284itcl::body Rappture::VtkStreamlinesViewer::Pick {x y} {
    12861285    foreach tag [CurrentDatasets -visible] {
    1287         SendCmd "dataset getscalar pixel $x $y $tag"
     1286        SendCmdNoSplash "dataset getscalar pixel $x $y $tag"
    12881287    }
    12891288}
     
    16061605        foreach {dataobj comp} [split $dataset -] break
    16071606        if { [info exists _dataset2style($dataset)] } {
    1608             SendCmdNoWait \
     1607            SendCmdNoSplash \
    16091608                "legend $_dataset2style($dataset) $_colorMode $name {} $w $h 0"
    16101609            break;
  • trunk/gui/src/RpConvertDxToVtk.c

    r2730 r2762  
    4646
    4747static int
    48 GetPoints(Tcl_Interp *interp, int nPoints, char **stringPtr,
     48GetPoints(Tcl_Interp *interp, int nPoints, int *counts, char **stringPtr,
    4949          const char *endPtr, Tcl_Obj *objPtr)
    5050{
     
    5454    char mesg[2000];
    5555    float *array, scale, vmin, vmax;
     56    int iX, iY, iZ;
    5657
    5758    nValues = 0;
     
    6263    }
    6364    vmin = FLT_MAX, vmax = -FLT_MAX;
     65    iX = iY = iZ = 0;
    6466    for (i = 0; i < nPoints; i++) {
    6567        double value;
    6668        char *nextPtr;
    67                
     69        int loc;
     70
    6871        if (p >= endPtr) {
    6972            Tcl_AppendResult(interp, "unexpected EOF in reading points",
     
    7881        }
    7982        p = nextPtr;
    80         array[i] = value;
     83        loc = iZ*counts[0]*counts[1] + iY*counts[0] + iX;
     84        if (++iZ >= counts[2]) {
     85            iZ = 0;
     86            if (++iY >= counts[1]) {
     87                iY = 0;
     88                ++iX;
     89            }
     90        }
     91        array[loc] = value;
    8192        if (value < vmin) {
    8293            vmin = value;
     
    175186            fprintf(stderr, "found delta %g %g %g\n", ddx, ddy, ddx);
    176187#endif
     188        } else if (sscanf(line, "object %*d class regulararray count %d",
     189                          count[2]) == 1) {
     190           
    177191        } else if (sscanf(line, "object %*d class array type %*s shape 3"
    178192                " rank 1 items %d data follows", &nPoints) == 1) {
     
    191205                return TCL_ERROR;
    192206            }
    193             if (GetPoints(interp, nPoints, &p, pend, pointsObjPtr) != TCL_OK) {
     207            if (GetPoints(interp, nPoints, count, &p, pend, pointsObjPtr)
     208                != TCL_OK) {
    194209                return TCL_ERROR;
    195210            }
     
    207222                return TCL_ERROR;
    208223            }
    209             if (GetPoints(interp, nPoints, &p, pend, pointsObjPtr) != TCL_OK) {
     224            if (GetPoints(interp, nPoints, count, &p, pend, pointsObjPtr)
     225                != TCL_OK) {
    210226                return TCL_ERROR;
    211227            }
Note: See TracChangeset for help on using the changeset viewer.