Graphviz 14.0.2~dev.20251008.0253
Loading...
Searching...
No Matches
tri.h
Go to the documentation of this file.
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#include <stdbool.h>
12#include <stddef.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18#include <pathgeom.h>
19
20#ifdef GVDLL
21#ifdef PATHPLAN_EXPORTS
22#define TRI_API __declspec(dllexport)
23#else
24#define TRI_API __declspec(dllimport)
25#endif
26#endif
27
28#ifndef TRI_API
29#define TRI_API /* nothing */
30#endif
31
32/* Points in polygon must be in CCW order */
34 void (*fn)(void *closure, const Ppoint_t tri[]),
35 void *vc);
36
37#undef TRI_API
38
40enum {
41 ISCCW = 1,
42 ISCW = 2,
43 ISON = 3,
44};
45
47int ccw(Ppoint_t p1, Ppoint_t p2, Ppoint_t p3);
48
49typedef Ppoint_t (*indexer_t)(void *base, size_t index);
50
52bool isdiagonal(size_t i, size_t ip2, void *pointp, size_t pointn,
53 indexer_t indexer);
54
55#ifdef __cplusplus
56}
57#endif
struct Pxy_t Ppoint_t
Definition pathgeom.h:41
bool isdiagonal(size_t i, size_t ip2, void *pointp, size_t pointn, indexer_t indexer)
is (i, i + 2) a diagonal?
Definition triang.c:120
int ccw(Ppoint_t p1, Ppoint_t p2, Ppoint_t p3)
are the given points counter-clockwise, clockwise, or co-linear?
Definition triang.c:23
#define TRI_API
Definition tri.h:29
@ ISON
co-linear
Definition tri.h:43
@ ISCW
clockwise
Definition tri.h:42
@ ISCCW
counter-clockwise
Definition tri.h:41
TRI_API int Ptriangulate(Ppoly_t *polygon, void(*fn)(void *closure, const Ppoint_t tri[]), void *vc)
Ppoint_t(* indexer_t)(void *base, size_t index)
Definition tri.h:49