#### redraw, stereo, show inside, lights, bigcursor ####
-------------------------------------------
funct: "REDRAW (if stereo, bak to single) (left-click-REDRAW)"
keyboard equivlalent: <Cmd/Alt-r>
  set stereoflag 0
  set convergentflag 0
  redrawbutton
-------------------------------------------
funct: "Divergent Stereo REDRAW (mid-click-REDRAW)"
  set stereoflag 1
  set convergentflag 0
  redrawbutton
-------------------------------------------
funct: "Convergent Stereo REDRAW (shift-mid-clk-REDRAW)"
  set stereoflag 1
  set convergentflag 1
  redrawbutton
-------------------------------------------
funct: "Toggle Light Inside/Back Surf (ctrl-mid-clk-REDRAW)"
  set lighttwosidedflag [expr !$twosidedflag]
  redrawbutton
-------------------------------------------
funct: "Lights Bright/Position Popup (shift-R-clk-REDRAW)"
  lightsctrls
-------------------------------------------
funct: "Toggle Disp Mult Timecourses (ctrl-R-clk-REDRAW)"
  set multitimecourseflag [expr !$multitimecourseflag]
-------------------------------------------
funct: "Toggle BigCursor (shows neigh) (shift-L-clk-REDRAW)"
  set bigcursorflag [expr !$bigcursorflag]
-------------------------------------------
funct: "Select Vertex By Number Popup" (no hotkey)
  set selected $selected_vertex
  set selected_vertex $selected
  leftclick_vertex <vtxnum>
  read_rawdata
  read_regdat
  show_timecourse
  select_uniqsamp_vertices
-------------------------------------------


Detailed Description of "REDRAW" Button Actions

-------------------------------------------
funct: "REDRAW (if stereo, bak to single) (left-click-REDRAW)"
keyboard equivalent: <Cmd/Alt-r>
  set stereoflag 0
  set convergentflag 0
  redrawbutton
-------------------------------------------

The "REDRAW" button procedure (tksurfer.tcl) is
automatically called by most interface elements
that affect the rendered image and rarely has to
be explicitly clicked.

proc redrawbutton {  } {
  transform		;# apply transform
  resize_window 0		;# reshape window
  dolighting		;# reset lights
  redraw		;# C/tcl redraw function
  resettransform		;# reset transform
  after 100		;# stop feedback
}

The default left-click on REDRAW also turns off
stereo viewing if this has been enabled.

-------------------------------------------
funct: "Divergent Stereo REDRAW (mid-click-REDRAW)"
  set stereoflag 1
  set convergentflag 0
  redrawbutton
-------------------------------------------

An alternate middle-click on the REDRAW button
displays divergent stereo viewing.  The brain is
drawn twice, side-by-side, for stereo viewing by
divergent fixation (left copy viewed by left eye,
right copy viewed by right eye).

-------------------------------------------
funct: "Convergent Stereo REDRAW (shift-mid-clk-REDRAW)"
  set stereoflag 1
  set convergentflag 1
  redrawbutton
-------------------------------------------

A second alternate shift-middle-click on REDRAW
displays convergent ('cross-eye') stereo viewing.
The brain is draw twice (left copy viewed by
right eye, and vice versa).  Some people prefer
this to divergent viewing.

-------------------------------------------
Hints for stereo viewing
-------------------------------------------

It is easiest to achieve stereo fusion when there
is single high-contrast target -- e.g., brain at
near initial magnification -- but it is harder to
make out details that way.  If you zoom
(shift-R-click drag up/down) *after* fusing, you
won't break stereo fusion.  To do that, have your
left finger on the shift key *before* you fuse,
since you will break fusion if you have to look
away at the keyboard.  Another useful high
contrast target is the color scale disk or
vertical bar at the lower right.

Stereo viewing is particularly good for
appreciating the orientation of the surface
normal display, and the complex geometry of the
folded (smoothwm) surface.

A Google Daydream or equivalent set of closeup
stereo lenses can be taped to the screen to make
divergent fusion easier (N.B. won't work with
convergent display).

Use "winxy:" ($glwinxydim) to adjust the
intraocular distance.

-------------------------------------------
funct: "Toggle Light Inside/Back Surface (control-mid-clk-REDRAW)"
  set lighttwosidedflag [expr !$twosidedflag]
  redrawbutton
