Kstars

src/geom.h
1/*
2** Author: Eric Veach, July 1994.
3**
4*/
5
6#ifndef __geom_h_
7#define __geom_h_
8
9#include "mesh.h"
10
11#ifdef NO_BRANCH_CONDITIONS
12/* MIPS architecture has special instructions to evaluate boolean
13 * conditions -- more efficient than branching, IF you can get the
14 * compiler to generate the right instructions (SGI compiler doesn't)
15 */
16#define VertEq(u, v) (((u)->s == (v)->s) & ((u)->t == (v)->t))
17#define VertLeq(u, v) (((u)->s < (v)->s) | ((u)->s == (v)->s & (u)->t <= (v)->t))
18#else
19#define VertEq(u, v) ((u)->s == (v)->s && (u)->t == (v)->t)
20#define VertLeq(u, v) (((u)->s < (v)->s) || ((u)->s == (v)->s && (u)->t <= (v)->t))
21#endif
22
23#define EdgeEval(u, v, w) __gl_edgeEval(u, v, w)
24#define EdgeSign(u, v, w) __gl_edgeSign(u, v, w)
25
26/* Versions of VertLeq, EdgeSign, EdgeEval with s and t transposed. */
27
28#define TransLeq(u, v) (((u)->t < (v)->t) || ((u)->t == (v)->t && (u)->s <= (v)->s))
29#define TransEval(u, v, w) __gl_transEval(u, v, w)
30#define TransSign(u, v, w) __gl_transSign(u, v, w)
31
32#define EdgeGoesLeft(e) VertLeq((e)->Dst, (e)->Org)
33#define EdgeGoesRight(e) VertLeq((e)->Org, (e)->Dst)
34
35#undef ABS
36#define ABS(x) ((x) < 0 ? -(x) : (x))
37#define VertL1dist(u, v) (ABS(u->s - v->s) + ABS(u->t - v->t))
38
39#define VertCCW(u, v, w) __gl_vertCCW(u, v, w)
40
41int __gl_vertLeq(GLUvertex *u, GLUvertex *v);
42GLdouble __gl_edgeEval(GLUvertex *u, GLUvertex *v, GLUvertex *w);
43GLdouble __gl_edgeSign(GLUvertex *u, GLUvertex *v, GLUvertex *w);
44GLdouble __gl_transEval(GLUvertex *u, GLUvertex *v, GLUvertex *w);
45GLdouble __gl_transSign(GLUvertex *u, GLUvertex *v, GLUvertex *w);
46int __gl_vertCCW(GLUvertex *u, GLUvertex *v, GLUvertex *w);
47void __gl_edgeIntersect(GLUvertex *o1, GLUvertex *d1, GLUvertex *o2, GLUvertex *d2, GLUvertex *v);
48
49#endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 6 2024 12:09:52 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.