Commit c8a98076 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

removed public function gimp_transform_tool_transform_tiles() and made it

2002-11-18  Michael Natterer  <mitch@gimp.org>

	* app/tools/gimptransformtool.[ch]: removed public function
	gimp_transform_tool_transform_tiles() and made it the default
	implementation of the transform() virtual function. Added
	"const gchar *progress_text" to GimpTransformTool so it is
	available for the new default implementation. Cleanup.

	* app/tools/gimpperspectivetool.c
	* app/tools/gimprotatetool.c
	* app/tools/gimpscaletool.c
	* app/tools/gimpsheartool.c: removed transform() implementations
	and set transform_tool->progress_text accordingly. Even more
	cleanup.
parent fdf3d233
2002-11-18 Michael Natterer <mitch@gimp.org>
* app/tools/gimptransformtool.[ch]: removed public function
gimp_transform_tool_transform_tiles() and made it the default
implementation of the transform() virtual function. Added
"const gchar *progress_text" to GimpTransformTool so it is
available for the new default implementation. Cleanup.
* app/tools/gimpperspectivetool.c
* app/tools/gimprotatetool.c
* app/tools/gimpscaletool.c
* app/tools/gimpsheartool.c: removed transform() implementations
and set transform_tool->progress_text accordingly. Even more
cleanup.
2002-11-18 Sven Neumann <sven@gimp.org>
 
