Classes | Defines | Typedefs | Enumerations | Functions | Variables
triangle.cpp File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "triangle.h"
Include dependency graph for triangle.cpp:

Go to the source code of this file.

Classes

struct  badsubseg
struct  badtriang
struct  behavior
struct  event
struct  flipstacker
struct  memorypool
struct  mesh
struct  osub
struct  otri
struct  splaynode

Defines

#define Absolute(a)   ((a) >= 0.0 ? (a) : -(a))
#define apex(otri, vertexptr)   vertexptr = (vertex) (otri).tri[(otri).orient + 3]
#define areabound(otri)   ((float *) (otri).tri)[m->areaboundindex]
#define BADSUBSEGPERBLOCK   252 /* Number of encroached subsegments allocated at once. */
#define BADTRIPERBLOCK   4092 /* Number of skinny triangles allocated at once. */
#define bond(otri1, otri2)
#define deadsubseg(sub)   ((sub)[1] == (subseg) NULL)
#define deadtri(tria)   ((tria)[1] == (triangle) NULL)
#define DEADVERTEX   -32768
#define decode(ptr, otri)
#define dest(otri, vertexptr)   vertexptr = (vertex) (otri).tri[minus1mod3[(otri).orient] + 3]
#define dissolve(otri)   (otri).tri[(otri).orient] = (triangle) m->dummytri
#define dnext(otri1, otri2)
#define dnextself(otri)
#define dprev(otri1, otri2)
#define dprevself(otri)
#define elemattribute(otri, attnum)   ((float *) (otri).tri)[m->elemattribindex + (attnum)]
#define encode(otri)   (triangle) ((unsigned long long) (otri).tri | (unsigned long long) (otri).orient)
#define Fast_Two_Sum(a, b, x, y)
#define Fast_Two_Sum_Tail(a, b, x, y)
#define FILENAMESIZE   2048
#define FLIPSTACKERPERBLOCK   252 /* Number of flipped triangles allocated at once. */
#define FREEVERTEX   2
#define infect(otri)
#define infected(otri)   (((unsigned long long) (otri).tri[6] & (unsigned long long) 2l) != 0l)
#define INPUTLINESIZE   1024
#define INPUTVERTEX   0
#define killsubseg(sub)
#define killtri(tria)
#define lnext(otri1, otri2)
#define lnextself(otri)   (otri).orient = plus1mod3[(otri).orient]
#define lprev(otri1, otri2)
#define lprevself(otri)   (otri).orient = minus1mod3[(otri).orient]
#define mark(osub)   (* (int *) ((osub).ss + 8))
#define ONETHIRD   0.333333333333333333333333333333333333333333333333333333333333
#define onext(otri1, otri2)
#define onextself(otri)
#define oprev(otri1, otri2)
#define oprevself(otri)
#define org(otri, vertexptr)   vertexptr = (vertex) (otri).tri[plus1mod3[(otri).orient] + 3]
#define otricopy(otri1, otri2)
#define otriequal(otri1, otri2)
#define PI   3.141592653589793238462643383279502884197169399375105820974944592308
#define rnext(otri1, otri2)
#define rnextself(otri)
#define rprev(otri1, otri2)
#define rprevself(otri)
#define SAMPLEFACTOR   11
#define SAMPLERATE   10
#define sbond(osub1, osub2)
#define sdecode(sptr, osub)
#define sdest(osub, vertexptr)   vertexptr = (vertex) (osub).ss[3 - (osub).ssorient]
#define sdissolve(osub)   (osub).ss[(osub).ssorient] = (subseg) m->dummysub
#define segdest(osub, vertexptr)   vertexptr = (vertex) (osub).ss[5 - (osub).ssorient]
#define SEGMENTVERTEX   1
#define segorg(osub, vertexptr)   vertexptr = (vertex) (osub).ss[4 + (osub).ssorient]
#define sencode(osub)   (subseg) ((unsigned long long) (osub).ss | (unsigned long long) (osub).ssorient)
#define setapex(otri, vertexptr)   (otri).tri[(otri).orient + 3] = (triangle) vertexptr
#define setareabound(otri, value)   ((float *) (otri).tri)[m->areaboundindex] = value
#define setdest(otri, vertexptr)   (otri).tri[minus1mod3[(otri).orient] + 3] = (triangle) vertexptr
#define setelemattribute(otri, attnum, value)   ((float *) (otri).tri)[m->elemattribindex + (attnum)] = value
#define setmark(osub, value)   * (int *) ((osub).ss + 8) = value
#define setorg(otri, vertexptr)   (otri).tri[plus1mod3[(otri).orient] + 3] = (triangle) vertexptr
#define setsdest(osub, vertexptr)   (osub).ss[3 - (osub).ssorient] = (subseg) vertexptr
#define setsegdest(osub, vertexptr)   (osub).ss[5 - (osub).ssorient] = (subseg) vertexptr
#define setsegorg(osub, vertexptr)   (osub).ss[4 + (osub).ssorient] = (subseg) vertexptr
#define setsorg(osub, vertexptr)   (osub).ss[2 + (osub).ssorient] = (subseg) vertexptr
#define setvertex2tri(vx, value)   ((triangle *) (vx))[m->vertex2triindex] = value
#define setvertexmark(vx, value)   ((int *) (vx))[m->vertexmarkindex] = value
#define setvertextype(vx, value)   ((int *) (vx))[m->vertexmarkindex + 1] = value
#define snext(osub1, osub2)
#define snextself(osub)
#define sorg(osub, vertexptr)   vertexptr = (vertex) (osub).ss[2 + (osub).ssorient]
#define spivot(osub1, osub2)
#define spivotself(osub)
#define SPLAYNODEPERBLOCK   508 /* Number of splay tree nodes allocated at once. */
#define Split(a, ahi, alo)
#define Square(a, x, y)
#define Square_Tail(a, x, y)
#define SQUAREROOTTWO   1.4142135623730950488016887242096980785696718753769480732
#define ssym(osub1, osub2)
#define ssymself(osub)   (osub).ssorient = 1 - (osub).ssorient
#define stdissolve(osub)   (osub).ss[6 + (osub).ssorient] = (subseg) m->dummytri
#define stpivot(osub, otri)
#define subsegcopy(osub1, osub2)
#define subsegequal(osub1, osub2)
#define SUBSEGPERBLOCK   508 /* Number of subsegments allocated at once. */
#define sym(otri1, otri2)
#define symself(otri)
#define TRIPERBLOCK   4092 /* Number of triangles allocated at once. */
#define tsbond(otri, osub)
#define tsdissolve(otri)   (otri).tri[6 + (otri).orient] = (triangle) m->dummysub
#define tspivot(otri, osub)
#define Two_Diff(a, b, x, y)
#define Two_Diff_Tail(a, b, x, y)
#define Two_One_Diff(a1, a0, b, x2, x1, x0)
#define Two_One_Product(a1, a0, b, x3, x2, x1, x0)
#define Two_One_Sum(a1, a0, b, x2, x1, x0)
#define Two_Product(a, b, x, y)
#define Two_Product_Presplit(a, b, bhi, blo, x, y)
#define Two_Product_Tail(a, b, x, y)
#define Two_Sum(a, b, x, y)
#define Two_Sum_Tail(a, b, x, y)
#define Two_Two_Diff(a1, a0, b1, b0, x3, x2, x1, x0)
#define Two_Two_Sum(a1, a0, b1, b0, x3, x2, x1, x0)
#define UNDEADVERTEX   -32767
#define uninfect(otri)
#define vertex2tri(vx)   ((triangle *) (vx))[m->vertex2triindex]
#define vertexmark(vx)   ((int *) (vx))[m->vertexmarkindex]
#define VERTEXPERBLOCK   4092 /* Number of vertices allocated at once. */
#define vertextype(vx)   ((int *) (vx))[m->vertexmarkindex + 1]
#define VIRUSPERBLOCK   1020 /* Number of virus triangles allocated at once. */

