Index: cdt.c =================================================================== --- cdt.c (revision 33792) +++ cdt.c (revision 33793) @@ -255,7 +255,7 @@ new_triangle(cdt, p_tl, p_bl, p_tr); } -void cdt_init(cdt_t *cdt, coord_t bbox_x1, coord_t bbox_y1, coord_t bbox_x2, coord_t bbox_y2) +void cdt_init_(cdt_t *cdt) { cdt->points.elem_constructor = vtpoint_constructor; cdt->points.elem_destructor = vtpoint_destructor; @@ -269,10 +269,15 @@ cdt->triangles.elem_destructor = vttriangle_destructor; cdt->triangles.elem_copy = NULL; vttriangle_init(&cdt->triangles); +} +void cdt_init(cdt_t *cdt, coord_t bbox_x1, coord_t bbox_y1, coord_t bbox_x2, coord_t bbox_y2) +{ + cdt_init_(cdt); init_bbox(cdt, bbox_x1, bbox_y1, bbox_x2, bbox_y2); } + void cdt_free(cdt_t *cdt) { vttriangle_uninit(&cdt->triangles); Index: cdt.h =================================================================== --- cdt.h (revision 33792) +++ cdt.h (revision 33793) @@ -89,7 +89,9 @@ /* Raw, low level object creation without side effects; use it only to reconstruct a case */ +void cdt_init_(cdt_t *cdt); /* does not create the bbox in constrained edges */ edge_t *cdt_new_edge_(cdt_t *cdt, point_t *p1, point_t *p2, int constrain); triangle_t *cdt_new_triangle_(cdt_t *cdt, point_t *p1, point_t *p2, point_t *p3); + #endif Index: cdt_test.c =================================================================== --- cdt_test.c (revision 33792) +++ cdt_test.c (revision 33793) @@ -65,6 +65,12 @@ printf("split_constrained_edge_post at %d;%d\n", pt->pos.x, pt->pos.y); } +static void init_evs(void) +{ + cdt.ev_split_constrained_edge_pre = ev_split_constrained_edge_pre; + cdt.ev_split_constrained_edge_post = ev_split_constrained_edge_post; +} + static void cmd_init(char *args) { long x1, y1, x2, y2; @@ -73,10 +79,15 @@ return; } cdt_init(&cdt, x1, y1, x2, y2); - cdt.ev_split_constrained_edge_pre = ev_split_constrained_edge_pre; - cdt.ev_split_constrained_edge_post = ev_split_constrained_edge_post; + init_evs(); } +static void cmd_raw_init(char *args) +{ + cdt_init_(&cdt); + init_evs(); +} + static void cmd_free(char *args) { cdt_free(&cdt); @@ -329,6 +340,7 @@ else if (strcmp(cmd, "auto") == 0) autotest(); else if (strcmp(cmd, "echo") == 0) printf("%s", args); /* newline is in args already */ else if (strcmp(cmd, "init") == 0) cmd_init(args); + else if (strcmp(cmd, "raw_init") == 0) cmd_raw_init(args); else if (strcmp(cmd, "free") == 0) cmd_free(args); else if (strcmp(cmd, "ins_point") == 0) cmd_ins_point(args, 0); else if (strcmp(cmd, "raw_point") == 0) cmd_ins_point(args, 1);