Updated with upstream update
This commit is contained in:
@ -217,53 +217,30 @@ fitted_splines (pixel_outline_list_type pixel_outline_list)
|
||||
/* Set up the internal parameters from the external ones */
|
||||
|
||||
void
|
||||
fit_set_params(SELVALS *selVals)
|
||||
fit_set_params (PikaProcedureConfig *config)
|
||||
{
|
||||
align_threshold = selVals->align_threshold;
|
||||
corner_always_threshold = selVals->corner_always_threshold;
|
||||
corner_surround = selVals->corner_surround;
|
||||
corner_threshold = selVals->corner_threshold;
|
||||
error_threshold = selVals->error_threshold;
|
||||
filter_alternative_surround = selVals->filter_alternative_surround;
|
||||
filter_epsilon = selVals->filter_epsilon;
|
||||
filter_iteration_count = selVals->filter_iteration_count;
|
||||
filter_percent = selVals->filter_percent;
|
||||
filter_secondary_surround = selVals->filter_secondary_surround;
|
||||
filter_surround = selVals->filter_surround;
|
||||
keep_knees = selVals->keep_knees;
|
||||
line_reversion_threshold = selVals->line_reversion_threshold;
|
||||
line_threshold = selVals->line_threshold;
|
||||
reparameterize_improvement = selVals->reparameterize_improvement;
|
||||
reparameterize_threshold = selVals->reparameterize_threshold;
|
||||
subdivide_search = selVals->subdivide_search;
|
||||
subdivide_surround = selVals->subdivide_surround;
|
||||
subdivide_threshold = selVals->subdivide_threshold;
|
||||
tangent_surround = selVals->tangent_surround;
|
||||
}
|
||||
|
||||
void
|
||||
fit_set_default_params(SELVALS *selVals)
|
||||
{
|
||||
selVals->align_threshold = align_threshold;
|
||||
selVals->corner_always_threshold = corner_always_threshold;
|
||||
selVals->corner_surround = corner_surround;
|
||||
selVals->corner_threshold = corner_threshold;
|
||||
selVals->error_threshold = error_threshold;
|
||||
selVals->filter_alternative_surround = filter_alternative_surround;
|
||||
selVals->filter_epsilon = filter_epsilon;
|
||||
selVals->filter_iteration_count = filter_iteration_count;
|
||||
selVals->filter_percent = filter_percent;
|
||||
selVals->filter_secondary_surround = filter_secondary_surround;
|
||||
selVals->filter_surround = filter_surround;
|
||||
selVals->keep_knees = keep_knees;
|
||||
selVals->line_reversion_threshold = line_reversion_threshold;
|
||||
selVals->line_threshold = line_threshold;
|
||||
selVals->reparameterize_improvement = reparameterize_improvement;
|
||||
selVals->reparameterize_threshold = reparameterize_threshold;
|
||||
selVals->subdivide_search = subdivide_search;
|
||||
selVals->subdivide_surround = subdivide_surround;
|
||||
selVals->subdivide_threshold = subdivide_threshold;
|
||||
selVals->tangent_surround = tangent_surround;
|
||||
g_object_get (config,
|
||||
"align-threshold", &align_threshold,
|
||||
"corner-always-threshold", &corner_always_threshold,
|
||||
"corner-surround", &corner_surround,
|
||||
"corner-threshold", &corner_threshold,
|
||||
"error-threshold", &error_threshold,
|
||||
"filter-alternative-surround", &filter_alternative_surround,
|
||||
"filter-epsilon", &filter_epsilon,
|
||||
"filter-iteration-count", &filter_iteration_count,
|
||||
"filter-percent", &filter_percent,
|
||||
"filter-secondary-surround", &filter_secondary_surround,
|
||||
"filter-surround", &filter_surround,
|
||||
"keep-knees", &keep_knees,
|
||||
"line-reversion-threshold", &line_reversion_threshold,
|
||||
"line-threshold", &line_threshold,
|
||||
"reparametrize-improvement", &reparameterize_improvement,
|
||||
"reparametrize-threshold", &reparameterize_threshold,
|
||||
"subdivide-search", &subdivide_search,
|
||||
"subdivide-surround", &subdivide_surround,
|
||||
"subdivide-threshold", &subdivide_threshold,
|
||||
"tangent-surround", &tangent_surround,
|
||||
NULL);
|
||||
}
|
||||
|
||||
/* Fit the list of curves CURVE_LIST to a list of splines, and return
|
||||
|
@ -19,6 +19,8 @@
|
||||
#ifndef FIT_H
|
||||
#define FIT_H
|
||||
|
||||
#include "libpika/pika.h"
|
||||
|
||||
#include "pxl-outline.h"
|
||||
#include "spline.h"
|
||||
|
||||
@ -47,8 +49,7 @@ extern unsigned tangent_surround;
|
||||
|
||||
|
||||
/* Fit splines and lines to LIST. */
|
||||
extern spline_list_array_type fitted_splines (pixel_outline_list_type list);
|
||||
void fit_set_params(SELVALS *);
|
||||
void fit_set_default_params(SELVALS *);
|
||||
extern spline_list_array_type fitted_splines (pixel_outline_list_type list);
|
||||
void fit_set_params (PikaProcedureConfig *config);
|
||||
|
||||
#endif /* not FIT_H */
|
||||
|
@ -6,7 +6,6 @@ plugin_sources = [
|
||||
'fit.c',
|
||||
'math.c',
|
||||
'pxl-outline.c',
|
||||
'selection-to-path-dialog.c',
|
||||
'selection-to-path.c',
|
||||
'spline.c',
|
||||
'vector.c',
|
||||
|
@ -81,14 +81,11 @@ static PikaValueArray * sel2path_run (PikaProcedure *procedu
|
||||
PikaImage *image,
|
||||
gint n_drawables,
|
||||
PikaDrawable **drawables,
|
||||
const PikaValueArray *args,
|
||||
PikaProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
|
||||
static gint sel2path_dialog (SELVALS *sels);
|
||||
static void sel2path_response (GtkWidget *widget,
|
||||
gint response_id,
|
||||
gpointer data);
|
||||
static void dialog_print_selVals (SELVALS *sels);
|
||||
static gint sel2path_dialog (PikaProcedure *procedure,
|
||||
PikaProcedureConfig *config);
|
||||
static gboolean sel2path (PikaImage *image);
|
||||
|
||||
|
||||
@ -100,9 +97,7 @@ DEFINE_STD_SET_I18N
|
||||
|
||||
static gint sel_x1, sel_y1, sel_x2, sel_y2;
|
||||
static gint has_sel, sel_width, sel_height;
|
||||
static SELVALS selVals;
|
||||
static GeglSampler *sel_sampler;
|
||||
static gboolean retVal = TRUE; /* Toggle if cancel button clicked */
|
||||
|
||||
|
||||
static void
|
||||
@ -145,8 +140,8 @@ sel2path_create_procedure (PikaPlugIn *plug_in,
|
||||
PIKA_PROCEDURE_SENSITIVE_NO_DRAWABLES);
|
||||
|
||||
pika_procedure_set_documentation (procedure,
|
||||
"Converts a selection to a path",
|
||||
"Converts a selection to a path",
|
||||
_("Converts a selection to a path"),
|
||||
_("Converts a selection to a path"),
|
||||
name);
|
||||
pika_procedure_set_attribution (procedure,
|
||||
"Andy Thomas",
|
||||
@ -154,122 +149,160 @@ sel2path_create_procedure (PikaPlugIn *plug_in,
|
||||
"1999");
|
||||
|
||||
PIKA_PROC_ARG_DOUBLE (procedure, "align-threshold",
|
||||
"Align threshold",
|
||||
"Align threshold",
|
||||
_("_Align Threshold"),
|
||||
_("If two endpoints are closer than this, "
|
||||
"they are made to be equal."),
|
||||
0.2, 2.0, 0.5,
|
||||
G_PARAM_READWRITE);
|
||||
|
||||
PIKA_PROC_ARG_DOUBLE (procedure, "corner-always-threshold",
|
||||
"Corner always threshold",
|
||||
"Corner always threshold",
|
||||
_("Corner Al_ways Threshold"),
|
||||
_("If the angle defined by a point and its predecessors "
|
||||
"and successors is smaller than this, it's a corner, "
|
||||
"even if it's within 'corner_surround' pixels of a "
|
||||
"point with a smaller angle."),
|
||||
30, 180, 60.0,
|
||||
G_PARAM_READWRITE);
|
||||
|
||||
PIKA_PROC_ARG_INT (procedure, "corner-surround",
|
||||
"Corner surround",
|
||||
"Corner surround",
|
||||
_("Corner _Surround"),
|
||||
_("Number of points to consider when determining if a "
|
||||
"point is a corner or not."),
|
||||
3, 8, 4,
|
||||
G_PARAM_READWRITE);
|
||||
|
||||
PIKA_PROC_ARG_DOUBLE (procedure, "corner-threshold",
|
||||
"Corner threshold",
|
||||
"Corner threshold",
|
||||
_("Cor_ner Threshold"),
|
||||
_("If a point, its predecessors, and its successors "
|
||||
"define an angle smaller than this, it's a corner."),
|
||||
0, 180, 100.0,
|
||||
G_PARAM_READWRITE);
|
||||
|
||||
PIKA_PROC_ARG_DOUBLE (procedure, "error-threshold",
|
||||
"Error threshold",
|
||||
"Error threshold",
|
||||
_("Error Thres_hold"),
|
||||
_("Amount of error at which a fitted spline is "
|
||||
"unacceptable. If any pixel is further away "
|
||||
"than this from the fitted curve, we try again."),
|
||||
0.2, 10, 0.4,
|
||||
G_PARAM_READWRITE);
|
||||
|
||||
PIKA_PROC_ARG_INT (procedure, "filter-alternative-surround",
|
||||
"Filter alternative surround",
|
||||
"Filter alternative surround",
|
||||
_("_Filter Alternative Surround"),
|
||||
_("A second number of adjacent points to consider "
|
||||
"when filtering."),
|
||||
1, 10, 1,
|
||||
G_PARAM_READWRITE);
|
||||
|
||||
PIKA_PROC_ARG_DOUBLE (procedure, "filter-epsilon",
|
||||
"Filter epsilon",
|
||||
"Filter epsilon",
|
||||
_("Filter E_psilon"),
|
||||
_("If the angles between the vectors produced by "
|
||||
"filter_surround and filter_alternative_surround "
|
||||
"points differ by more than this, use the one from "
|
||||
"filter_alternative_surround."),
|
||||
5, 40, 10.0,
|
||||
G_PARAM_READWRITE);
|
||||
|
||||
PIKA_PROC_ARG_INT (procedure, "filter-iteration-count",
|
||||
"Filter iteration count",
|
||||
"Filter iteration count",
|
||||
_("Filter Iteration Co_unt"),
|
||||
_("Number of times to smooth original data points. "
|
||||
"Increasing this number dramatically --- to 50 or "
|
||||
"so --- can produce vastly better results. But if "
|
||||
"any points that 'should' be corners aren't found, "
|
||||
"the curve goes to hell around that point."),
|
||||
4, 70, 4,
|
||||
G_PARAM_READWRITE);
|
||||
|
||||
PIKA_PROC_ARG_DOUBLE (procedure, "filter-percent",
|
||||
"Filter percent",
|
||||
"Filter percent",
|
||||
_("Filt_er Percent"),
|
||||
_("To produce the new point, use the old point plus "
|
||||
"this times the neighbors."),
|
||||
0, 1, 0.33,
|
||||
G_PARAM_READWRITE);
|
||||
|
||||
PIKA_PROC_ARG_INT (procedure, "filter-secondary-surround",
|
||||
"Filter secondary surround",
|
||||
"Filter secondary surround",
|
||||
_("Filter Secondar_y Surround"),
|
||||
_("Number of adjacent points to consider if "
|
||||
"'filter_surround' points defines a straight line."),
|
||||
3, 10, 3,
|
||||
G_PARAM_READWRITE);
|
||||
|
||||
PIKA_PROC_ARG_INT (procedure, "filter-surround",
|
||||
"Filter surround",
|
||||
"Filter surround",
|
||||
_("Filter Surroun_d"),
|
||||
_("Number of adjacent points to consider when filtering."),
|
||||
2, 10, 2,
|
||||
G_PARAM_READWRITE);
|
||||
|
||||
PIKA_PROC_ARG_BOOLEAN (procedure, "keep-knees",
|
||||
"Keep knees",
|
||||
"Keep knees",
|
||||
_("_Keep Knees"),
|
||||
_("Says whether or not to remove 'knee' "
|
||||
"points after finding the outline."),
|
||||
FALSE,
|
||||
G_PARAM_READWRITE);
|
||||
|
||||
PIKA_PROC_ARG_DOUBLE (procedure, "line-reversion-threshold",
|
||||
"Line reversion threshold",
|
||||
"Line reversion threshold",
|
||||
_("_Line Reversion Threshold"),
|
||||
_("If a spline is closer to a straight line than this, "
|
||||
"it remains a straight line, even if it would otherwise "
|
||||
"be changed back to a curve. This is weighted by the "
|
||||
"square of the curve length, to make shorter curves "
|
||||
"more likely to be reverted."),
|
||||
0.01, 0.2, 0.01,
|
||||
G_PARAM_READWRITE);
|
||||
|
||||
PIKA_PROC_ARG_DOUBLE (procedure, "line-threshold",
|
||||
"Line threshold",
|
||||
"Line threshold",
|
||||
_("L_ine Threshold"),
|
||||
_("How many pixels (on the average) a spline can "
|
||||
"diverge from the line determined by its endpoints "
|
||||
"before it is changed to a straight line."),
|
||||
0.2, 4, 0.5,
|
||||
G_PARAM_READWRITE);
|
||||
|
||||
PIKA_PROC_ARG_DOUBLE (procedure, "reparametrize-improvement",
|
||||
"Reparametrize improvement",
|
||||
"Reparametrize improvement",
|
||||
_("Reparametri_ze Improvement"),
|
||||
_("If reparameterization doesn't improve the fit by this "
|
||||
"much percent, stop doing it. ""Amount of error at which "
|
||||
"it is pointless to reparameterize."),
|
||||
0, 1, 0.01,
|
||||
G_PARAM_READWRITE);
|
||||
|
||||
PIKA_PROC_ARG_DOUBLE (procedure, "reparametrize-threshold",
|
||||
"Reparametrize threshold",
|
||||
"Reparametrize threshold",
|
||||
_("Repara_metrize Threshold"),
|
||||
_("Amount of error at which it is pointless to reparameterize. "
|
||||
"This happens, for example, when we are trying to fit the "
|
||||
"outline of the outside of an 'O' with a single spline. "
|
||||
"The initial fit is not good enough for the Newton-Raphson "
|
||||
"iteration to improve it. It may be that it would be better "
|
||||
"to detect the cases where we didn't find any corners."),
|
||||
1, 50, 1.0,
|
||||
G_PARAM_READWRITE);
|
||||
|
||||
PIKA_PROC_ARG_DOUBLE (procedure, "subdivide-search",
|
||||
"Subdivide search",
|
||||
"Subdivide search",
|
||||
_("Subdi_vide Search"),
|
||||
_("Percentage of the curve away from the worst point "
|
||||
"to look for a better place to subdivide."),
|
||||
0.05, 1, 0.1,
|
||||
G_PARAM_READWRITE);
|
||||
|
||||
PIKA_PROC_ARG_INT (procedure, "subdivide-surround",
|
||||
"Subdivide surround",
|
||||
"Subdivide surround",
|
||||
_("Su_bdivide Surround"),
|
||||
_("Number of points to consider when deciding whether "
|
||||
"a given point is a better place to subdivide."),
|
||||
2, 10, 4,
|
||||
G_PARAM_READWRITE);
|
||||
|
||||
PIKA_PROC_ARG_DOUBLE (procedure, "subdivide-threshold",
|
||||
"Subdivide threshold",
|
||||
"Subdivide threshold",
|
||||
_("Subdivide Th_reshold"),
|
||||
_("How many pixels a point can diverge from a straight "
|
||||
"line and still be considered a better place to "
|
||||
"subdivide."),
|
||||
0.01, 1, 0.03,
|
||||
G_PARAM_READWRITE);
|
||||
|
||||
PIKA_PROC_ARG_INT (procedure, "tangent-surround",
|
||||
"Tangent surround",
|
||||
"Tangent surround",
|
||||
_("_Tangent Surround"),
|
||||
_("Number of points to look at on either side of a "
|
||||
"point when computing the approximation to the "
|
||||
"tangent at that point."),
|
||||
2, 10, 3,
|
||||
G_PARAM_READWRITE);
|
||||
}
|
||||
@ -283,7 +316,7 @@ sel2path_run (PikaProcedure *procedure,
|
||||
PikaImage *image,
|
||||
gint n_drawables,
|
||||
PikaDrawable **drawables,
|
||||
const PikaValueArray *args,
|
||||
PikaProcedureConfig *config,
|
||||
gpointer run_data)
|
||||
{
|
||||
gegl_init (NULL, NULL);
|
||||
@ -297,171 +330,133 @@ sel2path_run (PikaProcedure *procedure,
|
||||
NULL);
|
||||
}
|
||||
|
||||
fit_set_default_params (&selVals);
|
||||
if (run_mode == PIKA_RUN_INTERACTIVE &&
|
||||
! sel2path_dialog (procedure, config))
|
||||
return pika_procedure_new_return_values (procedure,
|
||||
PIKA_PDB_CANCEL,
|
||||
NULL);
|
||||
|
||||
switch (run_mode)
|
||||
{
|
||||
case PIKA_RUN_INTERACTIVE:
|
||||
if (pika_get_data_size (PLUG_IN_PROC) > 0)
|
||||
pika_get_data (PLUG_IN_PROC, &selVals);
|
||||
|
||||
if (! sel2path_dialog (&selVals))
|
||||
return pika_procedure_new_return_values (procedure,
|
||||
PIKA_PDB_CANCEL,
|
||||
NULL);
|
||||
|
||||
/* Get the current settings */
|
||||
fit_set_params (&selVals);
|
||||
break;
|
||||
|
||||
case PIKA_RUN_NONINTERACTIVE:
|
||||
selVals.align_threshold = PIKA_VALUES_GET_DOUBLE (args, 0);
|
||||
selVals.corner_always_threshold = PIKA_VALUES_GET_DOUBLE (args, 1);
|
||||
selVals.corner_surround = PIKA_VALUES_GET_INT (args, 2);
|
||||
selVals.corner_threshold = PIKA_VALUES_GET_DOUBLE (args, 3);
|
||||
selVals.error_threshold = PIKA_VALUES_GET_DOUBLE (args, 4);
|
||||
selVals.filter_alternative_surround = PIKA_VALUES_GET_INT (args, 5);
|
||||
selVals.filter_epsilon = PIKA_VALUES_GET_DOUBLE (args, 6);
|
||||
selVals.filter_iteration_count = PIKA_VALUES_GET_INT (args, 7);
|
||||
selVals.filter_percent = PIKA_VALUES_GET_DOUBLE (args, 8);
|
||||
selVals.filter_secondary_surround = PIKA_VALUES_GET_INT (args, 9);
|
||||
selVals.filter_surround = PIKA_VALUES_GET_INT (args, 10);
|
||||
selVals.keep_knees = PIKA_VALUES_GET_BOOLEAN (args, 11);
|
||||
selVals.line_reversion_threshold = PIKA_VALUES_GET_DOUBLE (args, 12);
|
||||
selVals.line_threshold = PIKA_VALUES_GET_DOUBLE (args, 13);
|
||||
selVals.reparameterize_improvement = PIKA_VALUES_GET_DOUBLE (args, 14);
|
||||
selVals.reparameterize_threshold = PIKA_VALUES_GET_DOUBLE (args, 15);
|
||||
selVals.subdivide_search = PIKA_VALUES_GET_DOUBLE (args, 16);
|
||||
selVals.subdivide_surround = PIKA_VALUES_GET_INT (args, 17);
|
||||
selVals.subdivide_threshold = PIKA_VALUES_GET_DOUBLE (args, 18);
|
||||
selVals.tangent_surround = PIKA_VALUES_GET_INT (args, 19);
|
||||
|
||||
fit_set_params (&selVals);
|
||||
break;
|
||||
|
||||
case PIKA_RUN_WITH_LAST_VALS:
|
||||
if (pika_get_data_size (PLUG_IN_PROC) > 0)
|
||||
{
|
||||
pika_get_data (PLUG_IN_PROC, &selVals);
|
||||
|
||||
/* Set up the last values */
|
||||
fit_set_params (&selVals);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
fit_set_params (config);
|
||||
|
||||
if (! sel2path (image))
|
||||
return pika_procedure_new_return_values (procedure,
|
||||
PIKA_PDB_EXECUTION_ERROR,
|
||||
NULL);
|
||||
|
||||
dialog_print_selVals (&selVals);
|
||||
|
||||
if (run_mode == PIKA_RUN_INTERACTIVE)
|
||||
pika_set_data (PLUG_IN_PROC, &selVals, sizeof(SELVALS));
|
||||
|
||||
return pika_procedure_new_return_values (procedure, PIKA_PDB_SUCCESS, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
dialog_print_selVals (SELVALS *sels)
|
||||
{
|
||||
#if 0
|
||||
printf ("selVals.align_threshold %g\n", selVals.align_threshold);
|
||||
printf ("selVals.corner_always_threshol %g\n", selVals.corner_always_threshold);
|
||||
printf ("selVals.corner_surround %g\n", selVals.corner_surround);
|
||||
printf ("selVals.corner_threshold %g\n", selVals.corner_threshold);
|
||||
printf ("selVals.error_threshold %g\n", selVals.error_threshold);
|
||||
printf ("selVals.filter_alternative_surround %g\n", selVals.filter_alternative_surround);
|
||||
printf ("selVals.filter_epsilon %g\n", selVals.filter_epsilon);
|
||||
printf ("selVals.filter_iteration_count %g\n", selVals.filter_iteration_count);
|
||||
printf ("selVals.filter_percent %g\n", selVals.filter_percent);
|
||||
printf ("selVals.filter_secondary_surround %g\n", selVals.filter_secondary_surround);
|
||||
printf ("selVals.filter_surround %g\n", selVals.filter_surround);
|
||||
printf ("selVals.keep_knees %d\n", selVals.keep_knees);
|
||||
printf ("selVals.line_reversion_threshold %g\n", selVals.line_reversion_threshold);
|
||||
printf ("selVals.line_threshold %g\n", selVals.line_threshold);
|
||||
printf ("selVals.reparameterize_improvement %g\n", selVals.reparameterize_improvement);
|
||||
printf ("selVals.reparameterize_threshold %g\n", selVals.reparameterize_threshold);
|
||||
printf ("selVals.subdivide_search %g\n" selVals.subdivide_search);
|
||||
printf ("selVals.subdivide_surround %g\n", selVals.subdivide_surround);
|
||||
printf ("selVals.subdivide_threshold %g\n", selVals.subdivide_threshold);
|
||||
printf ("selVals.tangent_surround %g\n", selVals.tangent_surround);
|
||||
#endif /* 0 */
|
||||
}
|
||||
|
||||
/* Build the dialog up. This was the hard part! */
|
||||
static gint
|
||||
sel2path_dialog (SELVALS *sels)
|
||||
sel2path_dialog (PikaProcedure *procedure,
|
||||
PikaProcedureConfig *config)
|
||||
{
|
||||
GtkWidget *dlg;
|
||||
GtkWidget *table;
|
||||
|
||||
retVal = FALSE;
|
||||
GtkWidget *dialog;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *scrolled_win;
|
||||
gboolean run;
|
||||
|
||||
pika_ui_init (PLUG_IN_BINARY);
|
||||
|
||||
dlg = pika_dialog_new (_("Selection to Path Advanced Settings"),
|
||||
PLUG_IN_ROLE,
|
||||
NULL, 0,
|
||||
pika_standard_help_func, PLUG_IN_PROC,
|
||||
dialog = pika_procedure_dialog_new (procedure,
|
||||
PIKA_PROCEDURE_CONFIG (config),
|
||||
_("Selection to Path Advanced Settings"));
|
||||
|
||||
_("_Reset"), RESPONSE_RESET,
|
||||
_("_Cancel"), GTK_RESPONSE_CANCEL,
|
||||
_("_OK"), GTK_RESPONSE_OK,
|
||||
|
||||
NULL);
|
||||
|
||||
pika_dialog_set_alternative_button_order (GTK_DIALOG (dlg),
|
||||
pika_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
|
||||
RESPONSE_RESET,
|
||||
GTK_RESPONSE_OK,
|
||||
GTK_RESPONSE_CANCEL,
|
||||
-1);
|
||||
|
||||
pika_window_set_transient (GTK_WINDOW (dlg));
|
||||
pika_window_set_transient (GTK_WINDOW (dialog));
|
||||
|
||||
g_signal_connect (dlg, "response",
|
||||
G_CALLBACK (sel2path_response),
|
||||
NULL);
|
||||
g_signal_connect (dlg, "destroy",
|
||||
G_CALLBACK (gtk_main_quit),
|
||||
NULL);
|
||||
pika_procedure_dialog_get_scale_entry (PIKA_PROCEDURE_DIALOG (dialog),
|
||||
"align-threshold", 1.0);
|
||||
pika_procedure_dialog_get_scale_entry (PIKA_PROCEDURE_DIALOG (dialog),
|
||||
"corner-always-threshold", 1.0);
|
||||
pika_procedure_dialog_get_scale_entry (PIKA_PROCEDURE_DIALOG (dialog),
|
||||
"corner-surround", 1.0);
|
||||
pika_procedure_dialog_get_scale_entry (PIKA_PROCEDURE_DIALOG (dialog),
|
||||
"corner-threshold", 1.0);
|
||||
pika_procedure_dialog_get_scale_entry (PIKA_PROCEDURE_DIALOG (dialog),
|
||||
"error-threshold", 1.0);
|
||||
pika_procedure_dialog_get_scale_entry (PIKA_PROCEDURE_DIALOG (dialog),
|
||||
"filter-alternative-surround", 1.0);
|
||||
pika_procedure_dialog_get_scale_entry (PIKA_PROCEDURE_DIALOG (dialog),
|
||||
"filter-epsilon", 1.0);
|
||||
pika_procedure_dialog_get_scale_entry (PIKA_PROCEDURE_DIALOG (dialog),
|
||||
"filter-iteration-count", 1.0);
|
||||
pika_procedure_dialog_get_scale_entry (PIKA_PROCEDURE_DIALOG (dialog),
|
||||
"filter-percent", 1.0);
|
||||
pika_procedure_dialog_get_scale_entry (PIKA_PROCEDURE_DIALOG (dialog),
|
||||
"filter-secondary-surround", 1.0);
|
||||
pika_procedure_dialog_get_scale_entry (PIKA_PROCEDURE_DIALOG (dialog),
|
||||
"filter-surround", 1.0);
|
||||
pika_procedure_dialog_get_scale_entry (PIKA_PROCEDURE_DIALOG (dialog),
|
||||
"line-reversion-threshold", 1.0);
|
||||
pika_procedure_dialog_get_scale_entry (PIKA_PROCEDURE_DIALOG (dialog),
|
||||
"line-threshold", 1.0);
|
||||
pika_procedure_dialog_get_scale_entry (PIKA_PROCEDURE_DIALOG (dialog),
|
||||
"reparametrize-improvement", 1.0);
|
||||
pika_procedure_dialog_get_scale_entry (PIKA_PROCEDURE_DIALOG (dialog),
|
||||
"reparametrize-threshold", 1.0);
|
||||
pika_procedure_dialog_get_scale_entry (PIKA_PROCEDURE_DIALOG (dialog),
|
||||
"subdivide-search", 1.0);
|
||||
pika_procedure_dialog_get_scale_entry (PIKA_PROCEDURE_DIALOG (dialog),
|
||||
"subdivide-surround", 1.0);
|
||||
pika_procedure_dialog_get_scale_entry (PIKA_PROCEDURE_DIALOG (dialog),
|
||||
"subdivide-threshold", 1.0);
|
||||
pika_procedure_dialog_get_scale_entry (PIKA_PROCEDURE_DIALOG (dialog),
|
||||
"tangent-surround", 1.0);
|
||||
|
||||
table = dialog_create_selection_area (sels);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (table), 12);
|
||||
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))),
|
||||
table, TRUE, TRUE, 0);
|
||||
gtk_widget_show (table);
|
||||
vbox = pika_procedure_dialog_fill_box (PIKA_PROCEDURE_DIALOG (dialog),
|
||||
"selection-to-path-box",
|
||||
"align-threshold",
|
||||
"corner-always-threshold",
|
||||
"corner-surround",
|
||||
"corner-threshold",
|
||||
"error-threshold",
|
||||
"filter-alternative-surround",
|
||||
"filter-epsilon",
|
||||
"filter-iteration-count",
|
||||
"filter-percent",
|
||||
"filter-secondary-surround",
|
||||
"filter-surround",
|
||||
"keep-knees",
|
||||
"line-reversion-threshold",
|
||||
"line-threshold",
|
||||
"reparametrize-improvement",
|
||||
"reparametrize-threshold",
|
||||
"subdivide-search",
|
||||
"subdivide-surround",
|
||||
"subdivide-threshold",
|
||||
"tangent-surround",
|
||||
NULL);
|
||||
gtk_box_set_spacing (GTK_BOX (vbox), 12);
|
||||
|
||||
gtk_widget_show (dlg);
|
||||
scrolled_win = pika_procedure_dialog_fill_scrolled_window (PIKA_PROCEDURE_DIALOG (dialog),
|
||||
"scrollwin",
|
||||
"selection-to-path-box");
|
||||
gtk_widget_set_size_request (scrolled_win, 400, 400);
|
||||
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win),
|
||||
GTK_SHADOW_NONE);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win),
|
||||
GTK_POLICY_NEVER,
|
||||
GTK_POLICY_ALWAYS);
|
||||
gtk_scrolled_window_set_overlay_scrolling (GTK_SCROLLED_WINDOW (scrolled_win),
|
||||
FALSE);
|
||||
|
||||
gtk_main ();
|
||||
pika_procedure_dialog_fill (PIKA_PROCEDURE_DIALOG (dialog),
|
||||
"scrollwin",
|
||||
NULL);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
gtk_widget_show (dialog);
|
||||
|
||||
static void
|
||||
sel2path_response (GtkWidget *widget,
|
||||
gint response_id,
|
||||
gpointer data)
|
||||
{
|
||||
switch (response_id)
|
||||
{
|
||||
case RESPONSE_RESET:
|
||||
reset_adv_dialog ();
|
||||
fit_set_params (&selVals);
|
||||
break;
|
||||
run = pika_procedure_dialog_run (PIKA_PROCEDURE_DIALOG (dialog));
|
||||
|
||||
case GTK_RESPONSE_OK:
|
||||
retVal = TRUE;
|
||||
gtk_widget_destroy (dialog);
|
||||
|
||||
default:
|
||||
gtk_widget_destroy (widget);
|
||||
break;
|
||||
}
|
||||
return run;
|
||||
}
|
||||
|
||||
guchar
|
||||
|
Reference in New Issue
Block a user