Ignore:
Timestamp:
Mar 2, 2015, 6:09:55 PM (10 years ago)
Author:
dkearney
Message:

removing the _ignoreRangeUpdate because newer implementations of the min/max range syncing does not cause a loop between changing the legend values and the gauge values.

added a -range flag to InitSettings? in ::Rebuild so the custom ranges are set.i dont think this works fully because some of the adjustments are inside the ToggleCustomRange? method, which isn't called by AdjustSetting? -range.

remove the trace on the crange widget's textvariable in favor of just calling the ToggleCustomRange? method where it needs to be called.

tried using the crange widget's (checkbutton) invoke command to turn on the checkbutton and call its -command script. the invoke command is a toggle, not just a "turn on" command and doesn't work the same as select.

changed the order of turning on the custom range checkbutton and setting the min or max gauge value. we should first signal that the custom range is being enabled from the legend min/max editor, then adjust the value in the min or max gauge, then enable the custom range checkbutton, labels, gauges. lastly call AdjustSetting? -range to redraw / recalculate isosurfaces and update the legend labels with the new min and max values.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/uiuc_vtk_viewers/gui/scripts/vtkisosurfaceviewer.tcl

    r5049 r5051  
    177177    private variable _mouseOver "";     # what called LegendRangeAction, vmin or vmax
    178178    private variable _customRangeClick 1;   # what called ToggleCustomRange
    179     private variable _ignoreRangeUpdate 0;  # update min/max gauges without redrawing
    180179}
    181180
     
    11181117            -isosurfacelighting \
    11191118            -field \
     1119            -range \
    11201120            -isosurfacevisible \
    11211121            -isosurfaceedges -isosurfacelighting -isosurfaceopacity \
     
    15001500                    # the legend's min and max text will be updated
    15011501                    # when the legend is redrawn in DrawLegend
    1502                     set _ignoreRangeUpdate 1
    15031502                    SetMinMaxGauges $vmin $vmax
    15041503                }
     
    15791578        }
    15801579        "-range" {
    1581             if { ! $_ignoreRangeUpdate } {
    1582                 if { $_settings(-customrange) } {
    1583                     set vmin [$itk_component(min) value]
    1584                     set vmax [$itk_component(max) value]
    1585                 } else {
    1586                     foreach { vmin vmax } $_limits($_curFldName) break
    1587                 }
    1588                 GenerateContourList
    1589                 SendCmd [list contour3d contourlist $_contourList(values)]
    1590                 SendCmd "dataset maprange explicit $vmin $vmax $_curFldName"
    1591                 DrawLegend
    1592             }
    1593             set _ignoreRangeUpdate 0
     1580            if { $_settings(-customrange) } {
     1581                set vmin [$itk_component(min) value]
     1582                set vmax [$itk_component(max) value]
     1583            } else {
     1584                foreach { vmin vmax } $_limits($_curFldName) break
     1585            }
     1586            GenerateContourList
     1587            SendCmd [list contour3d contourlist $_contourList(values)]
     1588            SendCmd "dataset maprange explicit $vmin $vmax $_curFldName"
     1589            DrawLegend
    15941590        }
    15951591        "-xcutplanevisible" - "-ycutplanevisible" - "-zcutplanevisible" {
     
    18171813            -text "Use Custom Range:" \
    18181814            -variable [itcl::scope _settings(-customrange)] \
     1815            -command [itcl::code $this ToggleCustomRange] \
    18191816            -font "Arial 9"
    18201817    }
    1821     # use a trace so we can adjust the value of our variable
    1822     # and still have the ToggleCustomRange command called,
    1823     # which doesn't seem to happen when using -command.
    1824     trace add variable _settings(-customrange) write \
    1825         [itcl::code $this ToggleCustomRange]
    18261818
    18271819    itk_component add l_min {
     
    29172909            # only set custom range if value changed
    29182910            if {[$itk_component($which) value] != $value} {
    2919                 # turn on crange first to enable and update the gauge,
    2920                 # then change the value in the gauge
     2911                # set the flag stating the custom range came from the legend
     2912                # change the value in the gauge
     2913                # turn on crange to enable the labels and gauges
     2914                # call AdjustSetting -range (inside ToggleCustomRange)
     2915                # to update drawing and legend
    29212916                set _customRangeClick 0
     2917                $itk_component($which) value $value
    29222918                $itk_component(crange) select
    2923                 $itk_component($which) value $value
     2919                ToggleCustomRange
    29242920            }
    29252921        }
     
    29492945# ----------------------------------------------------------------------
    29502946itcl::body Rappture::VtkIsosurfaceViewer::ToggleCustomRange {args} {
    2951 
    29522947    if { ! $_settings(-customrange) } {
    29532948        # custom range was turned off
Note: See TracChangeset for help on using the changeset viewer.