Subversion Repositories gelsvn

Rev

Rev 417 | Rev 601 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 417 Rev 595
Line 8... Line 8...
8
 
8
 
9
J. Andreas Bærentzen 2003.
9
J. Andreas Bærentzen 2003.
10
 
10
 
11
**********************************************************************/
11
**********************************************************************/
12
 
12
 
-
 
13
/* Original Comment
-
 
14
 
-
 
15
 * C code from the article
-
 
16
 * "An Implicit Surface Polygonizer"
-
 
17
 * http::www.unchainedgeometry.com/jbloom/papers/polygonizer.pdf
-
 
18
 * by Jules Bloomenthal, jules@bloomenthal.com
-
 
19
 * in "Graphics Gems IV", Academic Press, 1994 */
-
 
20
 
-
 
21
/* polygonizer.c - implicit surface polygonizer, translated from Mesa
-
 
22
 *
-
 
23
 * Authored by Jules Bloomenthal, Xerox PARC.
-
 
24
 * Copyright (c) Xerox Corporation, 1991.  All rights reserved.
-
 
25
 * Permission is granted to reproduce, use and distribute this code for
-
 
26
 * any and all purposes, provided that this notice appears in all copies.  */
-
 
27
 
13
#include <string>
28
#include <string>
14
#include <stdlib.h>
29
#include <stdlib.h>
15
#include <math.h>
30
#include <math.h>
16
#include <iostream>
31
#include <iostream>
17
#include <vector>
32
#include <vector>
Line 60... Line 75...
60
 
75
 
61
		const int MASK = ((1<<HASHBIT)-1);
76
		const int MASK = ((1<<HASHBIT)-1);
62
 
77
 
63
		inline int HASH( int i, int j,int k) 
78
		inline int HASH( int i, int j,int k) 
64
		{ 
79
		{ 
65
			return (((((i&MASK)<<HASHBIT)|j&MASK)<<HASHBIT)|k&MASK);
80
			return (((((i&MASK)<<HASHBIT)|(j&MASK))<<HASHBIT)|(k&MASK));
66
		} 
81
		} 
67
 
82
 
68
		inline int BIT(int i, int bit) 
83
		inline int BIT(int i, int bit) 
69
		{ 
84
		{ 
70
			return (i>>bit)&1; 
85
			return (i>>bit)&1;