
############################################################################

Date: Thu, 03 Mar 2005 12:12:01 +0100
From: Massimo Cuomo <m cuomo acsys it>

Hello Markus, Helena and Bob.

Here is a new version of the flythrough navigation with simplified 
istallation: I have reduced the files that must be modified in order to 
get the thing working.

I have added also the flythrough working with kanimator and a useful 
callback mechanism to "draw things" after everything has been drawn, but 
if you are not interested in these functions you can install only the 
basic things.

There are three types of flythrough navigation: basic, simple and orbit.
All the three are simply explained by an iconic help available at 
runtime through the GUI. The "basic mode" is what we at ACS use the most 
(Markus used it) and is taken by SGI Performer. The "simple mode" is 
what Markus asked for. The "orbit mode" leaves the object at the center 
and the eye orbits around looking always to the center.

The flythrough didn't work with kanimator, because it uses 
get/set_focus, instead of get/set_viewdir. So I changed these functions 
and created the Nget/set_viewdir tcl commands to solve the problem.

I added the "callback" mechanism because I used it to draw objects with 
special characteristics that have to be drawn at each frame, so I had to 
modify also the quick_draw.c file to call the cb when drawing "wire".

To find lines added by me, look for "ACS" in the code.

I have tested everything on linux machines.

I hope this can be useful.

Ciao,
              Massimo

This is the procedure:

*** "BASIC" installation **************************************

=== New files ===

visualization/nviz/scripts/flythrough.tcl
	tcl part for togl_flythrough.c

visualization/nviz/src/togl_flythrough.c
	all flythrough navigation
	Nset/Nget_viewdir commands
	override of command Ndraw_all (function draw_all
	in file draw.c) by function draw_all_together for drawing
		surf/vector/site in "fine" resolution
		all together with no flickering (no CLR
		between any of them)
	added semaphore "is_drawing" to avoid "clogging"
		between ordinary drawing and flythrough that
		try to draw continuously (there is a "multiprocess
		behavior" on my computer, probably due to the nvidia
		card/driver)

visualization/nviz/bitmaps/flythrough/*.gif
	a_lr.gif  b_c.gif   b_lc.gif  b_lr.gif  vuota.gif
	a_ud.gif  b_cr.gif  b_l.gif   b_r.gif
		icons for flythrough help
(in fly_icons.tar)

=== Modified files ===

visualization/nviz/scripts/panel_main.tcl
	"source" for flythrough.tcl and set UI for flythrough

visualization/nviz/src/nviz_init.c
	creates tcl commands and variables by calling
		togl_flythrough_init_tcl(interp, &data);
     		that also adds timer function by calling
		Togl_TimerFunc(togl_flythrough_timer_cb);
			that first time calls
				togl_flythrough_init(togl);

This is the only line added to nviz_init.c
int Ninit(Tcl_Interp * interp, Tk_Window w)
{
     static Nv_data data;
     init_commands(interp, &data);
     Ninitdata(interp, &data);

/*** ACS_MODIFY flythrough  ONE LINE ***/
	togl_flythrough_init_tcl(interp, &data);

     /* compile in the home directory */
     Tcl_SetVar(interp, "src_boot", getenv("GISBASE"), TCL_GLOBAL_ONLY);
     return(TCL_OK);
}



*** "KANIMATOR" installation **************************************

=== Modified files ===

visualization/nviz/scripts/panel_kanimator.tcl
	replaced get_focus with get_viewdir to work with flythrough

lib/ogsf/gk.c
	changed get/set_focus with get/set_viewdir for kanimator
		to work with flythrough
	corrected bug when adding point with disabled channels

lib/ogsf/GK2.c
	changed get/set_focus with get/set_viewdir for kanimator
		to work with flythrough


*** "CALLBACK" installation **************************************

=== Modified files ===

visualization/nviz/src/quick_draw.c
	calls "flythrough_draw_cb()" after drawing, before returning
		in order to execute callbacks at the right moment
	functions that call "GS_alldraw_wire" do not execute
		"flythrough_draw_cb()"


