Index: trunk/gui/scripts/transferfunctioneditor.tcl
===================================================================
--- trunk/gui/scripts/transferfunctioneditor.tcl	(revision 5639)
+++ trunk/gui/scripts/transferfunctioneditor.tcl	(revision 5640)
@@ -1,9 +1,8 @@
-# -*- mode: tcl; indent-tabs-mode: nil -*- 
-
+# -*- mode: tcl; indent-tabs-mode: nil -*-
 # ----------------------------------------------------------------------
-#  COMPONENT: transferfunctioneditor - Rudimentary editor for 3D volume 
+#  COMPONENT: transferfunctioneditor - Rudimentary editor for 3D volume
 #                                      transfer functions
 #
-#  This class is used to modify transfer functions used in volume rendering 
+#  This class is used to modify transfer functions used in volume rendering
 #  on 3D scalar/vector datasets.
 #
@@ -20,38 +19,6 @@
 
 itcl::class Rappture::TransferFunctionEditor {
-    private variable _nextId 0;         # Used to create unique marker names
-    private variable _values;           # Relative values for each marker.
-    private variable _limits;           # Over limits of transfer function.
-    private variable _labels;           # Label id for each marker.
-    private variable _ticks;            # Tick id for each marker.
-    private variable _canvas    ""
-    private variable _name "";		# Name of transfer function.
-    private variable _activeMotion   0
-    private variable _activePress    0
-    private variable _id2name
-    private common   _normalIcon [Rappture::icon nvlegendmark]
-    private common   _activeIcon [Rappture::icon nvlegendmark2]
-    public variable command ""
-
-    private method SetAbsoluteValue { name x } 
-    private method GetAbsoluteValue { name } 
-    private method ContinueDrag { name x y } 
-    private method EnterTick { name } 
-    private method GetOverlappingMarkers { x y } 
-    private method GetScreenPosition { name } 
-    private method LeaveTick { name } 
-    private method SetRelativeValue  { name x }
-    private method GetRelativeValue  { name }
-    private method RemoveDuplicateMarkers {name x y} 
-    private method SetScreenPosition { name } 
-    private method SetVisibility { name bool } 
-    private method StartDrag { name x y } 
-    private method StopDrag { name x y } 
-    private method Activate { name } 
-    private method Deactivate { name } 
-    private method UpdateViewer {} 
-
     constructor {c name args} {}
-    destructor {} 
+    destructor {}
     public method limits { min max }
     public method names {}
@@ -65,38 +32,72 @@
     public method hideMarkers { {list {}} }
     public method showMarkers { {limits {}} }
-}
-
-itcl::body Rappture::TransferFunctionEditor::constructor {c name args} { 
+
+    public variable command ""
+
+    private method SetAbsoluteValue { name x }
+    private method GetAbsoluteValue { name }
+    private method ContinueDrag { name x y }
+    private method EnterTick { name }
+    private method GetOverlappingMarkers { x y }
+    private method GetScreenPosition { name }
+    private method LeaveTick { name }
+    private method SetRelativeValue  { name x }
+    private method GetRelativeValue  { name }
+    private method RemoveDuplicateMarkers {name x y}
+    private method SetScreenPosition { name }
+    private method SetVisibility { name bool }
+    private method StartDrag { name x y }
+    private method StopDrag { name x y }
+    private method Activate { name }
+    private method Deactivate { name }
+    private method UpdateViewer {}
+
+    private variable _nextId 0;         # Used to create unique marker names
+    private variable _values;           # Relative values for each marker.
+    private variable _limits;           # Over limits of transfer function.
+    private variable _labels;           # Label id for each marker.
+    private variable _ticks;            # Tick id for each marker.
+    private variable _canvas ""
+    private variable _name "";                # Name of transfer function.
+    private variable _activeMotion 0
+    private variable _activePress 0
+    private variable _id2name
+
+    private common _normalIcon [Rappture::icon nvlegendmark]
+    private common _activeIcon [Rappture::icon nvlegendmark2]
+}
+
+itcl::body Rappture::TransferFunctionEditor::constructor {c name args} {
     set _canvas $c
     set _name $name
-    set _limits [list 0.0 1.0] 
+    set _limits [list 0.0 1.0]
     eval configure $args
 }
 
