[GRASS-dev] backwards sliders in NVIZ

Hi,

I'm working on a longstanding annoyance in NVIZ: many of the sliders are
presented backwards. (e.g. lighting levels)

this fix isn't complete though: if you type in a new out of range value
& hit <enter> (e.g. Red=1.5) it goes backwards. More importantly, the vector
points size slider gets stuck until you type in a new out of range value. ??

ideas?

Hamish

Index: widgets.tcl

RCS file: /home/grass/grassrepository/grass6/visualization/nviz/scripts/widgets.tcl,v
retrieving revision 1.2
diff -u -r1.2 widgets.tcl
--- widgets.tcl 1 Aug 2005 17:57:15 -0000 1.2
+++ widgets.tcl 4 Sep 2006 09:33:38 -0000
@@ -165,10 +165,10 @@
         }

        if {[expr $val < $min]} then {
- $S.scale configure -to $val
+ $S.scale configure -from $val
        }
        if {[expr $val > $max]} then {
- $S.scale configure -from $val
+ $S.scale configure -to $val
        }
        if {$val != 0} {
        if {[expr abs($val)] < [expr abs($res)]} {
Index: panel_lights.tcl

RCS file: /home/grass/grassrepository/grass6/visualization/nviz/scripts/panel_lights.tcl,v
retrieving revision 2.0
diff -u -r2.0 panel_lights.tcl
--- panel_lights.tcl 9 Nov 2004 14:18:38 -0000 2.0
+++ panel_lights.tcl 4 Sep 2006 09:33:38 -0000
@@ -41,15 +41,15 @@
        -variable Nv_(FollowView) -command follow -onvalue 1 -offvalue 0
     checkbutton $BASE.top.left.show -relief flat -text "Show Model" \
        -variable Nv_(ShowModel)
- Nv_mkScale $BASE.top.left.bright h Brightness 100 0 80 set_brt 2
- Nv_mkScale $BASE.top.left.ambient h Ambient 100 0 20 set_amb 2
+ Nv_mkScale $BASE.top.left.bright h Brightness 0 100 80 set_brt 2
+ Nv_mkScale $BASE.top.left.ambient h Ambient 0 100 20 set_amb 2
     pack $BASE.top.left.follow $BASE.top.left.show \
         $BASE.top.left.bright $BASE.top.left.ambient \
        -side top -fill x -expand 1
     
- Nv_mkScale $BASE.top.right.red h Red 100 0 100 set_red 2
- Nv_mkScale $BASE.top.right.green h Green 100 0 100 set_green 2
- Nv_mkScale $BASE.top.right.blue h Blue 100 0 100 set_blue 2
+ Nv_mkScale $BASE.top.right.red h Red 0 100 100 set_red 2
+ Nv_mkScale $BASE.top.right.green h Green 0 100 100 set_green 2
+ Nv_mkScale $BASE.top.right.blue h Blue 0 100 100 set_blue 2
     pack $BASE.top.right.red $BASE.top.right.green $BASE.top.right.blue \
        -side top -expand 1

I'm doing a bunch of bug fixes in gism. But I can take a look at this
afterwards.

Do you need to change the resolution setting? This sets the increment
interval.

Command-Line Name: -resolution
Database Name: resolution
Database Class: Resolution
    A real value specifying the resolution for the scale. If this value is
greater than zero then the scale's value will always be rounded to an even
multiple of this value, as will tick marks and the endpoints of the scale.
If the value is less than zero then no rounding occurs. Defaults to 1 (i.e.,
the value will be integral).

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

From: Hamish <hamish_nospam@yahoo.com>
Date: Mon, 4 Sep 2006 21:47:11 +1200
To: grass5 <grass-dev@grass.itc.it>
Subject: [GRASS-dev] backwards sliders in NVIZ

Hi,

I'm working on a longstanding annoyance in NVIZ: many of the sliders are
presented backwards. (e.g. lighting levels)

this fix isn't complete though: if you type in a new out of range value
& hit <enter> (e.g. Red=1.5) it goes backwards. More importantly, the vector
points size slider gets stuck until you type in a new out of range value. ??

ideas?

Hamish

Index: widgets.tcl

RCS file:
/home/grass/grassrepository/grass6/visualization/nviz/scripts/widgets.tcl,v
retrieving revision 1.2
diff -u -r1.2 widgets.tcl
--- widgets.tcl 1 Aug 2005 17:57:15 -0000 1.2
+++ widgets.tcl 4 Sep 2006 09:33:38 -0000
@@ -165,10 +165,10 @@
         }

        if {[expr $val < $min]} then {
- $S.scale configure -to $val
+ $S.scale configure -from $val
        }
        if {[expr $val > $max]} then {
- $S.scale configure -from $val
+ $S.scale configure -to $val
        }
        if {$val != 0} {
        if {[expr abs($val)] < [expr abs($res)]} {
Index: panel_lights.tcl

RCS file:
/home/grass/grassrepository/grass6/visualization/nviz/scripts/panel_lights.tcl
,v
retrieving revision 2.0
diff -u -r2.0 panel_lights.tcl
--- panel_lights.tcl 9 Nov 2004 14:18:38 -0000 2.0
+++ panel_lights.tcl 4 Sep 2006 09:33:38 -0000
@@ -41,15 +41,15 @@
        -variable Nv_(FollowView) -command follow -onvalue 1 -offvalue 0
     checkbutton $BASE.top.left.show -relief flat -text "Show Model" \
        -variable Nv_(ShowModel)
- Nv_mkScale $BASE.top.left.bright h Brightness 100 0 80 set_brt 2
- Nv_mkScale $BASE.top.left.ambient h Ambient 100 0 20 set_amb 2
+ Nv_mkScale $BASE.top.left.bright h Brightness 0 100 80 set_brt 2
+ Nv_mkScale $BASE.top.left.ambient h Ambient 0 100 20 set_amb 2
     pack $BASE.top.left.follow $BASE.top.left.show \
         $BASE.top.left.bright $BASE.top.left.ambient \
        -side top -fill x -expand 1
     
- Nv_mkScale $BASE.top.right.red h Red 100 0 100 set_red 2
- Nv_mkScale $BASE.top.right.green h Green 100 0 100 set_green 2
- Nv_mkScale $BASE.top.right.blue h Blue 100 0 100 set_blue 2
+ Nv_mkScale $BASE.top.right.red h Red 0 100 100 set_red 2
+ Nv_mkScale $BASE.top.right.green h Green 0 100 100 set_green 2
+ Nv_mkScale $BASE.top.right.blue h Blue 0 100 100 set_blue 2
     pack $BASE.top.right.red $BASE.top.right.green $BASE.top.right.blue \
        -side top -expand 1