Typedefs

typedef float ** subseg
typedef float ** triangle
typedef float * vertex

Enumerations

enum  finddirectionresult { WITHIN, LEFTCOLLINEAR, RIGHTCOLLINEAR }
enum  insertvertexresult { SUCCESSFULVERTEX, ENCROACHINGVERTEX, VIOLATINGVERTEX, DUPLICATEVERTEX }
enum  locateresult { INTRIANGLE, ONEDGE, ONVERTEX, OUTSIDE }

Functions

void alternateaxes (vertex *sortarray, int arraysize, int axis)
void carveholes (struct mesh *m, struct behavior *b, float *holelist, int holes, float *regionlist, int regions)
void constrainededge (struct mesh *m, struct behavior *b, struct otri *starttri, vertex endpoint2, int newmark)
float counterclockwise (struct mesh *m, struct behavior *b, vertex pa, vertex pb, vertex pc)
float counterclockwiseadapt (vertex pa, vertex pb, vertex pc, float detsum)
long delaunay (struct mesh *m, struct behavior *b)
void delaunayfixup (struct mesh *m, struct behavior *b, struct otri *fixuptri, int leftside)
long divconqdelaunay (struct mesh *m, struct behavior *b)
void divconqrecurse (struct mesh *m, struct behavior *b, vertex *sortarray, int vertices, int axis, struct otri *farleft, struct otri *farright)
void dummyinit (struct mesh *m, struct behavior *b, int trianglebytes, int subsegbytes)
float estimate (int elen, float *e)
void exactinit ()
int fast_expansion_sum_zeroelim (int elen, float *e, int flen, float *f, float *h)
void findcircumcenter (struct mesh *m, struct behavior *b, vertex torg, vertex tdest, vertex tapex, vertex circumcenter, float *xi, float *eta, int offcenter)
enum finddirectionresult finddirection (struct mesh *m, struct behavior *b, struct otri *searchtri, vertex searchpoint)
void flip (struct mesh *m, struct behavior *b, struct otri *flipedge)
void formskeleton (struct mesh *m, struct behavior *b, int *segmentlist, int *segmentmarkerlist, int numberofsegments)
vertex getvertex (struct mesh *m, struct behavior *b, int number)
void highorder (struct mesh *m, struct behavior *b)
float incircle (struct mesh *m, struct behavior *b, vertex pa, vertex pb, vertex pc, vertex pd)
float incircleadapt (vertex pa, vertex pb, vertex pc, vertex pd, float permanent)
void infecthull (struct mesh *m, struct behavior *b)
void initializetrisubpools (struct mesh *m, struct behavior *b)
void initializevertexpool (struct mesh *m, struct behavior *b)
void insertsegment (struct mesh *m, struct behavior *b, vertex endpoint1, vertex endpoint2, int newmark)
void insertsubseg (struct mesh *m, struct behavior *b, struct otri *tri, int subsegmark)
enum insertvertexresult insertvertex (struct mesh *m, struct behavior *b, vertex newvertex, struct otri *searchtri, struct osub *splitseg, int segmentflaws, int triflaws)
void internalerror ()
enum locateresult locate (struct mesh *m, struct behavior *b, vertex searchpoint, struct otri *searchtri)
void makesubseg (struct mesh *m, struct osub *newsubseg)
void maketriangle (struct mesh *m, struct behavior *b, struct otri *newotri)
void makevertexmap (struct mesh *m, struct behavior *b)
void markhull (struct mesh *m, struct behavior *b)
void mergehulls (struct mesh *m, struct behavior *b, struct otri *farleft, struct otri *innerleft, struct otri *innerright, struct otri *farright, int axis)
float nonregular (struct mesh *m, struct behavior *b, vertex pa, vertex pb, vertex pc, vertex pd)
void numbernodes (struct mesh *m, struct behavior *b)
float orient3d (struct mesh *m, struct behavior *b, vertex pa, vertex pb, vertex pc, vertex pd, float aheight, float bheight, float cheight, float dheight)
float orient3dadapt (vertex pa, vertex pb, vertex pc, vertex pd, float aheight, float bheight, float cheight, float dheight, float permanent)
void parsecommandline (int argc, char **argv, struct behavior *b)
void plague (struct mesh *m, struct behavior *b)
int * poolalloc (struct memorypool *pool)
void pooldealloc (struct memorypool *pool, int *dyingitem)
void pooldeinit (struct memorypool *pool)
void poolinit (struct memorypool *pool, int bytecount, int itemcount, int firstitemcount, int alignment)
void poolrestart (struct memorypool *pool)
void poolzero (struct memorypool *pool)
enum locateresult preciselocate (struct mesh *m, struct behavior *b, vertex searchpoint, struct otri *searchtri, int stopatsubsegment)
void printsubseg (struct mesh *m, struct behavior *b, struct osub *s)
void printtriangle (struct mesh *m, struct behavior *b, struct otri *t)
void quality_statistics (struct mesh *m, struct behavior *b)
unsigned long long randomnation (unsigned int choices)
void regionplague (struct mesh *m, struct behavior *b, float attribute, float area)
long removeghosts (struct mesh *m, struct behavior *b, struct otri *startghost)
int scale_expansion_zeroelim (int elen, float *e, float b, float *h)
int scoutsegment (struct mesh *m, struct behavior *b, struct otri *searchtri, vertex endpoint2, int newmark)
void segmentintersection (struct mesh *m, struct behavior *b, struct otri *splittri, struct osub *splitsubseg, vertex endpoint2)
void statistics (struct mesh *m, struct behavior *b)
void subsegdealloc (struct mesh *m, subseg *dyingsubseg)
subsegsubsegtraverse (struct mesh *m)
void transfernodes (struct mesh *m, struct behavior *b, float *pointlist, float *pointattriblist, int *pointmarkerlist, int numberofpoints, int numberofpointattribs)
void traversalinit (struct memorypool *pool)
int * traverse (struct memorypool *pool)
void triangledealloc (struct mesh *m, triangle *dyingtriangle)
void triangledeinit (struct mesh *m, struct behavior *b)
void triangleinit (struct mesh *m)
triangletriangletraverse (struct mesh *m)
void triangulate (char *triswitches, struct triangulateio *in, struct triangulateio *out, struct triangulateio *vorout)
void triangulatepolygon (struct mesh *m, struct behavior *b, struct otri *firstedge, struct otri *lastedge, int edgecount, int doflip, int triflaws)
void triexit (int status)
void trifree (int *memptr)
int * trimalloc (int size)
void unflip (struct mesh *m, struct behavior *b, struct otri *flipedge)
void vertexdealloc (struct mesh *m, vertex dyingvertex)
void vertexmedian (vertex *sortarray, int arraysize, int median, int axis)
void vertexsort (vertex *sortarray, int arraysize)
vertex vertextraverse (struct mesh *m)
void writeedges (struct mesh *m, struct behavior *b, int **edgelist, int **edgemarkerlist)
void writeelements (struct mesh *m, struct behavior *b, int **trianglelist, float **triangleattriblist)
void writeneighbors (struct mesh *m, struct behavior *b, int **neighborlist)
void writenodes (struct mesh *m, struct behavior *b, float **pointlist, float **pointattriblist, int **pointmarkerlist)
void writepoly (struct mesh *m, struct behavior *b, int **segmentlist, int **segmentmarkerlist)
void writevoronoi (struct mesh *m, struct behavior *b, float **vpointlist, float **vpointattriblist, int **vpointmarkerlist, int **vedgelist, int **vedgemarkerlist, float **vnormlist)