This is the only line added to

int Nquick_draw_cmd(Nv_data * dc, Tcl_Interp * interp)
{
     int i, max;
     int *surf_list;

     GS_set_draw(GSD_BACK);
     GS_clear(dc->BGcolor);
     GS_ready_draw();
     surf_list = GS_get_surf_list(&max);

     max = GS_num_surfs();
     for (i = 0; i < max; i++) {
	if (check_blank(interp, surf_list[i]) == 0) {
	    GS_draw_wire(surf_list[i]);
	}
     }
     GS_done_draw();
     free(surf_list);

/*** ACS_MODIFY flythrough  ONE LINE ***/
	flythrough_postdraw_cb();

	return (TCL_OK);
}



############################################################################
2002-2005: Bob Covill: significant code cleanup
2004: Tomas Paudits, Jaro Hofierka, Helena Mitasova: 3D Voxel visualization

############################################################################
11/99 glwrappers.c
      change_view.c modified:
This update correctes the following problems:
Screen redrawn in wire mode when mouse passes over 
vertical sliders.
Also a potential problem with colors in glwrappers.c 
(adress of a local variable returned  in color selection)
Modified intesection function to allow the "look here"
functionality and the "What's here" functionality.

   Pierre de Mouveaux
   p_de_mouveaux@hotmail.com

10/99
 Moved ogsf-lib and libimage to src/libes/ and changed Gmakefiles


Modified for Linux/tlc/tk8.x  Markus Neteler neteler@geog.uni-hannover.de
  files:
     compat/
     tkBind.c
     tkSend.c
     tkSpecial_Wait.c
     tkUnixInt.h
     tkAppInit.c
     Gmakefile.in.old
     Gmakefile.in
     Gmakefile
     tkInt.h
     tkPort.h
     tkUnixPort.h
     nviz_init.c
  -> fixed path errors.

Tue Mar 19 16:31:46 1996  Mark Astley  <astley@gambit.gis.uiuc.edu (Mark Astley)>

	* map_obj.c (get_char_marker): Changed the default return value of
	"get_char_marker" so that an empty string is returned to tcl.  It
	is up to the tcl code to figure out what to do in this case.

Mon Mar 11 15:37:58 1996  Mark Astley  <astley@gambit.gis.uiuc.edu (Mark Astley)>

	* Gmakefile (OBJS): The "mkdspf" panel and C support is expected
	to be obsolete soon so I have removed these features from Nviz.
	See the directory ../archive for details.

Wed Mar  6 12:29:40 1996  Mark Astley  <astley@gambit.gis.uiuc.edu (Mark Astley)>

	* Gmakefile (TK_LIB_PATH): Made this version link to the tk4.0
	compatible version of tkGLX.  Eventually we will want to move all
	the libraries to their usual places in /usr/local.

Tue Mar  5 14:46:30 1996  Mark Astley  <astley@gambit.gis.uiuc.edu (Mark Astley)>

	* tkSend.c: Disabled security on tksend.  Make sure that script
	writers are aware of this option as nvwish interpreters will now
	accept any and all scripts.

Mon Mar  4 17:09:18 1996  Mark Astley  <astley@gambit.gis.uiuc.edu (Mark Astley)>

	* tkScale.c: Removed this file as apparently the old tk3.6 way of
	handling mouse events from C code has been removed and done in the
	usual fashion via the scale.tcl file in /usr/local/include/tk.
	
	* Gmakefile (TKGLX_INCLUDES): Start of upgrade to Tcl 7.4 and Tk
	4.0.  So far this has required mostly minor changes.  In
	particular, I have created updated versions of the tkBind and
	tkSpecial_Wait files.  Still need to update tkScale and tkSend.
	Also, none of the nviz scripts have been updated and the old tkGLX
	widget stuff is still being used with this version.

	(nvwish): Cleaned up the Gmakefile a bit using the recent GRASS
	4.2 distribution version as the template.

