chull.C File Reference

Go to the source code of this file.

Defines

#define SWAP(t, x, y)   { t = x; x = y; y = t; }
#define NEW(p, type)
#define FREE(p)   if (p) { free ((char *) p); p = NULL; }
#define HULL_ADD(head, p)
#define HULL_DELETE(head, p)
#define DESELECTED   0
#define SELECTED   1
#define MINUNIT   2048L
#define MAXUNIT   33554432L
#define min(a, b)   ( ((a) < (b)) ? (a) : (b) )
#define max(a, b)   ( ((a) > (b)) ? (a) : (b) )
#define X   0
#define Y   1
#define Z   2
#define ONHULL   TRUE
#define REMOVED   TRUE
#define VISIBLE   TRUE
#define PROCESSED   TRUE
#define SAFE   1000000

Typedefs

typedef BOOL bool
typedef struct tVertexStructure tsVertex
typedef tsVertextVertex
typedef struct tEdgeStructure tsEdge
typedef tsEdgetEdge
typedef struct tFaceStructure tsFace
typedef tsFacetFace

Functions

BOOL DoubleTriangle (void)
void ConstructHull (void)
tVertex MakeNullVertex (void)
void DeleteTemporaryStructures (void)
BOOL WINAPI DllMain (HANDLE hDLL, DWORD dwReason, LPVOID lpReserved)
BOOL _Xmodeler (HWND parent_window, HWND info_window, X__STRUCTURE *lpevi)
void ReadVertices (void)
void Print (void)
void SubVec (int a[3], int b[3], int c[3])
bool HULL_ADDOne (tVertex p)
int VolumeSign (tFace f, tVertex p)
int Volumei (tFace f, tVertex p)
tFace MakeConeFace (tEdge e, tVertex p)
void MakeCcw (tFace f, tEdge e, tVertex p)
tEdge MakeNullEdge (void)
tFace MakeNullFace (void)
tFace MakeFace (tVertex v0, tVertex v1, tVertex v2, tFace f)
void CleanUp (void)
void CleanEdges (void)
void CleanFaces (void)
void CleanVertices (void)
bool Collinear (tVertex a, tVertex b, tVertex c)

Variables

jmp_buf jmp_buf_here
tVertex vertices = NULL
tEdge edges = NULL
tFace faces = NULL


Define Documentation

#define SWAP ( t,
x,
y   )     { t = x; x = y; y = t; }

Definition at line 65 of file chull.C.

#define NEW ( p,
type   ) 

Value:

if ((p=(type *) malloc (sizeof(type))) == NULL) {\
                                longjmp(jmp_buf_here,-1);\
                        }

Definition at line 68 of file chull.C.

Referenced by MakeNullEdge(), MakeNullFace(), and MakeNullVertex().

#define FREE (  )     if (p) { free ((char *) p); p = NULL; }

Definition at line 72 of file chull.C.

Referenced by DeleteTemporaryStructures().

#define HULL_ADD ( head,
 ) 

Value:

if ( head )  { \
                                p->next = head; \
                                p->prev = head->prev; \
                                head->prev = p; \
                                p->prev->next = p; \
                        } \
                        else { \
                                head = p; \
                                head->next = head->prev = p; \
                        }

Definition at line 75 of file chull.C.

Referenced by MakeNullEdge(), MakeNullFace(), and MakeNullVertex().

#define HULL_DELETE ( head,
 ) 

Value:

if ( head )  { \
                                if ( head == head->next ) \
                                        head = NULL;  \
                                else if ( p == head ) \
                                        head = head->next; \
                                p->next->prev = p->prev;  \
                                p->prev->next = p->next;  \
                                FREE( p ); \
                        }

Definition at line 86 of file chull.C.

Referenced by CleanEdges(), CleanFaces(), and CleanVertices().

#define DESELECTED   0

Definition at line 98 of file chull.C.

#define SELECTED   1

Definition at line 99 of file chull.C.

#define MINUNIT   2048L

Definition at line 100 of file chull.C.

#define MAXUNIT   33554432L

Definition at line 101 of file chull.C.

#define min ( a,
 )     ( ((a) < (b)) ? (a) : (b) )

Definition at line 104 of file chull.C.

#define max ( a,
 )     ( ((a) > (b)) ? (a) : (b) )

Definition at line 107 of file chull.C.

#define X   0

#define Y   1

#define Z   2

#define ONHULL   TRUE

Definition at line 319 of file chull.C.

Referenced by CleanVertices(), HULL_ADDOne(), and MakeNullVertex().

#define REMOVED   TRUE

Definition at line 320 of file chull.C.

Referenced by HULL_ADDOne(), and MakeNullEdge().

#define VISIBLE   TRUE

Definition at line 321 of file chull.C.

Referenced by HULL_ADDOne(), and MakeNullFace().

#define PROCESSED   TRUE

Definition at line 322 of file chull.C.

Referenced by ConstructHull(), DoubleTriangle(), and MakeNullVertex().

#define SAFE   1000000

Definition at line 323 of file chull.C.