Variables

float ccwerrboundA
float ccwerrboundB
float ccwerrboundC
float epsilon
float iccerrboundA
float iccerrboundB
float iccerrboundC
int minus1mod3 [3] = {2, 0, 1}
float o3derrboundA
float o3derrboundB
float o3derrboundC
int plus1mod3 [3] = {1, 2, 0}
unsigned long long randomseed
float resulterrbound
float splitter

Define Documentation

#define Absolute (   a)    ((a) >= 0.0 ? (a) : -(a))

Definition at line 2279 of file triangle.cpp.

#define apex (   otri,
  vertexptr 
)    vertexptr = (vertex) (otri).tri[(otri).orient + 3]

Definition at line 953 of file triangle.cpp.

#define areabound (   otri)    ((float *) (otri).tri)[m->areaboundindex]

Definition at line 1017 of file triangle.cpp.

#define BADSUBSEGPERBLOCK   252 /* Number of encroached subsegments allocated at once. */

Definition at line 216 of file triangle.cpp.

#define BADTRIPERBLOCK   4092 /* Number of skinny triangles allocated at once. */

Definition at line 217 of file triangle.cpp.

#define bond (   otri1,
  otri2 
)
Value:
(otri1).tri[(otri1).orient] = encode(otri2);                                \
  (otri2).tri[(otri2).orient] = encode(otri1)

Definition at line 967 of file triangle.cpp.

#define deadsubseg (   sub)    ((sub)[1] == (subseg) NULL)

Definition at line 1150 of file triangle.cpp.

#define deadtri (   tria)    ((tria)[1] == (triangle) NULL)

Definition at line 1027 of file triangle.cpp.

#define DEADVERTEX   -32768

Definition at line 228 of file triangle.cpp.

#define decode (   ptr,
  otri 
)
Value:
(otri).orient = (int) ((unsigned long long) (ptr) & (unsigned long long) 3l);         \
  (otri).tri = (triangle *)                                                   \
                  ((unsigned long long) (ptr) ^ (unsigned long long) (otri).orient)

Definition at line 822 of file triangle.cpp.

#define dest (   otri,
  vertexptr 
)    vertexptr = (vertex) (otri).tri[minus1mod3[(otri).orient] + 3]

Definition at line 950 of file triangle.cpp.

#define dissolve (   otri)    (otri).tri[(otri).orient] = (triangle) m->dummytri

Definition at line 976 of file triangle.cpp.

#define dnext (   otri1,
  otri2 
)
Value:
sym(otri1, otri2);                                                          \
  lprevself(otri2);

Definition at line 896 of file triangle.cpp.

#define dnextself (   otri)
Value:
symself(otri);                                                              \
  lprevself(otri);

Definition at line 900 of file triangle.cpp.

#define dprev (   otri1,
  otri2 
)
Value:
lnext(otri1, otri2);                                                        \
  symself(otri2);

Definition at line 908 of file triangle.cpp.

#define dprevself (   otri)
Value:
lnextself(otri);                                                            \
  symself(otri);

Definition at line 912 of file triangle.cpp.

#define elemattribute (   otri,
  attnum 
)    ((float *) (otri).tri)[m->elemattribindex + (attnum)]

Definition at line 1009 of file triangle.cpp.

#define encode (   otri)    (triangle) ((unsigned long long) (otri).tri | (unsigned long long) (otri).orient)

Definition at line 831 of file triangle.cpp.

#define Fast_Two_Sum (   a,
  b,
  x,
 
)
Value:
x = (float) (a + b); \
  Fast_Two_Sum_Tail(a, b, x, y)

Definition at line 2299 of file triangle.cpp.