-------------------------------------------

An alternate ctrl-middle-click on the REDRAW
button toggles whether back/inside surfaces
should be lit.

The inside of the closed folded and inflated
surfaces are not normally visible.  Use this
option to visualize the inside of a cut 3D
surface (inside is dark gray).

The PLANE button sets this automatically.

The default is 0 (off).

The relative brightness of the inside surface is
set by $insidesurffact.  This variable (def=0.6)
appears in the larger F3 interface in an
unlabeled entry directly to the right of the
mid-lower right "offset:" entry.

N.B.: when looking at the inside of the brain
surface, there will be a strong 'hollow-face
illusion' (concave surface looks convex) and you
may have to interactively rotate the surface
(shift-left-click-drag) to overcome this.

-------------------------------------------
funct: "Lights Bright/Position Popup (shift-R-clk-REDRAW)"
  lightsctrls
-------------------------------------------

An alternate shift-right-click on the REDRAW
button makes a popup containing the brightnesses
and positions of the fix lights that illuminate
the brain.

The brightness parameters are:

  $light0
  $light1
  $light2
  $light3

and the position x,y,z parameters are:

  $light0x
  $light0y
  $light0z
  $light1x
  $light1y
  [etc]

See right-click help on the popup for details.

-------------------------------------------
funct: "Toggle Display Mult Timecourses (ctrl-R-clk-REDRAW)"
  set multitimecourseflag [expr !$multitimecourseflag]
-------------------------------------------

An alternate ctrl-right-click on the REDRAW
button toggles whether to not to overlay multiple
single-voxel timecourses (from each successive
ctrl-middle-click on a vertex in the surface
window).

The default is 0 (off).

-------------------------------------------
funct: "Toggle BigCursor (shows neigh) (shift-L-clk-REDRAW)"
  set bigcursorflag [expr !$bigcursorflag]
-------------------------------------------

For high resolution surfaces with large number of
vertices (e.g., post-mortem cerebellum scan), it
can be difficult to see which vertex is selected.
When $bigcursorflag is on, an additional ring of
mesh edges are highlighted (normally, only the
edges extending from the selected vertex are
highlighted).

N.B.: when $bigcursorflag is ON, only the central
vertex will still be selected by a left-click
(i.e., the same single-vertex selection as when
$bigcursorflag is OFF) - except in the following
special case:

If $bigcursorflag is ON when the C/tcl command
write_val_selected_list_to_label is executed, the
the neighbors of selected vertices will be
included in the output label.  This is useful
when you want to outline where a cut should be
made using one surface, convert those outlines to
a label, and then display that label on a
different surface - for example, to outline the
cerebellar vermis on the highly folded smoothwm
surface where it is easier to see, save that
outline as a label, then display it on the
inflated surface, where the cuts are much easier
to make.

-------------------------------------------
funct: "Select Vertex By Number Popup" (no hotkey)
  set selected $selected_vertex
  set selected_vertex $selected
  leftclick_vertex <vtxnum>
  read_rawdata
  read_regdat
  show_timecourse
-------------------------------------------

This popup allows manipulating the display with
vertex numebrs (mainly for debugging).

To find the vertex number of a selected vertex
(also available from the csurf log):

  click a vertex in display window
  click CURRENTLY SELECTED VTX on popup

To select a vertex by number:

  enter vertex number in "select_vertex" on popup
  click SELECT VERTEX BY NUMBER

To display the rawdata timecourse for a numbered
vertex:

  enter vertex number in "select_vertex" on popup
  click SHOW VERTEX TIMECOURSE

(last also available from ctrl-middle-click a
vertex in the display window).

The tcl variable $selected is the currently
selected vertex number.  A $selected value of -1
means no vertex is currently selected (e.g.,
after a R-click clear in display windwo).

N.B.: the "selected_vertex" entry on the popup is
*not* updated when you select a vertex in the
display window.  To grab that vertex number into
the "selecte_vertex" entry, use the CURRENTLY
SELECTED VTX button.

Finally, if 3D-voxel-uniq 'representative'
vertices have been computed, SHOW UNIQSAMP
VERTICES (re-)displays them by reselecting them
all.

