/**********
*
* This file is part of the TINA Open Source Image Analysis Environment
* henceforth known as TINA
*
* TINA is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation.
*
* TINA is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with TINA; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*
**********
*
* Program :   TINA
* File    :  $Source: /home/tina/cvs/htdocs/tina-main/teaching/knoppix_fix/tinaTool.c,v $
* Date    :  $Date: 2005/06/13 13:35:48 $
* Version :  $Revision: 1.2 $
* CVS Id  :  $Id: tinaTool.c,v 1.2 2005/06/13 13:35:48 paul Exp $
*
* Notes   :
*
*
*
*********
*/

#if HAVE_CONFIG_H
#include <config.h>
#endif

#include <tinatool/wdgts/wdgtsDef.h>
#include <tinatool/wdgts/wdgtsPro.h>
#include <tinatool/tlbase/tlbaseDef.h>
#include <tinatool/tlbase/tlbasePro.h>
/* #include <tinatool/tlvision/tlvisPro.h> */


void tool_proc(void)
{
	static int      x = 100, y = 200;
	static int      xr = 0, yr = 0;

	tv_tool(x + xr, y + yr);
	xr += 50;
	yr += 10;
	if (x + xr > 700)
	{
		xr = yr = 0;
		y += 50;
	}
	if (y > 400)
		y = 200;
}

static void     mono_tool_proc(void)
{
	mono_tool(50, 50);
}

static void     stereo_test_tool_proc(void)
{
	stereo_test_tool(150, 150);
}

static void     stereo_tool_proc(void)
{
	stereo_tool(150, 150);
}

static void     view_tool_proc(void)
{
	view_tool(75, 75);
}

static void     imcalc_tool_proc(void)
{
	imcalc_tool(200, 200);
}

static void     terrain_tool_proc(void)
{
	terrain_tool(250, 250);
}


static void     edge_tool_proc(void)
{
	edge_tool(200, 200);
}

static void     corner_tool_proc(void)
{
	corner_tool(200, 200);
}

static void     seq_tool_proc(void)
{
	seq_tool(250, 150);
}

static void     matcher_tool_proc(void)
{
	matcher_tool(75, 75);
}

static void     calib_tool_proc(void)
{
	calib_tool(100, 100);
}

static void corr_tool_proc(void)
{
  st_corr_tool(250,250);
}

static void     raw_input_tool_proc(void)
{
	raw_input_tool(50, 50);
}

int             main(int argc, char **argv)
{
	tw_init(&argc, argv);

	tw_tool("tinatool", 100, 100);

	tw_label("Display ");
	tw_button("New Tvtool", tool_proc, NULL);
	tw_button("View", view_tool_proc, NULL);
	tw_button("Terrain", terrain_tool_proc, NULL);
	tw_label("          ");
	tw_help_button("tinatool");
	tw_newrow();
	tw_sglobal("Macro File:", get_macro_file(), 18);
	tw_button("append", init_macro_proc, NULL);
	tw_button("close", save_macro_proc, NULL);
	tw_button("run", (void *)process_macro_proc, NULL);

	tw_newrow();
	tw_label("File I/O ");
	tw_button("Mono", mono_tool_proc, NULL);
	tw_button("Stereo", stereo_tool_proc, NULL);
	tw_button("Sequence", seq_tool_proc, NULL);
	tw_button("RawInput", raw_input_tool_proc, NULL);

	tw_newrow();
	tw_label("Tools ");
	tw_button("Edge", edge_tool_proc, NULL);
	tw_button("Corner", corner_tool_proc, NULL);
	tw_button("Imcalc", imcalc_tool_proc, NULL);
	tw_newrow();
	tw_button("Matcher", matcher_tool_proc, NULL);
	tw_button("Calib", calib_tool_proc, NULL);
	tw_button("Stereo Test", stereo_test_tool_proc, NULL);
        tw_button("Correlation", corr_tool_proc, NULL);

	tw_newrow();
	tw_textsw(10, 65);

	tw_end_tool();
	tw_main_loop();
        return(0);
}