#define Fast_Two_Sum_Tail (   a,
  b,
  x,
 
)
Value:
bvirt = x - a; \
  y = b - bvirt

Definition at line 2295 of file triangle.cpp.

#define FILENAMESIZE   2048

Definition at line 201 of file triangle.cpp.

#define FLIPSTACKERPERBLOCK   252 /* Number of flipped triangles allocated at once. */

Definition at line 218 of file triangle.cpp.

#define FREEVERTEX   2

Definition at line 227 of file triangle.cpp.

#define infect (   otri)
Value:
(otri).tri[6] = (triangle)                                                  \
                    ((unsigned long long) (otri).tri[6] | (unsigned long long) 2l)

Definition at line 994 of file triangle.cpp.

#define infected (   otri)    (((unsigned long long) (otri).tri[6] & (unsigned long long) 2l) != 0l)

Definition at line 1004 of file triangle.cpp.

#define INPUTLINESIZE   1024

Definition at line 206 of file triangle.cpp.

#define INPUTVERTEX   0

Definition at line 225 of file triangle.cpp.

#define killsubseg (   sub)
Value:
(sub)[1] = (subseg) NULL;                                                   \
  (sub)[2] = (subseg) NULL

Definition at line 1152 of file triangle.cpp.

#define killtri (   tria)
Value:
(tria)[1] = (triangle) NULL;                                                \
  (tria)[3] = (triangle) NULL

Definition at line 1029 of file triangle.cpp.

#define lnext (   otri1,
  otri2 
)
Value:
(otri2).tri = (otri1).tri;                                                  \
  (otri2).orient = plus1mod3[(otri1).orient]

Definition at line 852 of file triangle.cpp.

#define lnextself (   otri)    (otri).orient = plus1mod3[(otri).orient]

Definition at line 856 of file triangle.cpp.

#define lprev (   otri1,
  otri2 
)
Value:
(otri2).tri = (otri1).tri;                                                  \
  (otri2).orient = minus1mod3[(otri1).orient]

Definition at line 861 of file triangle.cpp.

#define lprevself (   otri)    (otri).orient = minus1mod3[(otri).orient]

Definition at line 865 of file triangle.cpp.

#define mark (   osub)    (* (int *) ((osub).ss + 8))

Definition at line 1116 of file triangle.cpp.

#define ONETHIRD   0.333333333333333333333333333333333333333333333333333333333333

Definition at line 255 of file triangle.cpp.

#define onext (   otri1,
  otri2 
)
Value:
lprev(otri1, otri2);                                                        \
  symself(otri2);

Definition at line 872 of file triangle.cpp.

#define onextself (   otri)
Value:
lprevself(otri);                                                            \
  symself(otri);

Definition at line 876 of file triangle.cpp.

#define oprev (   otri1,
  otri2 
)
Value:
sym(otri1, otri2);                                                          \
  lnextself(otri2);

Definition at line 884 of file triangle.cpp.

#define oprevself (   otri)
Value:
symself(otri);                                                              \
  lnextself(otri);

Definition at line 888 of file triangle.cpp.

#define org (   otri,
  vertexptr 
)    vertexptr = (vertex) (otri).tri[plus1mod3[(otri).orient] + 3]

Definition at line 947 of file triangle.cpp.

#define otricopy (   otri1,
  otri2 
)
Value:
(otri2).tri = (otri1).tri;                                                  \
  (otri2).orient = (otri1).orient

Definition at line 981 of file triangle.cpp.

#define otriequal (   otri1,
  otri2 
)
Value:
(((otri1).tri == (otri2).tri) &&                                            \
   ((otri1).orient == (otri2).orient))

Definition at line 987 of file triangle.cpp.

#define PI   3.141592653589793238462643383279502884197169399375105820974944592308

Definition at line 247 of file triangle.cpp.

#define rnext (   otri1,
  otri2 
)
Value:
sym(otri1, otri2);                                                          \
  lnextself(otri2);                                                           \
  symself(otri2);

Definition at line 920 of file triangle.cpp.

#define rnextself (   otri)
Value:
symself(otri);                                                              \
  lnextself(otri);                                                            \
  symself(otri);

Definition at line 925 of file triangle.cpp.

#define rprev (   otri1,
  otri2 
)
Value:
sym(otri1, otri2);                                                          \
  lprevself(otri2);                                                           \
  symself(otri2);

Definition at line 934 of file triangle.cpp.

#define rprevself (   otri)
Value:
symself(otri);                                                              \
  lprevself(otri);                                                            \
  symself(otri);

Definition at line 939 of file triangle.cpp.

#define SAMPLEFACTOR   11

Definition at line 237 of file triangle.cpp.

#define SAMPLERATE   10

Definition at line 243 of file triangle.cpp.

#define sbond (   osub1,
  osub2 
)
Value:
(osub1).ss[(osub1).ssorient] = sencode(osub2);                              \
  (osub2).ss[(osub2).ssorient] = sencode(osub1)

Definition at line 1123 of file triangle.cpp.

#define sdecode (   sptr,
  osub 
)
Value:
(osub).ssorient = (int) ((unsigned long long) (sptr) & (unsigned long long) 1l);      \
  (osub).ss = (subseg *)                                                      \
              ((unsigned long long) (sptr) & ~ (unsigned long long) 3l)

Definition at line 1042 of file triangle.cpp.

#define sdest (   osub,
  vertexptr 
)    vertexptr = (vertex) (osub).ss[3 - (osub).ssorient]

Definition at line 1091 of file triangle.cpp.

#define sdissolve (   osub)    (osub).ss[(osub).ssorient] = (subseg) m->dummysub

Definition at line 1130 of file triangle.cpp.

#define segdest (   osub,
  vertexptr 
)    vertexptr = (vertex) (osub).ss[5 - (osub).ssorient]

Definition at line 1103 of file triangle.cpp.

#define SEGMENTVERTEX   1

Definition at line 226 of file triangle.cpp.

#define segorg (   osub,
  vertexptr 
)    vertexptr = (vertex) (osub).ss[4 + (osub).ssorient]

Definition at line 1100 of file triangle.cpp.

#define sencode (   osub)    (subseg) ((unsigned long long) (osub).ss | (unsigned long long) (osub).ssorient)

Definition at line 1051 of file triangle.cpp.

#define setapex (   otri,
  vertexptr 
)    (otri).tri[(otri).orient + 3] = (triangle) vertexptr

Definition at line 962 of file triangle.cpp.

#define setareabound (   otri,
  value 
)    ((float *) (otri).tri)[m->areaboundindex] = value

Definition at line 1019 of file triangle.cpp.

#define setdest (   otri,
  vertexptr 
)    (otri).tri[minus1mod3[(otri).orient] + 3] = (triangle) vertexptr

Definition at line 959 of file triangle.cpp.

#define setelemattribute (   otri,
  attnum,
  value 
)    ((float *) (otri).tri)[m->elemattribindex + (attnum)] = value

Definition at line 1012 of file triangle.cpp.

#define setmark (   osub,
  value 
)    * (int *) ((osub).ss + 8) = value

Definition at line 1118 of file triangle.cpp.

#define setorg (   otri,
  vertexptr 
)    (otri).tri[plus1mod3[(otri).orient] + 3] = (triangle) vertexptr

Definition at line 956 of file triangle.cpp.

#define setsdest (   osub,
  vertexptr 
)    (osub).ss[3 - (osub).ssorient] = (subseg) vertexptr

Definition at line 1097 of file triangle.cpp.

#define setsegdest (   osub,
  vertexptr 
)    (osub).ss[5 - (osub).ssorient] = (subseg) vertexptr

Definition at line 1109 of file triangle.cpp.

#define setsegorg (   osub,
  vertexptr 
)    (osub).ss[4 + (osub).ssorient] = (subseg) vertexptr

Definition at line 1106 of file triangle.cpp.

#define setsorg (   osub,
  vertexptr 
)    (osub).ss[2 + (osub).ssorient] = (subseg) vertexptr

Definition at line 1094 of file triangle.cpp.

#define setvertex2tri (   vx,
  value 
)    ((triangle *) (vx))[m->vertex2triindex] = value

Definition at line 1205 of file triangle.cpp.

#define setvertexmark (   vx,
  value 
)    ((int *) (vx))[m->vertexmarkindex] = value

Definition at line 1195 of file triangle.cpp.

#define setvertextype (   vx,
  value 
)    ((int *) (vx))[m->vertexmarkindex + 1] = value

Definition at line 1200 of file triangle.cpp.

#define snext (   osub1,
  osub2 
)
Value:
sptr = (osub1).ss[1 - (osub1).ssorient];                                    \
  sdecode(sptr, osub2)

Definition at line 1077 of file triangle.cpp.

#define snextself (   osub)
Value:
sptr = (osub).ss[1 - (osub).ssorient];                                      \
  sdecode(sptr, osub)

Definition at line 1081 of file triangle.cpp.

#define sorg (   osub,
  vertexptr 
)    vertexptr = (vertex) (osub).ss[2 + (osub).ssorient]

Definition at line 1088 of file triangle.cpp.

#define spivot (   osub1,
  osub2 
)
Value:
sptr = (osub1).ss[(osub1).ssorient];                                        \
  sdecode(sptr, osub2)

Definition at line 1066 of file triangle.cpp.

#define spivotself (   osub)
Value:
sptr = (osub).ss[(osub).ssorient];                                          \
  sdecode(sptr, osub)

Definition at line 1070 of file triangle.cpp.

#define SPLAYNODEPERBLOCK   508 /* Number of splay tree nodes allocated at once. */

Definition at line 219 of file triangle.cpp.

#define Split (   a,
  ahi,
  alo 
)
Value:
c = (float) (splitter * a); \
  abig = (float) (c - a); \
  ahi = c - abig; \
  alo = a - ahi

Definition at line 2325 of file triangle.cpp.

#define Square (   a,
  x,
 
)
Value:
x = (float) (a * a); \
  Square_Tail(a, x, y)

Definition at line 2362 of file triangle.cpp.

#define Square_Tail (   a,
  x,
 
)
Value:
Split(a, ahi, alo); \
  err1 = x - (ahi * ahi); \
  err3 = err1 - ((ahi + ahi) * alo); \
  y = (alo * alo) - err3

Definition at line 2356 of file triangle.cpp.

#define SQUAREROOTTWO   1.4142135623730950488016887242096980785696718753769480732

Definition at line 251 of file triangle.cpp.

#define ssym (   osub1,
  osub2 
)
Value:
(osub2).ss = (osub1).ss;                                                    \
  (osub2).ssorient = 1 - (osub1).ssorient

Definition at line 1056 of file triangle.cpp.

#define ssymself (   osub)    (osub).ssorient = 1 - (osub).ssorient

Definition at line 1060 of file triangle.cpp.

#define stdissolve (   osub)    (osub).ss[6 + (osub).ssorient] = (subseg) m->dummytri

Definition at line 1186 of file triangle.cpp.

#define stpivot (   osub,
  otri 
)
Value:
ptr = (triangle) (osub).ss[6 + (osub).ssorient];                            \
  decode(ptr, otri)

Definition at line 1169 of file triangle.cpp.

#define subsegcopy (   osub1,
  osub2 
)
Value:
(osub2).ss = (osub1).ss;                                                    \
  (osub2).ssorient = (osub1).ssorient

Definition at line 1135 of file triangle.cpp.

#define subsegequal (   osub1,
  osub2 
)
Value:
(((osub1).ss == (osub2).ss) &&                                              \
   ((osub1).ssorient == (osub2).ssorient))

Definition at line 1141 of file triangle.cpp.

#define SUBSEGPERBLOCK   508 /* Number of subsegments allocated at once. */

Definition at line 213 of file triangle.cpp.

#define sym (   otri1,
  otri2 
)
Value:
ptr = (otri1).tri[(otri1).orient];                                          \
  decode(ptr, otri2);

Definition at line 842 of file triangle.cpp.

#define symself (   otri)
Value:
ptr = (otri).tri[(otri).orient];                                            \
  decode(ptr, otri);

Definition at line 846 of file triangle.cpp.

#define TRIPERBLOCK   4092 /* Number of triangles allocated at once. */

Definition at line 212 of file triangle.cpp.

#define tsbond (   otri,
  osub 
)
Value:
(otri).tri[6 + (otri).orient] = (triangle) sencode(osub);                   \
  (osub).ss[6 + (osub).ssorient] = (subseg) encode(otri)

Definition at line 1175 of file triangle.cpp.

#define tsdissolve (   otri)    (otri).tri[6 + (otri).orient] = (triangle) m->dummysub

