| 1 |
/************************************************************************* |
| 2 |
* Copyright (c) 2011 AT&T Intellectual Property |
| 3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
| 6 |
* https://www.eclipse.org/legal/epl-v10.html |
| 7 |
* |
| 8 |
* Contributors: Details at https://graphviz.org |
| 9 |
*************************************************************************/ |
| 10 |
|
| 11 |
#pragma once |
| 12 |
|
| 13 |
#include <util/api.h> |
| 14 |
#include <util/arena.h> |
| 15 |
|
| 16 |
#ifdef __cplusplus |
| 17 |
extern "C" { |
| 18 |
#endif |
| 19 |
|
| 20 |
#include <neatogen/site.h> |
| 21 |
#include <neatogen/edges.h> |
| 22 |
|
| 23 |
typedef struct Halfedge { |
| 24 |
struct Halfedge *ELleft, *ELright; |
| 25 |
Edge *ELedge; |
| 26 |
char ELpm; |
| 27 |
Site *vertex; |
| 28 |
double ystar; |
| 29 |
struct Halfedge *PQnext; |
| 30 |
} Halfedge; |
| 31 |
|
| 32 |
typedef struct { |
| 33 |
arena_t allocated; ///< outstanding dynamic allocations |
| 34 |
int hashsize; |
| 35 |
Halfedge **hash; |
| 36 |
Halfedge *leftend; |
| 37 |
Halfedge *rightend; |
| 38 |
} el_state_t; |
| 39 |
|
| 40 |
PRIVATE void ELinitialize(el_state_t *); |
| 41 |
PRIVATE void ELcleanup(el_state_t *); |
| 42 |
PRIVATE Site *hintersect(Halfedge *, Halfedge *, arena_t *); |
| 43 |
PRIVATE Halfedge *HEcreate(el_state_t *, Edge *, char); |
| 44 |
PRIVATE void ELinsert(Halfedge *, Halfedge *); |
| 45 |
PRIVATE Halfedge *ELleftbnd(el_state_t *, Point *); |
| 46 |
PRIVATE void ELdelete(Halfedge *); |
| 47 |
PRIVATE Halfedge *ELleft(Halfedge *), *ELright(Halfedge *); |
| 48 |
PRIVATE Site *leftreg(Halfedge *), *rightreg(Halfedge *); |
| 49 |
|
| 50 |
#ifdef __cplusplus |
| 51 |
} |
| 52 |
#endif |