Typedef Documentation

typedef BOOL bool

Definition at line 21 of file chull.C.

typedef struct tVertexStructure tsVertex

Definition at line 23 of file chull.C.

typedef tsVertex* tVertex

Definition at line 24 of file chull.C.

typedef struct tEdgeStructure tsEdge

Definition at line 26 of file chull.C.

typedef tsEdge* tEdge

Definition at line 27 of file chull.C.

typedef struct tFaceStructure tsFace

Definition at line 29 of file chull.C.

typedef tsFace* tFace

Definition at line 30 of file chull.C.


Function Documentation

BOOL DoubleTriangle ( void   ) 

Definition at line 377 of file chull.C.

References Collinear(), FALSE, MakeFace(), PROCESSED, TRUE, vertices, and VolumeSign().

Referenced by _Xmodeler().

void ConstructHull ( void   ) 

Definition at line 427 of file chull.C.

References CleanUp(), HULL_ADDOne(), PROCESSED, and vertices.

Referenced by _Xmodeler().

tVertex MakeNullVertex ( void   ) 

Definition at line 346 of file chull.C.

References HULL_ADD, NEW, ONHULL, PROCESSED, and vertices.

Referenced by _Xmodeler().

void DeleteTemporaryStructures ( void   ) 

Definition at line 267 of file chull.C.

References edges, faces, FREE, and vertices.

Referenced by _Xmodeler().

BOOL WINAPI DllMain ( HANDLE  hDLL,
DWORD  dwReason,
LPVOID  lpReserved 
)

Definition at line 131 of file chull.C.

References DLL_PROCESS_ATTACH, DLL_PROCESS_DETACH, hThisInstance, and TRUE.

BOOL _Xmodeler ( HWND  parent_window,
HWND  info_window,
X__STRUCTURE lpevi 
)

void ReadVertices ( void   ) 

Referenced by LoadObject(), and Restore_Undo().

void Print ( void   ) 

void SubVec ( int  a[3],
int  b[3],
int  c[3] 
)

Definition at line 360 of file chull.C.

bool HULL_ADDOne ( tVertex  p  ) 

Definition at line 450 of file chull.C.

References edges, faces, FALSE, MakeConeFace(), ONHULL, REMOVED, TRUE, VISIBLE, and VolumeSign().

Referenced by ConstructHull().

int VolumeSign ( tFace  f,
tVertex  p 
)

Definition at line 497 of file chull.C.

References X, Y, and Z.

Referenced by DoubleTriangle(), and HULL_ADDOne().

int Volumei ( tFace  f,
tVertex  p 
)

Definition at line 524 of file chull.C.

References X, Y, and Z.

tFace MakeConeFace ( tEdge  e,
tVertex  p 
)

Definition at line 550 of file chull.C.

References MakeCcw(), MakeNullEdge(), and MakeNullFace().

Referenced by HULL_ADDOne().

void MakeCcw ( tFace  f,
tEdge  e,
tVertex  p 
)

Definition at line 597 of file chull.C.

References SWAP.

Referenced by MakeConeFace().

tEdge MakeNullEdge ( void   ) 

Definition at line 632 of file chull.C.

References edges, HULL_ADD, NEW, and REMOVED.

Referenced by MakeConeFace(), and MakeFace().

tFace MakeNullFace ( void   ) 

Definition at line 649 of file chull.C.

References faces, HULL_ADD, NEW, and VISIBLE.

Referenced by MakeConeFace(), and MakeFace().

tFace MakeFace ( tVertex  v0,
tVertex  v1,
tVertex  v2,
tFace  f 
)

Definition at line 667 of file chull.C.

References MakeNullEdge(), and MakeNullFace().

Referenced by DoubleTriangle().

void CleanUp ( void   ) 

Definition at line 702 of file chull.C.

References CleanEdges(), CleanFaces(), and CleanVertices().

Referenced by ConstructHull().

void CleanEdges ( void   ) 

Definition at line 713 of file chull.C.

References edges, and HULL_DELETE.

Referenced by CleanUp().

void CleanFaces ( void   ) 

Definition at line 749 of file chull.C.

References faces, and HULL_DELETE.

Referenced by CleanUp().

void CleanVertices ( void   ) 

Definition at line 772 of file chull.C.

References edges, HULL_DELETE, ONHULL, and vertices.

Referenced by CleanUp().

bool Collinear ( tVertex  a,
tVertex  b,
tVertex  c 
)

Definition at line 812 of file chull.C.

References X, Y, and Z.

Referenced by DoubleTriangle().


Variable Documentation

jmp_buf jmp_buf_here

Definition at line 18 of file chull.C.

Referenced by _Xmodeler().

tVertex vertices = NULL

tEdge edges = NULL

tFace faces = NULL

Definition at line 123 of file chull.C.

Referenced by _Xmodeler(), CleanFaces(), DeleteTemporaryStructures(), HULL_ADDOne(), and MakeNullFace().


Generated on Sun Apr 27 14:20:15 2014 for OpenFX by  doxygen 1.5.6