1 /** \file
2 * Pencil event context implementation.
3 */
5 /*
6 * Authors:
7 * Lauris Kaplinski <lauris@kaplinski.com>
8 * bulia byak <buliabyak@users.sf.net>
9 *
10 * Copyright (C) 2000 Lauris Kaplinski
11 * Copyright (C) 2000-2001 Ximian, Inc.
12 * Copyright (C) 2002 Lauris Kaplinski
13 * Copyright (C) 2004 Monash University
14 *
15 * Released under GNU GPL, read the file 'COPYING' for more information
16 */
18 #include <gdk/gdkkeysyms.h>
20 #include "pencil-context.h"
21 #include "desktop.h"
22 #include "desktop-handles.h"
23 #include "selection.h"
24 #include "selection-chemistry.h"
25 #include "draw-anchor.h"
26 #include "message-stack.h"
27 #include "message-context.h"
28 #include "modifier-fns.h"
29 #include "sp-path.h"
30 #include "prefs-utils.h"
31 #include "snap.h"
32 #include "pixmaps/cursor-pencil.xpm"
33 #include "display/bezier-utils.h"
34 #include "display/canvas-bpath.h"
35 #include <glibmm/i18n.h>
36 #include "libnr/in-svg-plane.h"
37 #include "context-fns.h"
38 #include "sp-namedview.h"
39 #include "xml/repr.h"
40 #include "document.h"
41 #include "desktop-style.h"
42 #include "macros.h"
43 #include "display/curve.h"
45 static void sp_pencil_context_class_init(SPPencilContextClass *klass);
46 static void sp_pencil_context_init(SPPencilContext *pc);
47 static void sp_pencil_context_setup(SPEventContext *ec);
48 static void sp_pencil_context_dispose(GObject *object);
50 static gint sp_pencil_context_root_handler(SPEventContext *event_context, GdkEvent *event);
51 static gint pencil_handle_button_press(SPPencilContext *const pc, GdkEventButton const &bevent);
52 static gint pencil_handle_motion_notify(SPPencilContext *const pc, GdkEventMotion const &mevent);
53 static gint pencil_handle_button_release(SPPencilContext *const pc, GdkEventButton const &revent);
54 static gint pencil_handle_key_press(SPPencilContext *const pc, guint const keyval, guint const state);
56 static void spdc_set_startpoint(SPPencilContext *pc, NR::Point const p);
57 static void spdc_set_endpoint(SPPencilContext *pc, NR::Point const p);
58 static void spdc_finish_endpoint(SPPencilContext *pc);
59 static void spdc_add_freehand_point(SPPencilContext *pc, NR::Point p, guint state);
60 static void fit_and_split(SPPencilContext *pc);
63 static SPDrawContextClass *pencil_parent_class;
64 static NR::Point pencil_drag_origin_w(0, 0);
65 static bool pencil_within_tolerance = false;
67 /**
68 * Register SPPencilContext class with Gdk and return its type number.
69 */
70 GType
71 sp_pencil_context_get_type()
72 {
73 static GType type = 0;
74 if (!type) {
75 GTypeInfo info = {
76 sizeof(SPPencilContextClass),
77 NULL, NULL,
78 (GClassInitFunc) sp_pencil_context_class_init,
79 NULL, NULL,
80 sizeof(SPPencilContext),
81 4,
82 (GInstanceInitFunc) sp_pencil_context_init,
83 NULL, /* value_table */
84 };
85 type = g_type_register_static(SP_TYPE_DRAW_CONTEXT, "SPPencilContext", &info, (GTypeFlags)0);
86 }
87 return type;
88 }
90 /**
91 * Initialize SPPencilContext vtable.
92 */
93 static void
94 sp_pencil_context_class_init(SPPencilContextClass *klass)
95 {
96 GObjectClass *object_class;
97 SPEventContextClass *event_context_class;
99 object_class = (GObjectClass *) klass;
100 event_context_class = (SPEventContextClass *) klass;
102 pencil_parent_class = (SPDrawContextClass*)g_type_class_peek_parent(klass);
104 object_class->dispose = sp_pencil_context_dispose;
106 event_context_class->setup = sp_pencil_context_setup;
107 event_context_class->root_handler = sp_pencil_context_root_handler;
108 }
110 /**
111 * Callback to initialize SPPencilContext object.
112 */
113 static void
114 sp_pencil_context_init(SPPencilContext *pc)
115 {
116 SPEventContext *event_context = SP_EVENT_CONTEXT(pc);
118 event_context->cursor_shape = cursor_pencil_xpm;
119 event_context->hot_x = 4;
120 event_context->hot_y = 4;
122 pc->npoints = 0;
123 pc->state = SP_PENCIL_CONTEXT_IDLE;
124 pc->req_tangent = NR::Point(0, 0);
125 }
127 /**
128 * Callback to setup SPPencilContext object.
129 */
130 static void
131 sp_pencil_context_setup(SPEventContext *ec)
132 {
133 if (prefs_get_int_attribute("tools.freehand.pencil", "selcue", 0) != 0) {
134 ec->enableSelectionCue();
135 }
137 if (((SPEventContextClass *) pencil_parent_class)->setup) {
138 ((SPEventContextClass *) pencil_parent_class)->setup(ec);
139 }
141 SPPencilContext *const pc = SP_PENCIL_CONTEXT(ec);
142 pc->is_drawing = false;
144 pc->anchor_statusbar = false;
145 }
147 static void
148 sp_pencil_context_dispose(GObject *object)
149 {
150 G_OBJECT_CLASS(pencil_parent_class)->dispose(object);
151 }
153 /** Snaps new node relative to the previous node. */
154 static void
155 spdc_endpoint_snap(SPPencilContext const *pc, NR::Point &p, guint const state)
156 {
157 if ((state & GDK_CONTROL_MASK)) { //CTRL enables constrained snapping
158 spdc_endpoint_snap_rotation(pc, p, pc->p[0], state);
159 } else {
160 if (!(state & GDK_SHIFT_MASK)) { //SHIFT disables all snapping, except the angular snapping above
161 //After all, the user explicitely asked for angular snapping by
162 //pressing CTRL
163 spdc_endpoint_snap_free(pc, p, state);
164 }
165 }
166 }
168 /**
169 * Callback for handling all pencil context events.
170 */
171 gint
172 sp_pencil_context_root_handler(SPEventContext *const ec, GdkEvent *event)
173 {
174 SPPencilContext *const pc = SP_PENCIL_CONTEXT(ec);
176 gint ret = FALSE;
178 switch (event->type) {
179 case GDK_BUTTON_PRESS:
180 ret = pencil_handle_button_press(pc, event->button);
181 break;
183 case GDK_MOTION_NOTIFY:
184 ret = pencil_handle_motion_notify(pc, event->motion);
185 break;
187 case GDK_BUTTON_RELEASE:
188 ret = pencil_handle_button_release(pc, event->button);
189 break;
191 case GDK_KEY_PRESS:
192 ret = pencil_handle_key_press(pc, get_group0_keyval (&event->key), event->key.state);
193 break;
195 default:
196 break;
197 }
199 if (!ret) {
200 gint (*const parent_root_handler)(SPEventContext *, GdkEvent *)
201 = ((SPEventContextClass *) pencil_parent_class)->root_handler;
202 if (parent_root_handler) {
203 ret = parent_root_handler(ec, event);
204 }
205 }
207 return ret;
208 }
210 static gint
211 pencil_handle_button_press(SPPencilContext *const pc, GdkEventButton const &bevent)
212 {
213 gint ret = FALSE;
214 SPEventContext *event_context = SP_EVENT_CONTEXT(pc);
215 if ( bevent.button == 1 && !event_context->space_panning) {
217 SPDrawContext *dc = SP_DRAW_CONTEXT (pc);
218 SPDesktop *desktop = SP_EVENT_CONTEXT_DESKTOP(dc);
219 Inkscape::Selection *selection = sp_desktop_selection(desktop);
221 if (Inkscape::have_viable_layer(desktop, dc->_message_context) == false) {
222 return TRUE;
223 }
225 NR::Point const button_w(bevent.x, bevent.y);
227 /* Find desktop coordinates */
228 NR::Point p = pc->desktop->w2d(button_w);
230 /* Test whether we hit any anchor. */
231 SPDrawAnchor *anchor = spdc_test_inside(pc, button_w);
233 pencil_drag_origin_w = NR::Point(bevent.x,bevent.y);
234 pencil_within_tolerance = true;
236 switch (pc->state) {
237 case SP_PENCIL_CONTEXT_ADDLINE:
238 /* Current segment will be finished with release */
239 ret = TRUE;
240 break;
241 default:
242 /* Set first point of sequence */
243 if (bevent.state & GDK_CONTROL_MASK) {
244 freehand_create_single_dot(event_context, p, "tools.freehand.pencil", bevent.state);
245 ret = true;
246 break;
247 }
248 if (anchor) {
249 p = anchor->dp;
250 desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Continuing selected path"));
251 } else {
253 if (!(bevent.state & GDK_SHIFT_MASK)) {
255 // This is the first click of a new curve; deselect item so that
256 // this curve is not combined with it (unless it is drawn from its
257 // anchor, which is handled by the sibling branch above)
258 selection->clear();
259 desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Creating new path"));
260 SnapManager &m = desktop->namedview->snap_manager;
261 m.setup(desktop);
262 m.freeSnapReturnByRef(Inkscape::Snapper::SNAPPOINT_NODE, p);
263 } else if (selection->singleItem() && SP_IS_PATH(selection->singleItem())) {
264 desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Appending to selected path"));
265 }
266 }
267 pc->sa = anchor;
268 spdc_set_startpoint(pc, p);
269 ret = TRUE;
270 break;
271 }
273 pc->is_drawing = true;
274 }
275 return ret;
276 }
278 static gint
279 pencil_handle_motion_notify(SPPencilContext *const pc, GdkEventMotion const &mevent)
280 {
281 if ((mevent.state & GDK_CONTROL_MASK) && (mevent.state & GDK_BUTTON1_MASK)) {
282 // mouse was accidentally moved during Ctrl+click;
283 // ignore the motion and create a single point
284 pc->is_drawing = false;
285 return TRUE;
286 }
287 gint ret = FALSE;
288 SPDesktop *const dt = pc->desktop;
290 SPEventContext *event_context = SP_EVENT_CONTEXT(pc);
291 if (event_context->space_panning || mevent.state & GDK_BUTTON2_MASK || mevent.state & GDK_BUTTON3_MASK) {
292 // allow scrolling
293 return FALSE;
294 }
296 if ( ( mevent.state & GDK_BUTTON1_MASK ) && !pc->grab && pc->is_drawing) {
297 /* Grab mouse, so release will not pass unnoticed */
298 pc->grab = SP_CANVAS_ITEM(dt->acetate);
299 sp_canvas_item_grab(pc->grab, ( GDK_KEY_PRESS_MASK | GDK_BUTTON_PRESS_MASK |
300 GDK_BUTTON_RELEASE_MASK |
301 GDK_POINTER_MOTION_MASK ),
302 NULL, mevent.time);
303 }
305 /* Find desktop coordinates */
306 NR::Point p = dt->w2d(NR::Point(mevent.x, mevent.y));
308 /* Test whether we hit any anchor. */
309 SPDrawAnchor *anchor = spdc_test_inside(pc, NR::Point(mevent.x, mevent.y));
311 if (pencil_within_tolerance) {
312 gint const tolerance = prefs_get_int_attribute_limited("options.dragtolerance",
313 "value", 0, 0, 100);
314 if ( NR::LInfty( NR::Point(mevent.x,mevent.y) - pencil_drag_origin_w ) < tolerance ) {
315 return FALSE; // Do not drag if we're within tolerance from origin.
316 }
317 }
319 // Once the user has moved farther than tolerance from the original location
320 // (indicating they intend to move the object, not click), then always process the
321 // motion notify coordinates as given (no snapping back to origin)
322 pencil_within_tolerance = false;
324 switch (pc->state) {
325 case SP_PENCIL_CONTEXT_ADDLINE:
326 /* Set red endpoint */
327 if (anchor) {
328 p = anchor->dp;
329 } else {
330 spdc_endpoint_snap(pc, p, mevent.state);
331 }
332 spdc_set_endpoint(pc, p);
333 ret = TRUE;
334 break;
335 default:
336 /* We may be idle or already freehand */
337 if ( mevent.state & GDK_BUTTON1_MASK && pc->is_drawing ) {
338 pc->state = SP_PENCIL_CONTEXT_FREEHAND;
339 if ( !pc->sa && !pc->green_anchor ) {
340 /* Create green anchor */
341 pc->green_anchor = sp_draw_anchor_new(pc, pc->green_curve, TRUE, pc->p[0]);
342 }
343 /** \todo
344 * fixme: I am not sure whether we want to snap to anchors
345 * in middle of freehand (Lauris)
346 */
347 if (anchor) {
348 p = anchor->dp;
349 } else if ((mevent.state & GDK_SHIFT_MASK) == 0) {
350 SnapManager &m = dt->namedview->snap_manager;
351 m.setup(dt, NULL);
352 m.freeSnapReturnByRef(Inkscape::Snapper::SNAPPOINT_NODE, p);
353 }
354 if ( pc->npoints != 0 ) { // buttonpress may have happened before we entered draw context!
355 spdc_add_freehand_point(pc, p, mevent.state);
356 ret = TRUE;
357 }
359 if (anchor && !pc->anchor_statusbar) {
360 pc->_message_context->set(Inkscape::NORMAL_MESSAGE, _("<b>Release</b> here to close and finish the path."));
361 pc->anchor_statusbar = true;
362 } else if (!anchor && pc->anchor_statusbar) {
363 pc->_message_context->clear();
364 pc->anchor_statusbar = false;
365 } else if (!anchor) {
366 pc->_message_context->set(Inkscape::NORMAL_MESSAGE, _("Drawing a freehand path"));
367 }
369 } else {
370 if (anchor && !pc->anchor_statusbar) {
371 pc->_message_context->set(Inkscape::NORMAL_MESSAGE, _("<b>Drag</b> to continue the path from this point."));
372 pc->anchor_statusbar = true;
373 } else if (!anchor && pc->anchor_statusbar) {
374 pc->_message_context->clear();
375 pc->anchor_statusbar = false;
376 }
377 }
378 break;
379 }
380 return ret;
381 }
383 static gint
384 pencil_handle_button_release(SPPencilContext *const pc, GdkEventButton const &revent)
385 {
386 gint ret = FALSE;
388 SPEventContext *event_context = SP_EVENT_CONTEXT(pc);
389 if ( revent.button == 1 && pc->is_drawing && !event_context->space_panning) {
390 SPDesktop *const dt = pc->desktop;
392 pc->is_drawing = false;
394 /* Find desktop coordinates */
395 NR::Point p = dt->w2d(NR::Point(revent.x, revent.y));
397 /* Test whether we hit any anchor. */
398 SPDrawAnchor *anchor = spdc_test_inside(pc, NR::Point(revent.x,
399 revent.y));
401 switch (pc->state) {
402 case SP_PENCIL_CONTEXT_IDLE:
403 /* Releasing button in idle mode means single click */
404 /* We have already set up start point/anchor in button_press */
405 if (!(revent.state & GDK_CONTROL_MASK)) {
406 // Ctrl+click creates a single point so only set context in ADDLINE mode when Ctrl isn't pressed
407 pc->state = SP_PENCIL_CONTEXT_ADDLINE;
408 }
409 ret = TRUE;
410 break;
411 case SP_PENCIL_CONTEXT_ADDLINE:
412 /* Finish segment now */
413 if (anchor) {
414 p = anchor->dp;
415 } else {
416 spdc_endpoint_snap(pc, p, revent.state);
417 }
418 pc->ea = anchor;
419 spdc_set_endpoint(pc, p);
420 spdc_finish_endpoint(pc);
421 pc->state = SP_PENCIL_CONTEXT_IDLE;
422 ret = TRUE;
423 break;
424 case SP_PENCIL_CONTEXT_FREEHAND:
425 /* Finish segment now */
426 /// \todo fixme: Clean up what follows (Lauris)
427 if (anchor) {
428 p = anchor->dp;
429 }
430 pc->ea = anchor;
431 /* Write curves to object */
433 dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Finishing freehand"));
435 spdc_concat_colors_and_flush(pc, FALSE);
436 pc->sa = NULL;
437 pc->ea = NULL;
438 if (pc->green_anchor) {
439 pc->green_anchor = sp_draw_anchor_destroy(pc->green_anchor);
440 }
441 pc->state = SP_PENCIL_CONTEXT_IDLE;
442 ret = TRUE;
443 break;
444 default:
445 break;
446 }
448 if (pc->grab) {
449 /* Release grab now */
450 sp_canvas_item_ungrab(pc->grab, revent.time);
451 pc->grab = NULL;
452 }
454 ret = TRUE;
455 }
456 return ret;
457 }
459 static void
460 pencil_cancel (SPPencilContext *const pc)
461 {
462 if (pc->grab) {
463 /* Release grab now */
464 sp_canvas_item_ungrab(pc->grab, 0);
465 pc->grab = NULL;
466 }
468 pc->is_drawing = false;
470 pc->state = SP_PENCIL_CONTEXT_IDLE;
472 pc->red_curve->reset();
473 sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(pc->red_bpath), NULL);
474 while (pc->green_bpaths) {
475 gtk_object_destroy(GTK_OBJECT(pc->green_bpaths->data));
476 pc->green_bpaths = g_slist_remove(pc->green_bpaths, pc->green_bpaths->data);
477 }
478 pc->green_curve->reset();
479 if (pc->green_anchor) {
480 pc->green_anchor = sp_draw_anchor_destroy(pc->green_anchor);
481 }
483 pc->_message_context->clear();
484 pc->_message_context->flash(Inkscape::NORMAL_MESSAGE, _("Drawing cancelled"));
486 sp_canvas_end_forced_full_redraws(pc->desktop->canvas);
487 }
490 static gint
491 pencil_handle_key_press(SPPencilContext *const pc, guint const keyval, guint const state)
492 {
493 gint ret = FALSE;
494 switch (keyval) {
495 case GDK_Up:
496 case GDK_Down:
497 case GDK_KP_Up:
498 case GDK_KP_Down:
499 // Prevent the zoom field from activation.
500 if (!mod_ctrl_only(state)) {
501 ret = TRUE;
502 }
503 break;
504 case GDK_Escape:
505 if (pc->npoints != 0) {
506 // if drawing, cancel, otherwise pass it up for deselecting
507 if (pc->is_drawing) {
508 pencil_cancel (pc);
509 ret = TRUE;
510 }
511 }
512 break;
513 case GDK_z:
514 case GDK_Z:
515 if (mod_ctrl_only(state) && pc->npoints != 0) {
516 // if drawing, cancel, otherwise pass it up for undo
517 if (pc->is_drawing) {
518 pencil_cancel (pc);
519 ret = TRUE;
520 }
521 }
522 break;
523 case GDK_g:
524 case GDK_G:
525 if (mod_shift_only(state)) {
526 sp_selection_to_guides();
527 ret = true;
528 }
529 break;
530 default:
531 break;
532 }
533 return ret;
534 }
536 /**
537 * Reset points and set new starting point.
538 */
539 static void
540 spdc_set_startpoint(SPPencilContext *const pc, NR::Point const p)
541 {
542 pc->npoints = 0;
543 pc->red_curve_is_valid = false;
544 if (in_svg_plane(p)) {
545 pc->p[pc->npoints++] = p;
546 }
547 }
549 /**
550 * Change moving endpoint position.
551 * <ul>
552 * <li>Ctrl constrains to moving to H/V direction, snapping in given direction.
553 * <li>Otherwise we snap freely to whatever attractors are available.
554 * </ul>
555 *
556 * Number of points is (re)set to 2 always, 2nd point is modified.
557 * We change RED curve.
558 */
559 static void
560 spdc_set_endpoint(SPPencilContext *const pc, NR::Point const p)
561 {
562 if (pc->npoints == 0) {
563 return;
564 /* May occur if first point wasn't in SVG plane (e.g. weird w2d transform, perhaps from bad
565 * zoom setting).
566 */
567 }
568 g_return_if_fail( pc->npoints > 0 );
570 pc->red_curve->reset();
571 if ( ( p == pc->p[0] )
572 || !in_svg_plane(p) )
573 {
574 pc->npoints = 1;
575 } else {
576 pc->p[1] = p;
577 pc->npoints = 2;
579 pc->red_curve->moveto(pc->p[0]);
580 pc->red_curve->lineto(pc->p[1]);
581 pc->red_curve_is_valid = true;
583 sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(pc->red_bpath), pc->red_curve);
584 }
585 }
587 /**
588 * Finalize addline.
589 *
590 * \todo
591 * fixme: I'd like remove red reset from concat colors (lauris).
592 * Still not sure, how it will make most sense.
593 */
594 static void
595 spdc_finish_endpoint(SPPencilContext *const pc)
596 {
597 if ( ( pc->red_curve->is_empty() )
598 || ( pc->red_curve->first_point() == pc->red_curve->second_point() ) )
599 {
600 pc->red_curve->reset();
601 sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(pc->red_bpath), NULL);
602 } else {
603 /* Write curves to object. */
604 spdc_concat_colors_and_flush(pc, FALSE);
605 pc->sa = NULL;
606 pc->ea = NULL;
607 }
608 }
610 static void
611 spdc_add_freehand_point(SPPencilContext *pc, NR::Point p, guint /*state*/)
612 {
613 g_assert( pc->npoints > 0 );
614 g_return_if_fail(unsigned(pc->npoints) < G_N_ELEMENTS(pc->p));
616 if ( ( p != pc->p[ pc->npoints - 1 ] )
617 && in_svg_plane(p) )
618 {
619 pc->p[pc->npoints++] = p;
620 fit_and_split(pc);
621 }
622 }
624 static inline double
625 square(double const x)
626 {
627 return x * x;
628 }
630 static void
631 fit_and_split(SPPencilContext *pc)
632 {
633 g_assert( pc->npoints > 1 );
635 double const tol = prefs_get_double_attribute_limited("tools.freehand.pencil", "tolerance", 10.0, 1.0, 100.0);
636 double const tolerance_sq = 0.02 * square( NR::expansion(pc->desktop->w2d()) * tol)
637 * exp(0.2*tol - 2);
639 NR::Point b[4];
640 g_assert(is_zero(pc->req_tangent)
641 || is_unit_vector(pc->req_tangent));
642 NR::Point const tHatEnd(0, 0);
643 int const n_segs = sp_bezier_fit_cubic_full(b, NULL, pc->p, pc->npoints,
644 pc->req_tangent, tHatEnd, tolerance_sq, 1);
645 if ( n_segs > 0
646 && unsigned(pc->npoints) < G_N_ELEMENTS(pc->p) )
647 {
648 /* Fit and draw and reset state */
649 pc->red_curve->reset();
650 pc->red_curve->moveto(b[0]);
651 pc->red_curve->curveto(b[1], b[2], b[3]);
652 sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(pc->red_bpath), pc->red_curve);
653 pc->red_curve_is_valid = true;
654 } else {
655 /* Fit and draw and copy last point */
657 g_assert(!pc->red_curve->is_empty());
659 /* Set up direction of next curve. */
660 {
661 Geom::CubicBezier const * last_seg = dynamic_cast<Geom::CubicBezier const *>(pc->red_curve->last_segment());
662 g_assert( last_seg ); // Relevance: validity of (*last_seg)[2]
663 pc->p[0] = last_seg->finalPoint();
664 pc->npoints = 1;
665 NR::Point const req_vec( pc->p[0] - (*last_seg)[2] );
666 pc->req_tangent = ( ( NR::is_zero(req_vec) || !in_svg_plane(req_vec) )
667 ? NR::Point(0, 0)
668 : NR::unit_vector(req_vec) );
669 }
671 pc->green_curve->append_continuous(pc->red_curve, 0.0625);
672 SPCurve *curve = pc->red_curve->copy();
674 /// \todo fixme:
675 SPCanvasItem *cshape = sp_canvas_bpath_new(sp_desktop_sketch(pc->desktop), curve);
676 curve->unref();
677 sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(cshape), pc->green_color, 1.0, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT);
679 pc->green_bpaths = g_slist_prepend(pc->green_bpaths, cshape);
681 pc->red_curve_is_valid = false;
682 }
683 }
686 /*
687 Local Variables:
688 mode:c++
689 c-file-style:"stroustrup"
690 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
691 indent-tabs-mode:nil
692 fill-column:99
693 End:
694 */
695 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :