tetgen.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <assert.h>
#include <stdint.h>

Go to the source code of this file.

Classes

class  tetgenio
 
struct  tetgenio::polygon
 
struct  tetgenio::facet
 
struct  tetgenio::voroedge
 
struct  tetgenio::vorofacet
 
struct  tetgenio::pbcgroup
 
class  tetgenbehavior
 
class  tetgenmesh
 
class  tetgenmesh::triface
 
class  tetgenmesh::face
 
struct  tetgenmesh::badface
 
class  tetgenmesh::elemflip
 
struct  tetgenmesh::pbcdata
 
class  tetgenmesh::arraypool
 
class  tetgenmesh::list
 
class  tetgenmesh::memorypool
 
class  tetgenmesh::queue
 

Macros

#define TETLIBRARY
 
#define REAL   double
 
#define fastlookup(pool, index)
 
#define Div2   >> 1
 
#define Mod2   & 01
 
#define Orient(V)   ((V) Div2)
 
#define EdgeRing(V)   ((V) Mod2)
 
#define smarktest(s)    ((int *) ((s).sh))[shmarkindex] = (((int *)((s).sh))[shmarkindex] | (int) 2)
 
#define sunmarktest(s)    ((int *) ((s).sh))[shmarkindex] = (((int *)((s).sh))[shmarkindex] & ~(int) 2)
 
#define smarktested(s)   ((((int *) ((s).sh))[shmarkindex] & (int) 2) != 0)
 
#define NORM2(x, y, z)   ((x) * (x) + (y) * (y) + (z) * (z))
 
#define DIST(p1, p2)    sqrt(NORM2((p2)[0] - (p1)[0], (p2)[1] - (p1)[1], (p2)[2] - (p1)[2]))
 
#define TETGEN_DOT(v1, v2)    ((v1)[0] * (v2)[0] + (v1)[1] * (v2)[1] + (v1)[2] * (v2)[2])
 
#define CROSS(v1, v2, n)
 
#define SETVECTOR3(V, a0, a1, a2)   (V)[0] = (a0); (V)[1] = (a1); (V)[2] = (a2)
 
#define SWAP2(a0, a1, tmp)   (tmp) = (a0); (a0) = (a1); (a1) = (tmp)
 

Functions

void tetrahedralize (tetgenbehavior *b, tetgenio *in, tetgenio *out, tetgenio *addin=NULL, tetgenio *bgmin=NULL)
 
void tetrahedralize (char *switches, tetgenio *in, tetgenio *out, tetgenio *addin=NULL, tetgenio *bgmin=NULL)
 
void terminatetetgen (int x)
 
REAL exactinit ()
 
REAL orient3d (REAL *pa, REAL *pb, REAL *pc, REAL *pd)
 
REAL insphere (REAL *pa, REAL *pb, REAL *pc, REAL *pd, REAL *pe)
 
void swapBytes (unsigned char *var, int size)
 
bool testIsBigEndian ()
 

Macro Definition Documentation

◆ CROSS

#define CROSS (   v1,
  v2,
  n 
)
Value:
(n)[0] = (v1)[1] * (v2)[2] - (v2)[1] * (v1)[2];\
(n)[1] = -((v1)[0] * (v2)[2] - (v2)[0] * (v1)[2]);\
(n)[2] = (v1)[0] * (v2)[1] - (v2)[0] * (v1)[1]
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Map< RowVectorXf > v2(M2.data(), M2.size())
M1<< 1, 2, 3, 4, 5, 6, 7, 8, 9;Map< RowVectorXf > v1(M1.data(), M1.size())

◆ DIST

#define DIST (   p1,
  p2 
)     sqrt(NORM2((p2)[0] - (p1)[0], (p2)[1] - (p1)[1], (p2)[2] - (p1)[2]))

◆ Div2

#define Div2   >> 1

◆ EdgeRing

#define EdgeRing (   V)    ((V) Mod2)

◆ fastlookup

#define fastlookup (   pool,
  index 
)
Value:
(void *) ((pool)->toparray[(index) >> (pool)->log2objectsperblock] + \
((index) & ((pool)->objectsperblock - 1)) * (pool)->objectbytes)

◆ Mod2

#define Mod2   & 01

◆ NORM2

#define NORM2 (   x,
  y,
 
)    ((x) * (x) + (y) * (y) + (z) * (z))

◆ Orient

#define Orient (   V)    ((V) Div2)

◆ REAL

#define REAL   double

◆ SETVECTOR3

#define SETVECTOR3 (   V,
  a0,
  a1,
  a2 
)    (V)[0] = (a0); (V)[1] = (a1); (V)[2] = (a2)

◆ smarktest

#define smarktest (   s)     ((int *) ((s).sh))[shmarkindex] = (((int *)((s).sh))[shmarkindex] | (int) 2)

◆ smarktested

#define smarktested (   s)    ((((int *) ((s).sh))[shmarkindex] & (int) 2) != 0)

◆ sunmarktest

#define sunmarktest (   s)     ((int *) ((s).sh))[shmarkindex] = (((int *)((s).sh))[shmarkindex] & ~(int) 2)

◆ SWAP2

#define SWAP2 (   a0,
  a1,
  tmp 
)    (tmp) = (a0); (a0) = (a1); (a1) = (tmp)

◆ TETGEN_DOT

#define TETGEN_DOT (   v1,
  v2 
)     ((v1)[0] * (v2)[0] + (v1)[1] * (v2)[1] + (v1)[2] * (v2)[2])

◆ TETLIBRARY

#define TETLIBRARY

Function Documentation

◆ exactinit()

REAL exactinit ( )

◆ insphere()

REAL insphere ( REAL pa,
REAL pb,
REAL pc,
REAL pd,
REAL pe 
)

◆ orient3d()

REAL orient3d ( REAL pa,
REAL pb,
REAL pc,
REAL pd 
)

◆ swapBytes()

void swapBytes ( unsigned char var,
int  size 
)
inline
3411 {
3412  int i = 0;
3413  int j = size - 1;
3414  char c;
3415 
3416  while (i < j) {
3417  c = var[i]; var[i] = var[j]; var[j] = c;
3418  i++, j--;
3419  }
3420 }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
int c
Definition: calibrate.py:100
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References calibrate::c, i, j, and size.

◆ terminatetetgen()

void terminatetetgen ( int  x)
inline
2371 {
2372 #ifdef TETLIBRARY
2373  throw x;
2374 #else
2375  switch (x) {
2376  case 1: // Out of memory.
2377  printf("Error: Out of memory.\n");
2378  break;
2379  case 2: // Encounter an internal error.
2380  printf(" Please report this bug to sihang@mail.berlios.de. Include\n");
2381  printf(" the message above, your input data set, and the exact\n");
2382  printf(" command line you used to run this program, thank you.\n");
2383  break;
2384  default:
2385  printf("Program stopped.\n");
2386  } // switch (x)
2387  exit(x);
2388 #endif // #ifdef TETLIBRARY
2389 }
list x
Definition: plotDoE.py:28

References plotDoE::x.

◆ testIsBigEndian()

bool testIsBigEndian ( )
inline
3423 {
3424  short word = 0x4321;
3425  if((*(char *)& word) != 0x21)
3426  return true;
3427  else
3428  return false;
3429 }

◆ tetrahedralize() [1/2]

void tetrahedralize ( char switches,
tetgenio in,
tetgenio out,
tetgenio addin = NULL,
tetgenio bgmin = NULL 
)

◆ tetrahedralize() [2/2]

void tetrahedralize ( tetgenbehavior b,
tetgenio in,
tetgenio out,
tetgenio addin = NULL,
tetgenio bgmin = NULL 
)