Subversion Repositories gelsvn

Rev

Rev 385 | Rev 595 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 385 Rev 417
Line 15... Line 15...
15
#include <math.h>
15
#include <math.h>
16
#include <iostream>
16
#include <iostream>
17
#include <vector>
17
#include <vector>
18
#include <list>
18
#include <list>
19
#include <sys/types.h>
19
#include <sys/types.h>
-
 
20
#include "CGLA/CGLA.h"
20
#include "Polygonizer.h"
21
#include "Polygonizer.h"
21
 
22
 
22
using namespace std;
23
using namespace std;
-
 
24
using namespace CGLA;
23
 
25
 
24
namespace Geometry
26
namespace Geometry
25
{
27
{
26
 
28
 
27
	namespace
29
	namespace
Line 47... Line 49...
47
		/* the LBN corner of cube (i, j, k), corresponds with location
49
		/* the LBN corner of cube (i, j, k), corresponds with location
48
		 * (start.x+(i-.5)*size, start.y+(j-.5)*size, start.z+(k-.5)*size) */
50
		 * (start.x+(i-.5)*size, start.y+(j-.5)*size, start.z+(k-.5)*size) */
49
 
51
 
50
		inline float RAND() 
52
		inline float RAND() 
51
		{
53
		{
52
			return (rand()&32767)/32767.0f;
54
			return (gel_rand()&GEL_RAND_MAX)/static_cast<float>(GEL_RAND_MAX);
53
		}
55
		}
54
 
56
 
55
		const int HASHBIT = 5;
57
		const int HASHBIT = 5;
56
 
58
 
57
		const int HASHSIZE = (size_t)(1<<(3*HASHBIT));   
59
		const int HASHSIZE = (size_t)(1<<(3*HASHBIT));   
Line 646... Line 648...
646
		{
648
		{
647
			int noabort;
649
			int noabort;
648
			TEST in, out;
650
			TEST in, out;
649
  
651
  
650
			/* find point on surface, beginning search at (x, y, z): */
652
			/* find point on surface, beginning search at (x, y, z): */
651
			srand(1);
653
			gel_srand(1);
652
			in = find(1, x, y, z);
654
			in = find(1, x, y, z);
653
			out = find(0, x, y, z);
655
			out = find(0, x, y, z);
654
			if (!in.ok || !out.ok) 
656
			if (!in.ok || !out.ok) 
655
            {
657
            {
656
                exit(1);
658
                exit(1);