Definition at line 1181 of file triangle.cpp.

#define tspivot (   otri,
  osub 
)
Value:
sptr = (subseg) (otri).tri[6 + (otri).orient];                              \
  sdecode(sptr, osub)

Definition at line 1162 of file triangle.cpp.

#define Two_Diff (   a,
  b,
  x,
 
)
Value:
x = (float) (a - b); \
  Two_Diff_Tail(a, b, x, y)

Definition at line 2321 of file triangle.cpp.

#define Two_Diff_Tail (   a,
  b,
  x,
 
)
Value:
bvirt = (float) (a - x); \
  avirt = x + bvirt; \
  bround = bvirt - b; \
  around = a - avirt; \
  y = around + bround

Definition at line 2314 of file triangle.cpp.

#define Two_One_Diff (   a1,
  a0,
  b,
  x2,
  x1,
  x0 
)
Value:
Two_Diff(a0, b , _i, x0); \
  Two_Sum( a1, _i, x2, x1)

Definition at line 2373 of file triangle.cpp.

#define Two_One_Product (   a1,
  a0,
  b,
  x3,
  x2,
  x1,
  x0 
)
Value:
Split(b, bhi, blo); \
  Two_Product_Presplit(a0, b, bhi, blo, _i, x0); \
  Two_Product_Presplit(a1, b, bhi, blo, _j, _0); \
  Two_Sum(_i, _0, _k, x1); \
  Fast_Two_Sum(_j, _k, x3, x2)

Definition at line 2387 of file triangle.cpp.

#define Two_One_Sum (   a1,
  a0,
  b,
  x2,
  x1,
  x0 
)
Value:
Two_Sum(a0, b , _i, x0); \
  Two_Sum(a1, _i, x2, x1)

Definition at line 2369 of file triangle.cpp.

#define Two_Product (   a,
  b,
  x,
 
)
Value:
x = (float) (a * b); \
  Two_Product_Tail(a, b, x, y)

Definition at line 2339 of file triangle.cpp.

#define Two_Product_Presplit (   a,
  b,
  bhi,
  blo,
  x,
 
)
Value:
x = (float) (a * b); \
  Split(a, ahi, alo); \
  err1 = x - (ahi * bhi); \
  err2 = err1 - (alo * bhi); \
  err3 = err2 - (ahi * blo); \
  y = (alo * blo) - err3

Definition at line 2346 of file triangle.cpp.

#define Two_Product_Tail (   a,
  b,
  x,
 
)
Value:
Split(a, ahi, alo); \
  Split(b, bhi, blo); \
  err1 = x - (ahi * bhi); \
  err2 = err1 - (alo * bhi); \
  err3 = err2 - (ahi * blo); \
  y = (alo * blo) - err3

Definition at line 2331 of file triangle.cpp.

#define Two_Sum (   a,
  b,
  x,
 
)
Value:
x = (float) (a + b); \
  Two_Sum_Tail(a, b, x, y)

Definition at line 2310 of file triangle.cpp.

#define Two_Sum_Tail (   a,
  b,
  x,
 
)
Value:
bvirt = (float) (x - a); \
  avirt = x - bvirt; \
  bround = b - bvirt; \
  around = a - avirt; \
  y = around + bround

Definition at line 2303 of file triangle.cpp.

#define Two_Two_Diff (   a1,
  a0,
  b1,
  b0,
  x3,
  x2,
  x1,
  x0 
)
Value:
Two_One_Diff(a1, a0, b0, _j, _0, x0); \
  Two_One_Diff(_j, _0, b1, x3, x2, x1)

Definition at line 2381 of file triangle.cpp.

#define Two_Two_Sum (   a1,
  a0,
  b1,
  b0,
  x3,
  x2,
  x1,
  x0 
)
Value:
Two_One_Sum(a1, a0, b0, _j, _0, x0); \
  Two_One_Sum(_j, _0, b1, x3, x2, x1)

Definition at line 2377 of file triangle.cpp.

#define UNDEADVERTEX   -32767

Definition at line 229 of file triangle.cpp.

#define uninfect (   otri)
Value:
(otri).tri[6] = (triangle)                                                  \
                    ((unsigned long long) (otri).tri[6] & ~ (unsigned long long) 2l)

Definition at line 998 of file triangle.cpp.

#define vertex2tri (   vx)    ((triangle *) (vx))[m->vertex2triindex]

Definition at line 1203 of file triangle.cpp.

#define vertexmark (   vx)    ((int *) (vx))[m->vertexmarkindex]

Definition at line 1193 of file triangle.cpp.

#define VERTEXPERBLOCK   4092 /* Number of vertices allocated at once. */

Definition at line 214 of file triangle.cpp.

#define vertextype (   vx)    ((int *) (vx))[m->vertexmarkindex + 1]

Definition at line 1198 of file triangle.cpp.

#define VIRUSPERBLOCK   1020 /* Number of virus triangles allocated at once. */

Definition at line 215 of file triangle.cpp.


Typedef Documentation

typedef float** subseg

Definition at line 420 of file triangle.cpp.

typedef float** triangle

Definition at line 403 of file triangle.cpp.

typedef float* vertex

Definition at line 437 of file triangle.cpp.


Enumeration Type Documentation

Enumerator:
WITHIN 
LEFTCOLLINEAR 
RIGHTCOLLINEAR 

Definition at line 284 of file triangle.cpp.

Enumerator:
SUCCESSFULVERTEX 
ENCROACHINGVERTEX 
VIOLATINGVERTEX 
DUPLICATEVERTEX 

Definition at line 276 of file triangle.cpp.

Enumerator:
INTRIANGLE 
ONEDGE 
ONVERTEX 
OUTSIDE 

Definition at line 268 of file triangle.cpp.


Function Documentation

void alternateaxes ( vertex sortarray,
int  arraysize,
int  axis 
)

Definition at line 5582 of file triangle.cpp.

void carveholes ( struct mesh m,
struct behavior b,
float *  holelist,
int  holes,
float *  regionlist,
int  regions 
)

Definition at line 7379 of file triangle.cpp.

void constrainededge ( struct mesh m,
struct behavior b,
struct otri starttri,
vertex  endpoint2,
int  newmark 
)

Definition at line 6683 of file triangle.cpp.

float counterclockwise ( struct mesh m,
struct behavior b,
vertex  pa,
vertex  pb,
vertex  pc 
)