* autogen.sh: try automake-1.7 if automake-1.6 is not available.
......
......@@ -50,17 +50,15 @@
static void gimp_perspective_tool_class_init (GimpPerspectiveToolClass *klass);
static void gimp_perspective_tool_init (GimpPerspectiveTool *tool);
static void gimp_perspective_tool_dialog (GimpTransformTool *tr_tool);
static void gimp_perspective_tool_prepare (GimpTransformTool *tr_tool,
GimpDisplay *gdisp);
static void gimp_perspective_tool_motion (GimpTransformTool *tr_tool,
GimpDisplay *gdisp);
static void gimp_perspective_tool_recalc (GimpTransformTool *tr_tool,
GimpDisplay *gdisp);
static TileManager * gimp_perspective_tool_transform (GimpTransformTool *tr_tool,
GimpDisplay *gdisp);
static void gimp_perspective_tool_dialog (GimpTransformTool *tr_tool);
static void gimp_perspective_tool_prepare (GimpTransformTool *tr_tool,
GimpDisplay *gdisp);
static void gimp_perspective_tool_motion (GimpTransformTool *tr_tool,
GimpDisplay *gdisp);
static void gimp_perspective_tool_recalc (GimpTransformTool *tr_tool,
GimpDisplay *gdisp);
static void perspective_info_update (GimpTransformTool *tr_tool);
static void perspective_info_update (GimpTransformTool *tr_tool);
/* storage for information dialog fields */
......@@ -124,11 +122,10 @@ gimp_perspective_tool_class_init (GimpPerspectiveToolClass *klass)
parent_class = g_type_class_peek_parent (klass);
trans_class->dialog = gimp_perspective_tool_dialog;
trans_class->prepare = gimp_perspective_tool_prepare;
trans_class->motion = gimp_perspective_tool_motion;
trans_class->recalc = gimp_perspective_tool_recalc;
trans_class->transform = gimp_perspective_tool_transform;
trans_class->dialog = gimp_perspective_tool_dialog;
trans_class->prepare = gimp_perspective_tool_prepare;
trans_class->motion = gimp_perspective_tool_motion;
trans_class->recalc = gimp_perspective_tool_recalc;
}
static void
......@@ -143,7 +140,8 @@ gimp_perspective_tool_init (GimpPerspectiveTool *perspective_tool)
gimp_tool_control_set_tool_cursor (tool->control,
GIMP_PERSPECTIVE_TOOL_CURSOR);
tr_tool->shell_desc = _("Perspective Transform Information");
tr_tool->shell_desc = _("Perspective Transform Information");
tr_tool->progress_text = _("Perspective...");
}
static void
......@@ -238,14 +236,6 @@ gimp_perspective_tool_recalc (GimpTransformTool *tr_tool,
perspective_info_update (tr_tool);
}
static TileManager *
gimp_perspective_tool_transform (GimpTransformTool *tr_tool,
GimpDisplay *gdisp)
{
return gimp_transform_tool_transform_tiles (tr_tool,
_("Perspective..."));
}
static void
perspective_info_update (GimpTransformTool *tr_tool)
{
......
......@@ -60,25 +60,23 @@
/* local function prototypes */
static void gimp_rotate_tool_class_init (GimpRotateToolClass *klass);
static void gimp_rotate_tool_init (GimpRotateTool *rotate_tool);
static void gimp_rotate_tool_class_init (GimpRotateToolClass *klass);
static void gimp_rotate_tool_init (GimpRotateTool *rotate_tool);
static void gimp_rotate_tool_dialog (GimpTransformTool *tr_tool);
static void gimp_rotate_tool_prepare (GimpTransformTool *tr_tool,
GimpDisplay *gdisp);
static void gimp_rotate_tool_motion (GimpTransformTool *tr_tool,
GimpDisplay *gdisp);
static void gimp_rotate_tool_recalc (GimpTransformTool *tr_tool,
GimpDisplay *gdisp);
static TileManager * gimp_rotate_tool_transform (GimpTransformTool *tr_tool,
GimpDisplay *gdisp);
static void gimp_rotate_tool_dialog (GimpTransformTool *tr_tool);
static void gimp_rotate_tool_prepare (GimpTransformTool *tr_tool,
GimpDisplay *gdisp);
static void gimp_rotate_tool_motion (GimpTransformTool *tr_tool,
GimpDisplay *gdisp);
static void gimp_rotate_tool_recalc (GimpTransformTool *tr_tool,
GimpDisplay *gdisp);
static void rotate_info_update (GimpTransformTool *tr_tool);
static void rotate_info_update (GimpTransformTool *tr_tool);
static void rotate_angle_changed (GtkWidget *entry,
gpointer data);
static void rotate_center_changed (GtkWidget *entry,
gpointer data);
static void rotate_angle_changed (GtkWidget *entry,
GimpTransformTool *tr_tool);
static void rotate_center_changed (GtkWidget *entry,
GimpTransformTool *tr_tool);
/* variables local to this file */
......@@ -149,11 +147,10 @@ gimp_rotate_tool_class_init (GimpRotateToolClass *klass)
parent_class = g_type_class_peek_parent (klass);
trans_class->dialog = gimp_rotate_tool_dialog;
trans_class->prepare = gimp_rotate_tool_prepare;
trans_class->motion = gimp_rotate_tool_motion;
trans_class->recalc = gimp_rotate_tool_recalc;
trans_class->transform = gimp_rotate_tool_transform;
trans_class->dialog = gimp_rotate_tool_dialog;
trans_class->prepare = gimp_rotate_tool_prepare;
trans_class->motion = gimp_rotate_tool_motion;
trans_class->recalc = gimp_rotate_tool_recalc;
}
static void
......@@ -167,7 +164,8 @@ gimp_rotate_tool_init (GimpRotateTool *rotate_tool)
gimp_tool_control_set_tool_cursor (tool->control, GIMP_ROTATE_TOOL_CURSOR);
tr_tool->shell_desc = _("Rotation Information");
tr_tool->shell_desc = _("Rotation Information");
tr_tool->progress_text = _("Rotating...");
}
static void
......@@ -352,14 +350,6 @@ gimp_rotate_tool_recalc (GimpTransformTool *tr_tool,
rotate_info_update (tr_tool);
}
static TileManager *
gimp_rotate_tool_transform (GimpTransformTool *tr_tool,
GimpDisplay *gdisp)
{
return gimp_transform_tool_transform_tiles (tr_tool,
_("Rotating..."));
}
static void
rotate_info_update (GimpTransformTool *tr_tool)
{
......@@ -372,61 +362,51 @@ rotate_info_update (GimpTransformTool *tr_tool)
}
static void
rotate_angle_changed (GtkWidget *widget,
gpointer data)
rotate_angle_changed (GtkWidget *widget,
GimpTransformTool *tr_tool)
{
GimpTool *tool;
GimpTransformTool *transform_tool;
gdouble value;
tool = GIMP_TOOL (data);
transform_tool = GIMP_TRANSFORM_TOOL (data);
gdouble value;
value = gimp_deg_to_rad (GTK_ADJUSTMENT (widget)->value);
#define ANGLE_EPSILON 0.0001
if (ABS (value - transform_tool->trans_info[ANGLE]) > ANGLE_EPSILON)
if (ABS (value - tr_tool->trans_info[ANGLE]) > ANGLE_EPSILON)
{
gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool));
gimp_draw_tool_pause (GIMP_DRAW_TOOL (tr_tool));
transform_tool->trans_info[ANGLE] = value;
tr_tool->trans_info[ANGLE] = value;
gimp_rotate_tool_recalc (transform_tool, tool->gdisp);
gimp_rotate_tool_recalc (tr_tool, GIMP_TOOL (tr_tool)->gdisp);
gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool));
gimp_draw_tool_resume (GIMP_DRAW_TOOL (tr_tool));
}
#undef ANGLE_EPSILON
}
static void
rotate_center_changed (GtkWidget *widget,
gpointer data)
rotate_center_changed (GtkWidget *widget,
GimpTransformTool *tr_tool)
{
GimpTool *tool;
GimpTransformTool *transform_tool;
gdouble cx;
gdouble cy;
tool = GIMP_TOOL (data);
transform_tool = GIMP_TRANSFORM_TOOL (data);
gdouble cx;
gdouble cy;
cx = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0);
cy = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1);
if ((cx != transform_tool->trans_info[CENTER_X]) ||
(cy != transform_tool->trans_info[CENTER_Y]))
if ((cx != tr_tool->trans_info[CENTER_X]) ||
(cy != tr_tool->trans_info[CENTER_Y]))
{
gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool));
gimp_draw_tool_pause (GIMP_DRAW_TOOL (tr_tool));
transform_tool->trans_info[CENTER_X] = cx;
transform_tool->trans_info[CENTER_Y] = cy;
transform_tool->cx = cx;
transform_tool->cy = cy;
tr_tool->trans_info[CENTER_X] = cx;
tr_tool->trans_info[CENTER_Y] = cy;
tr_tool->cx = cx;
tr_tool->cy = cy;
gimp_rotate_tool_recalc (transform_tool, tool->gdisp);
gimp_rotate_tool_recalc (tr_tool, GIMP_TOOL (tr_tool)->gdisp);
gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool));
gimp_draw_tool_resume (GIMP_DRAW_TOOL (tr_tool));
}
}
......@@ -49,26 +49,24 @@
/* local function prototypes */
static void gimp_scale_tool_class_init (GimpScaleToolClass *klass);
static void gimp_scale_tool_class_init (GimpScaleToolClass *klass);
static void gimp_scale_tool_init (GimpScaleTool *sc_tool);
static void gimp_scale_tool_init (GimpScaleTool *sc_tool);
static void gimp_scale_tool_dialog (GimpTransformTool *tr_tool);
static void gimp_scale_tool_prepare (GimpTransformTool *tr_tool,
GimpDisplay *gdisp);
static void gimp_scale_tool_motion (GimpTransformTool *tr_tool,
GimpDisplay *gdisp);
static void gimp_scale_tool_recalc (GimpTransformTool *tr_tool,
GimpDisplay *gdisp);
static TileManager * gimp_scale_tool_transform (GimpTransformTool *tr_tool,
GimpDisplay *gdisp);
static void gimp_scale_tool_dialog (GimpTransformTool *tr_tool);
static void gimp_scale_tool_prepare (GimpTransformTool *tr_tool,
GimpDisplay *gdisp);
static void gimp_scale_tool_motion (GimpTransformTool *tr_tool,
GimpDisplay *gdisp);
static void gimp_scale_tool_recalc (GimpTransformTool *tr_tool,
GimpDisplay *gdisp);
static void gimp_scale_tool_info_update (GimpTransformTool *tr_tool);
static void gimp_scale_tool_info_update (GimpTransformTool *tr_tool);
static void gimp_scale_tool_size_changed (GtkWidget *widget,
gpointer data);
static void gimp_scale_tool_unit_changed (GtkWidget *widget,
gpointer data);
static void gimp_scale_tool_size_changed (GtkWidget *widget,
GimpTransformTool *tr_tool);
static void gimp_scale_tool_unit_changed (GtkWidget *widget,
GimpTransformTool *tr_tool);
/* storage for information dialog fields */
......@@ -136,21 +134,16 @@ gimp_scale_tool_get_type (void)
static void
gimp_scale_tool_class_init (GimpScaleToolClass *klass)
{
GtkObjectClass *object_class;
GimpToolClass *tool_class;
GimpTransformToolClass *transform_class;
GimpTransformToolClass *trans_class;
object_class = (GtkObjectClass *) klass;
tool_class = (GimpToolClass *) klass;
transform_class = (GimpTransformToolClass *) klass;
trans_class = GIMP_TRANSFORM_TOOL_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
transform_class->dialog = gimp_scale_tool_dialog;
transform_class->prepare = gimp_scale_tool_prepare;
transform_class->motion = gimp_scale_tool_motion;
transform_class->recalc = gimp_scale_tool_recalc;
transform_class->transform = gimp_scale_tool_transform;
trans_class->dialog = gimp_scale_tool_dialog;
trans_class->prepare = gimp_scale_tool_prepare;
trans_class->motion = gimp_scale_tool_motion;
trans_class->recalc = gimp_scale_tool_recalc;
}
static void
......@@ -164,7 +157,8 @@ gimp_scale_tool_init (GimpScaleTool *scale_tool)
gimp_tool_control_set_tool_cursor (tool->control, GIMP_RESIZE_TOOL_CURSOR);
tr_tool->shell_desc = _("Scaling Information");
tr_tool->shell_desc = _("Scaling Information");
tr_tool->progress_text = _("Scaling...");
}
static void
......@@ -410,23 +404,15 @@ gimp_scale_tool_recalc (GimpTransformTool *tr_tool,
gimp_scale_tool_info_update (tr_tool);
}
static TileManager *
gimp_scale_tool_transform (GimpTransformTool *tr_tool,
GimpDisplay *gdisp)
{
return gimp_transform_tool_transform_tiles (tr_tool,
_("Scaling..."));
}
static void
gimp_scale_tool_info_update (GimpTransformTool *tr_tool)
{
GimpTool *tool;
gdouble ratio_x, ratio_y;
gint x1, y1, x2, y2, x3, y3, x4, y4;
GimpUnit unit;
gdouble unit_factor;
gchar format_buf[16];
GimpTool *tool;
gdouble ratio_x, ratio_y;
gint x1, y1, x2, y2, x3, y3, x4, y4;
GimpUnit unit;
gdouble unit_factor;
gchar format_buf[16];
static GimpUnit label_unit = GIMP_UNIT_PIXEL;
......@@ -485,16 +471,11 @@ gimp_scale_tool_info_update (GimpTransformTool *tr_tool)
}
static void
gimp_scale_tool_size_changed (GtkWidget *widget,
gpointer data)
gimp_scale_tool_size_changed (GtkWidget *widget,
GimpTransformTool *tr_tool)
{
GimpTransformTool *tr_tool;
GimpTool *tool;
gint width;
gint height;
tr_tool = GIMP_TRANSFORM_TOOL (data);
tool = GIMP_TOOL (data);
gint width;
gint height;
width = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0));
height = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1));
......@@ -504,20 +485,20 @@ gimp_scale_tool_size_changed (GtkWidget *widget,
(height != (tr_tool->trans_info[Y1] -
tr_tool->trans_info[Y0])))
{
gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool));
gimp_draw_tool_pause (GIMP_DRAW_TOOL (tr_tool));
tr_tool->trans_info[X1] = tr_tool->trans_info[X0] + width;
tr_tool->trans_info[Y1] = tr_tool->trans_info[Y0] + height;
gimp_scale_tool_recalc (tr_tool, tool->gdisp);
gimp_scale_tool_recalc (tr_tool, GIMP_TOOL (tr_tool)->gdisp);
gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool));
gimp_draw_tool_resume (GIMP_DRAW_TOOL (tr_tool));
}
}
static void
gimp_scale_tool_unit_changed (GtkWidget *widget,
gpointer data)
gimp_scale_tool_unit_changed (GtkWidget *widget,
GimpTransformTool *tr_tool)
{
gimp_scale_tool_info_update (GIMP_TRANSFORM_TOOL (data));
gimp_scale_tool_info_update (tr_tool);
}
......@@ -58,25 +58,23 @@
/* forward function declarations */
static void gimp_shear_tool_class_init (GimpShearToolClass *klass);
static void gimp_shear_tool_init (GimpShearTool *shear_tool);
static void gimp_shear_tool_class_init (GimpShearToolClass *klass);
static void gimp_shear_tool_init (GimpShearTool *shear_tool);
static void gimp_shear_tool_dialog (GimpTransformTool *tr_tool);
static void gimp_shear_tool_prepare (GimpTransformTool *tr_tool,
GimpDisplay *gdisp);
static void gimp_shear_tool_motion (GimpTransformTool *tr_tool,
GimpDisplay *gdisp);
static void gimp_shear_tool_recalc (GimpTransformTool *tr_tool,
GimpDisplay *gdisp);
static TileManager * gimp_shear_tool_transform (GimpTransformTool *tr_tool,
GimpDisplay *gdisp);
static void gimp_shear_tool_dialog (GimpTransformTool *tr_tool);
static void gimp_shear_tool_prepare (GimpTransformTool *tr_tool,
GimpDisplay *gdisp);
static void gimp_shear_tool_motion (GimpTransformTool *tr_tool,
GimpDisplay *gdisp);
static void gimp_shear_tool_recalc (GimpTransformTool *tr_tool,
GimpDisplay *gdisp);
static void shear_info_update (GimpTransformTool *tr_tool);
static void shear_info_update (GimpTransformTool *tr_tool);
static void shear_x_mag_changed (GtkWidget *widget,
gpointer data);
static void shear_y_mag_changed (GtkWidget *widget,
gpointer data);
static void shear_x_mag_changed (GtkWidget *widget,
GimpTransformTool *tr_tool);
static void shear_y_mag_changed (GtkWidget *widget,
GimpTransformTool *tr_tool);
/* variables local to this file */
......@@ -141,11 +139,10 @@ gimp_shear_tool_class_init (GimpShearToolClass *klass)
parent_class = g_type_class_peek_parent (klass);
trans_class->dialog = gimp_shear_tool_dialog;
trans_class->prepare = gimp_shear_tool_prepare;
trans_class->motion = gimp_shear_tool_motion;
trans_class->recalc = gimp_shear_tool_recalc;
trans_class->transform = gimp_shear_tool_transform;
trans_class->dialog = gimp_shear_tool_dialog;
trans_class->prepare = gimp_shear_tool_prepare;
trans_class->motion = gimp_shear_tool_motion;
trans_class->recalc = gimp_shear_tool_recalc;
}
static void
......@@ -159,8 +156,9 @@ gimp_shear_tool_init (GimpShearTool *shear_tool)
gimp_tool_control_set_tool_cursor (tool->control, GIMP_SHEAR_TOOL_CURSOR);
tr_tool->use_center = FALSE;
tr_tool->shell_desc = _("Shearing Information");
tr_tool->use_center = FALSE;
tr_tool->shell_desc = _("Shearing Information");
tr_tool->progress_text = _("Shearing...");
}
static void
......@@ -294,14 +292,6 @@ gimp_shear_tool_recalc (GimpTransformTool *tr_tool,
shear_info_update (tr_tool);
}
static TileManager *
gimp_shear_tool_transform (GimpTransformTool *tr_tool,
GimpDisplay *gdisp)
{
return gimp_transform_tool_transform_tiles (tr_tool,
_("Shearing..."));
}
static void
shear_info_update (GimpTransformTool *tr_tool)
{
......@@ -313,51 +303,41 @@ shear_info_update (GimpTransformTool *tr_tool)
}
static void
shear_x_mag_changed (GtkWidget *widget,
gpointer data)
shear_x_mag_changed (GtkWidget *widget,
GimpTransformTool *tr_tool)
{
GimpTool *tool;
GimpTransformTool *tr_tool;
gdouble value;
tool = GIMP_TOOL (data);
tr_tool = GIMP_TRANSFORM_TOOL (data);
gdouble value;
value = GTK_ADJUSTMENT (widget)->value;
if (value != tr_tool->trans_info[XSHEAR])
{
gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool));
gimp_draw_tool_pause (GIMP_DRAW_TOOL (tr_tool));
tr_tool->trans_info[XSHEAR] = value;
gimp_shear_tool_recalc (tr_tool, tool->gdisp);
gimp_shear_tool_recalc (tr_tool, GIMP_TOOL (tr_tool)->gdisp);
gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool));
gimp_draw_tool_resume (GIMP_DRAW_TOOL (tr_tool));
}
}
static void
shear_y_mag_changed (GtkWidget *widget,
gpointer data)
shear_y_mag_changed (GtkWidget *widget,
GimpTransformTool *tr_tool)
{
GimpTool *tool;
GimpTransformTool *tr_tool;
gdouble value;
tool = GIMP_TOOL (data);
tr_tool = GIMP_TRANSFORM_TOOL (data);
gdouble value;
value = GTK_ADJUSTMENT (widget)->value;
if (value != tr_tool->trans_info[YSHEAR])
{
gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool));
gimp_draw_tool_pause (GIMP_DRAW_TOOL (tr_tool));
tr_tool->trans_info[YSHEAR] = value;
gimp_shear_tool_recalc (tr_tool, tool->gdisp);
gimp_shear_tool_recalc (tr_tool, GIMP_TOOL (tr_tool)->gdisp);
gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool));
gimp_draw_tool_resume (GIMP_DRAW_TOOL (tr_tool));
}
}
......@@ -35,7 +35,6 @@
#include "base/tile-manager.h"
#include "core/gimp.h"
#include "core/gimpchannel.h"
#include "core/gimpcontext.h"
#include "core/gimpdrawable.h"
#include "core/gimpdrawable-transform.h"
......@@ -63,7 +62,7 @@
#include "libgimp/gimpintl.h"
#define HANDLE 10
#define HANDLE_SIZE 10
/* local function prototypes */
......@@ -107,6 +106,10 @@ static void gimp_transform_tool_cursor_update (GimpTool *tool,
static void gimp_transform_tool_draw (GimpDrawTool *draw_tool);
static TileManager *
gimp_transform_tool_real_transform (GimpTransformTool *tr_tool,
GimpDisplay *gdisp);
static void gimp_transform_tool_reset (GimpTransformTool *tr_tool);
static void gimp_transform_tool_bounds (GimpTransformTool *tr_tool,
GimpDisplay *gdisp);
......@@ -117,8 +120,6 @@ static void gimp_transform_tool_recalc (GimpTransformTool *tr_tool,
GimpDisplay *gdisp);
static void gimp_transform_tool_doit (GimpTransformTool *tr_tool,
GimpDisplay *gdisp);
static void gimp_transform_tool_setup_grid (GimpTransformTool *tr_tool,
TransformOptions *options);
static void gimp_transform_tool_grid_recalc (GimpTransformTool *tr_tool);
static void transform_reset_callback (GtkWidget *widget,
......@@ -189,7 +190,7 @@ gimp_transform_tool_class_init (GimpTransformToolClass *klass)
klass->prepare = NULL;
klass->motion = NULL;
klass->recalc = NULL;
klass->transform = NULL;
klass->transform = gimp_transform_tool_real_transform;
}
static void
......@@ -214,14 +215,16 @@ gimp_transform_tool_init (GimpTransformTool *tr_tool)
gimp_matrix3_identity (tr_tool->transform);
tr_tool->use_grid = TRUE;
tr_tool->use_center = TRUE;
tr_tool->ngx = 0;
tr_tool->ngy = 0;
tr_tool->grid_coords = NULL;
tr_tool->tgrid_coords = NULL;
tr_tool->use_grid = TRUE;
tr_tool->use_center = TRUE;
tr_tool->ngx = 0;
tr_tool->ngy = 0;
tr_tool->grid_coords = NULL;
tr_tool->tgrid_coords = NULL;