-itcl::body Rappture::TransferFunctionEditor::limits { min max } { 
+itcl::body Rappture::TransferFunctionEditor::limits { min max } {
     set _limits [list $min $max]
 }
 
-itcl::body Rappture::TransferFunctionEditor::names {} { 
+itcl::body Rappture::TransferFunctionEditor::names {} {
     return [lsort [array names _values]]
 }
 
-itcl::body Rappture::TransferFunctionEditor::values {} { 
+itcl::body Rappture::TransferFunctionEditor::values {} {
     set list {}
     foreach name [array names _ticks] {
-	lappend list [GetRelativeValue $name]
+        lappend list [GetRelativeValue $name]
     }
     return [lsort -real $list]
 }
 
-itcl::body Rappture::TransferFunctionEditor::absoluteValues {} { 
+itcl::body Rappture::TransferFunctionEditor::absoluteValues {} {
     set list {}
     foreach name [array names _values] {
-	lappend list [GetAbsoluteValue $name]
+        lappend list [GetAbsoluteValue $name]
     }
     return $list
 }
 
-itcl::body Rappture::TransferFunctionEditor::deleteMarker { x y } { 
+itcl::body Rappture::TransferFunctionEditor::deleteMarker { x y } {
     foreach marker [GetOverlappingMarkers $x $y] {
         $_canvas delete $_ticks($marker)
@@ -110,11 +111,11 @@
 }
 
-itcl::body Rappture::TransferFunctionEditor::newMarker { x y state } { 
+itcl::body Rappture::TransferFunctionEditor::newMarker { x y state } {
     foreach id [$_canvas find overlapping \
                     [expr $x-5] [expr $y-5] [expr $x+5] [expr $y+5]] {
-	if { [info exists _id2name($id)] } {
+        if { [info exists _id2name($id)] } {
             puts stderr "Too close to existing marker"
-	    return;                     # Too close to existing marker
-	}
+            return;                     # Too close to existing marker
+        }
     }
     set name "tick[incr _nextId]"
@@ -132,9 +133,9 @@
     $_canvas bind $_ticks($name) <Leave> [itcl::code $this LeaveTick $name]
     $_canvas bind $_ticks($name) <ButtonPress-1> \
-	[itcl::code $this StartDrag $name %x %y]
+        [itcl::code $this StartDrag $name %x %y]
     $_canvas bind $_ticks($name) <B1-Motion> \
-	[itcl::code $this ContinueDrag $name %x %y]
+        [itcl::code $this ContinueDrag $name %x %y]
     $_canvas bind $_ticks($name) <ButtonRelease-1> \
-	[itcl::code $this StopDrag $name %x %y]
+        [itcl::code $this StopDrag $name %x %y]
 
     SetRelativeValue $name [expr {double($x-10)/($w-20)}]
@@ -182,12 +183,12 @@
 }
 
-itcl::body Rappture::TransferFunctionEditor::GetScreenPosition { name } { 
+itcl::body Rappture::TransferFunctionEditor::GetScreenPosition { name } {
     set x [GetRelativeValue $name]
     if { $x < 0.0 } {
         set x 0.0
     } elseif { $x > 1.0 } {
-        set x 1.0 
-    }
-    set low 10 
+        set x 1.0
+    }
+    set low 10
     set w [winfo width $_canvas]
     set high [expr {$w  - 10}]
@@ -196,5 +197,5 @@
 }
 
-itcl::body Rappture::TransferFunctionEditor::SetScreenPosition { name } { 
+itcl::body Rappture::TransferFunctionEditor::SetScreenPosition { name } {
     set value $_values($name)
     set x [GetScreenPosition $name]
@@ -250,5 +251,5 @@
 
 itcl::body Rappture::TransferFunctionEditor::StartDrag { name x y } {
-    $_canvas raise $_ticks($name) 
+    $_canvas raise $_ticks($name)
     set _activePress 1
     Activate $name
@@ -258,5 +259,5 @@
 
 itcl::body Rappture::TransferFunctionEditor::StopDrag { name x y } {
-    ContinueDrag $name $x $y 
+    ContinueDrag $name $x $y
     RemoveDuplicateMarkers $name $x $y
     set _activePress 0
@@ -280,7 +281,7 @@
     set list {}
     foreach id [$_canvas find overlapping $x $y $x $y] {
-	if { [info exists _id2name($id)] } {
-	    lappend list $_id2name($id)
-	}
+        if { [info exists _id2name($id)] } {
+            lappend list $_id2name($id)
+        }
     }
     return $list
@@ -289,8 +290,8 @@
 itcl::body Rappture::TransferFunctionEditor::hideMarkers { {list {}} } {
     if { $list == "" } {
-	set list [array names _values]
+        set list [array names _values]
     }
     foreach name $list {
-	SetVisibility $name 0
+        SetVisibility $name 0
     }
 }
@@ -298,11 +299,11 @@
 itcl::body Rappture::TransferFunctionEditor::showMarkers { {limits {}} } {
     if { $limits != "" } {
-	set _limits $limits
-	foreach name [array names _values] {
-	    SetScreenPosition $name 
-	}
+        set _limits $limits
+        foreach name [array names _values] {
+            SetScreenPosition $name
+        }
     }
     foreach name [array names _values] {
-	SetVisibility $name 1
+        SetVisibility $name 1
     }
 }
@@ -310,17 +311,17 @@
 itcl::body Rappture::TransferFunctionEditor::RemoveDuplicateMarkers {name x y} {
     foreach marker [GetOverlappingMarkers $x $y] {
-	if { $marker != $name } {
-            Activate $marker 
+        if { $marker != $name } {
+            Activate $marker
             set markerx [GetScreenPosition $marker]
             if { ($x < ($markerx-3)) || ($x > ($markerx+3)) } {
                 continue
             }
-	    $_canvas delete $_ticks($marker)
-	    $_canvas delete $_labels($marker)
-	    array unset _ticks $marker
-	    array unset _labels $marker
-	    array unset _values $marker
+            $_canvas delete $_ticks($marker)
+            $_canvas delete $_labels($marker)
+            array unset _ticks $marker
+            array unset _labels $marker
+            array unset _values $marker
             bell
-	}
+        }
     }
 }
@@ -328,6 +329,6 @@
 itcl::body Rappture::TransferFunctionEditor::addMarkers { values } {
     foreach value $values {
-	set name [newMarker 0 0 hidden]
-	SetRelativeValue $name $value
+        set name [newMarker 0 0 hidden]
+        SetRelativeValue $name $value
     }
 }
@@ -335,12 +336,12 @@
 itcl::body Rappture::TransferFunctionEditor::removeMarkers { names } {
     if { $names == "" } {
-	set names [array names _values]
+        set names [array names _values]
     }
     foreach name $names {
-	$_canvas delete $_ticks($name)
-	$_canvas delete $_labels($name)
-	array unset _ticks $name
-	array unset _labels $name
-	array unset _values $name
+        $_canvas delete $_ticks($name)
+        $_canvas delete $_labels($name)
+        array unset _ticks $name
+        array unset _labels $name
+        array unset _values $name
     }
     UpdateViewer
@@ -351,5 +352,5 @@
     # now that a marker position has changed.
     if { $command != "" } {
-	eval uplevel \#0 $command
-    }
-}
+        eval uplevel \#0 $command
+    }
+}