Definition at line 2706 of file triangle.cpp.

float counterclockwiseadapt ( vertex  pa,
vertex  pb,
vertex  pc,
float  detsum 
)

Definition at line 2626 of file triangle.cpp.

long delaunay ( struct mesh m,
struct behavior b 
)

Definition at line 6233 of file triangle.cpp.

void delaunayfixup ( struct mesh m,
struct behavior b,
struct otri fixuptri,
int  leftside 
)

Definition at line 6572 of file triangle.cpp.

long divconqdelaunay ( struct mesh m,
struct behavior b 
)

Definition at line 6160 of file triangle.cpp.

void divconqrecurse ( struct mesh m,
struct behavior b,
vertex sortarray,
int  vertices,
int  axis,
struct otri farleft,
struct otri farright 
)

Definition at line 5953 of file triangle.cpp.

void dummyinit ( struct mesh m,
struct behavior b,
int  trianglebytes,
int  subsegbytes 
)

Definition at line 1871 of file triangle.cpp.

float estimate ( int  elen,
float *  e 
)

Definition at line 2595 of file triangle.cpp.

void exactinit ( )

Definition at line 2413 of file triangle.cpp.

int fast_expansion_sum_zeroelim ( int  elen,
float *  e,
int  flen,
float *  f,
float *  h 
)

Definition at line 2464 of file triangle.cpp.

void findcircumcenter ( struct mesh m,
struct behavior b,
vertex  torg,
vertex  tdest,
vertex  tapex,
vertex  circumcenter,
float *  xi,
float *  eta,
int  offcenter 
)

Definition at line 3913 of file triangle.cpp.

enum finddirectionresult finddirection ( struct mesh m,
struct behavior b,
struct otri searchtri,
vertex  searchpoint 
)

Definition at line 6279 of file triangle.cpp.

void flip ( struct mesh m,
struct behavior b,
struct otri flipedge 
)

Definition at line 4548 of file triangle.cpp.

void formskeleton ( struct mesh m,
struct behavior b,
int *  segmentlist,
int *  segmentmarkerlist,
int  numberofsegments 
)

Definition at line 6901 of file triangle.cpp.

vertex getvertex ( struct mesh m,
struct behavior b,
int  number 
)

Definition at line 2143 of file triangle.cpp.

void highorder ( struct mesh m,
struct behavior b 
)

Definition at line 7555 of file triangle.cpp.

float incircle ( struct mesh m,
struct behavior b,
vertex  pa,
vertex  pb,
vertex  pc,
vertex  pd 
)

Definition at line 3334 of file triangle.cpp.

float incircleadapt ( vertex  pa,
vertex  pb,
vertex  pc,
vertex  pd,
float  permanent 
)

Definition at line 2765 of file triangle.cpp.

void infecthull ( struct mesh m,
struct behavior b 
)

Definition at line 6997 of file triangle.cpp.

void initializetrisubpools ( struct mesh m,
struct behavior b 
)

Definition at line 1978 of file triangle.cpp.

void initializevertexpool ( struct mesh m,
struct behavior b 
)

Definition at line 1942 of file triangle.cpp.

void insertsegment ( struct mesh m,
struct behavior b,
vertex  endpoint1,
vertex  endpoint2,
int  newmark 
)

Definition at line 6775 of file triangle.cpp.

void insertsubseg ( struct mesh m,
struct behavior b,
struct otri tri,
int  subsegmark 
)

Definition at line 4453 of file triangle.cpp.

enum insertvertexresult insertvertex ( struct mesh m,
struct behavior b,
vertex  newvertex,
struct otri searchtri,
struct osub splitseg,
int  segmentflaws,
int  triflaws 
)

Definition at line 4786 of file triangle.cpp.

void internalerror ( )

Definition at line 1248 of file triangle.cpp.

enum locateresult locate ( struct mesh m,
struct behavior b,
vertex  searchpoint,
struct otri searchtri 
)

Definition at line 4291 of file triangle.cpp.

void makesubseg ( struct mesh m,
struct osub newsubseg 
)

Definition at line 2237 of file triangle.cpp.

void maketriangle ( struct mesh m,
struct behavior b,
struct otri newotri 
)

Definition at line 2201 of file triangle.cpp.

void makevertexmap ( struct mesh m,
struct behavior b 
)

Definition at line 4069 of file triangle.cpp.

void markhull ( struct mesh m,
struct behavior b 
)

Definition at line 6864 of file triangle.cpp.

void mergehulls ( struct mesh m,
struct behavior b,
struct otri farleft,
struct otri innerleft,
struct otri innerright,
struct otri farright,
int  axis 
)

Definition at line 5638 of file triangle.cpp.

float nonregular ( struct mesh m,
struct behavior b,
vertex  pa,
vertex  pb,
vertex  pc,
vertex  pd 
)

Definition at line 3883 of file triangle.cpp.

void numbernodes ( struct mesh m,
struct behavior b 
)

Definition at line 7777 of file triangle.cpp.

float orient3d ( struct mesh m,
struct behavior b,
vertex  pa,
vertex  pb,
vertex  pc,
vertex  pd,
float  aheight,
float  bheight,
float  cheight,
float  dheight 
)

Definition at line 3815 of file triangle.cpp.

float orient3dadapt ( vertex  pa,
vertex  pb,
vertex  pc,
vertex  pd,
float  aheight,
float  bheight,
float  cheight,
float  dheight,
float  permanent 
)

Definition at line 3405 of file triangle.cpp.

void parsecommandline ( int  argc,
char **  argv,
struct behavior b 
)

Definition at line 1263 of file triangle.cpp.

void plague ( struct mesh m,
struct behavior b 
)

Definition at line 7072 of file triangle.cpp.

int* poolalloc ( struct memorypool pool)

Definition at line 1709 of file triangle.cpp.

void pooldealloc ( struct memorypool pool,
int *  dyingitem 
)

Definition at line 1766 of file triangle.cpp.

void pooldeinit ( struct memorypool pool)

Definition at line 1694 of file triangle.cpp.

void poolinit ( struct memorypool pool,
int  bytecount,
int  itemcount,
int  firstitemcount,
int  alignment 
)

Definition at line 1656 of file triangle.cpp.

void poolrestart ( struct memorypool pool)

Definition at line 1616 of file triangle.cpp.

void poolzero ( struct memorypool pool)

Definition at line 1588 of file triangle.cpp.

