#ifndef STAL_DISTANCE_CJL #define STAL_DISTANCE_CJL #include #include #include #include #include #include #include #include #include "ADFCreator.h" #define TRUE 1 #define FALSE 0 #define MAX_SPHERE_LEVELS 32 /*Data Structures */ typedef struct { double X[3]; } GPoint; inline void convertGPointToPoint( GPoint p1 , Point *p2) { p2->Set( p1.X[0] , p1.X[1] , p1.X[2] ); } inline void convertPointToDouble( Point p1 , double d[3] ) { d[0] = p1[0]; d[1] = p1[1]; d[2] = p1[2]; } typedef struct { double V[3]; //the direction double Orig[3]; //The vector origin } GVector; typedef struct { Point Point1; Point Point2; Point Point3; Vector Normal; } GTriangle; typedef struct GSphere { double r; double Orig[3]; GSphere* Children[2]; GSphere* Parent; int triangle; GSphere() { Parent = NULL; Children[0] = NULL; Children[1] = NULL; triangle = -1; } } GSphere; /** * Given that you have loaded the STL, this finds the closest distance to the STL * from a point and returns a new octree vertex of this point, which contains both the * distance to the triangle and the closest point */ octreeVtx * FindClosestDistance(GPoint *gTestPoint); void LoadSTL( char* filename , CLEDSGeometry * STL ); void CreateSphereTree(void); int getSphereRenderLevel(); void changeSphereRenderLevel(); void renderSphereTree(); #endif