enum locateresult preciselocate ( struct mesh m,
struct behavior b,
vertex  searchpoint,
struct otri searchtri,
int  stopatsubsegment 
)

Definition at line 4157 of file triangle.cpp.

void printsubseg ( struct mesh m,
struct behavior b,
struct osub s 
)

Definition at line 1502 of file triangle.cpp.

void printtriangle ( struct mesh m,
struct behavior b,
struct otri t 
)

Definition at line 1416 of file triangle.cpp.

void quality_statistics ( struct mesh m,
struct behavior b 
)

Definition at line 8188 of file triangle.cpp.

unsigned long long randomnation ( unsigned int  choices)

Definition at line 4045 of file triangle.cpp.

void regionplague ( struct mesh m,
struct behavior b,
float  attribute,
float  area 
)

Definition at line 7275 of file triangle.cpp.

long removeghosts ( struct mesh m,
struct behavior b,
struct otri startghost 
)

Definition at line 6105 of file triangle.cpp.

int scale_expansion_zeroelim ( int  elen,
float *  e,
float  b,
float *  h 
)

Definition at line 2548 of file triangle.cpp.

int scoutsegment ( struct mesh m,
struct behavior b,
struct otri searchtri,
vertex  endpoint2,
int  newmark 
)

Definition at line 6482 of file triangle.cpp.

void segmentintersection ( struct mesh m,
struct behavior b,
struct otri splittri,
struct osub splitsubseg,
vertex  endpoint2 
)

Definition at line 6365 of file triangle.cpp.

void statistics ( struct mesh m,
struct behavior b 
)

Definition at line 8388 of file triangle.cpp.

void subsegdealloc ( struct mesh m,
subseg dyingsubseg 
)

Definition at line 2071 of file triangle.cpp.

subseg* subsegtraverse ( struct mesh m)

Definition at line 2085 of file triangle.cpp.

void transfernodes ( struct mesh m,
struct behavior b,
float *  pointlist,
float *  pointattriblist,
int *  pointmarkerlist,
int  numberofpoints,
int  numberofpointattribs 
)

Definition at line 7634 of file triangle.cpp.

void traversalinit ( struct memorypool pool)

Definition at line 1782 of file triangle.cpp.

int* traverse ( struct memorypool pool)

Definition at line 1812 of file triangle.cpp.

void triangledealloc ( struct mesh m,
triangle dyingtriangle 
)

Definition at line 2038 of file triangle.cpp.

void triangledeinit ( struct mesh m,
struct behavior b 
)

Definition at line 2176 of file triangle.cpp.

void triangleinit ( struct mesh m)

Definition at line 4012 of file triangle.cpp.

triangle* triangletraverse ( struct mesh m)

Definition at line 2052 of file triangle.cpp.

void triangulate ( char *  triswitches,
struct triangulateio in,
struct triangulateio out,
struct triangulateio vorout 
)

Definition at line 8499 of file triangle.cpp.

void triangulatepolygon ( struct mesh m,
struct behavior b,
struct otri firstedge,
struct otri lastedge,
int  edgecount,
int  doflip,
int  triflaws 
)

Definition at line 5333 of file triangle.cpp.

void triexit ( int  status)

Definition at line 1216 of file triangle.cpp.

void trifree ( int *  memptr)

Definition at line 1233 of file triangle.cpp.

int* trimalloc ( int  size)

Definition at line 1221 of file triangle.cpp.

void unflip ( struct mesh m,
struct behavior b,
struct otri flipedge 
)

Definition at line 4660 of file triangle.cpp.

void vertexdealloc ( struct mesh m,
vertex  dyingvertex 
)

Definition at line 2104 of file triangle.cpp.

void vertexmedian ( vertex sortarray,
int  arraysize,
int  median,
int  axis 
)

Definition at line 5513 of file triangle.cpp.

void vertexsort ( vertex sortarray,
int  arraysize 
)

Definition at line 5446 of file triangle.cpp.

vertex vertextraverse ( struct mesh m)

Definition at line 2118 of file triangle.cpp.

void writeedges ( struct mesh m,
struct behavior b,
int **  edgelist,
int **  edgemarkerlist 
)

Definition at line 7922 of file triangle.cpp.

void writeelements ( struct mesh m,
struct behavior b,
int **  trianglelist,
float **  triangleattriblist 
)

Definition at line 7800 of file triangle.cpp.

void writeneighbors ( struct mesh m,
struct behavior b,
int **  neighborlist 
)

Definition at line 8125 of file triangle.cpp.

void writenodes ( struct mesh m,
struct behavior b,
float **  pointlist,
float **  pointattriblist,
int **  pointmarkerlist 
)

Definition at line 7704 of file triangle.cpp.

void writepoly ( struct mesh m,
struct behavior b,
int **  segmentlist,
int **  segmentmarkerlist 
)

Definition at line 7870 of file triangle.cpp.

void writevoronoi ( struct mesh m,
struct behavior b,
float **  vpointlist,
float **  vpointattriblist,
int **  vpointmarkerlist,
int **  vedgelist,
int **  vedgemarkerlist,
float **  vnormlist 
)

Definition at line 8006 of file triangle.cpp.


Variable Documentation

float ccwerrboundA

Definition at line 544 of file triangle.cpp.

float ccwerrboundB

Definition at line 544 of file triangle.cpp.

float ccwerrboundC

Definition at line 544 of file triangle.cpp.

float epsilon

Definition at line 542 of file triangle.cpp.

float iccerrboundA

Definition at line 545 of file triangle.cpp.

float iccerrboundB

Definition at line 545 of file triangle.cpp.

float iccerrboundC

Definition at line 545 of file triangle.cpp.

int minus1mod3[3] = {2, 0, 1}

Definition at line 813 of file triangle.cpp.

float o3derrboundA

Definition at line 546 of file triangle.cpp.

float o3derrboundB

Definition at line 546 of file triangle.cpp.

float o3derrboundC

Definition at line 546 of file triangle.cpp.

int plus1mod3[3] = {1, 2, 0}

Definition at line 812 of file triangle.cpp.

unsigned long long randomseed

Definition at line 550 of file triangle.cpp.

Definition at line 543 of file triangle.cpp.

float splitter

Definition at line 541 of file triangle.cpp.



libviso2
Author(s): Andreas Geiger, Stephan Wirth
autogenerated on Thu Jun 6 2019 21:23:13