/* SPBasic.h -- basic data types for the spherical splines project. */ /* Last edited on 2008-07-14 20:43:17 by stolfi */ #ifndef SPBasic_H #define SPBasic_H #include #include typedef enum { negative = -1, nullary = 0, positive = 1 } Sign; typedef char * string; typedef r3_t R3Point; /* Point of {R^3}, possibly not on {S^2}. */ typedef r3_t R3Gradient; /* Gradient relative to Cartesian coordinates. */ typedef r6_t R3Hessian; /* Hessian lower triang matrix rel to Cartesian coords. */ typedef r3_t R3Vector; /* Vector of {R^3}, possibly not tangent {S^2}. */ typedef r3_t S2Point; /* Point on the sphere {S^2}. */ typedef r3_t S2Gradient; /* Spherical gradient (tangent to {S^2}). */ typedef double ScalarField (S2Point *p); typedef r3_t VectorField (S2Point *p); typedef r3_t Color; typedef signed char int8; typedef unsigned char nat8; #define TWOPI (2*M_PI) #define FOURPI (4*M_PI) #define PHI (1.6180339887498948482) #define SQRT3 (1.73205080756887729352) #define SQRTHALF (0.70710678118654752440084) /* Some useful macros: */ #define mumble(...) \ do { if (verbose) { fprintf(stderr, __VA_ARGS__); } } while(0) /* Arrays of {R3Point}s */ vec_typedef(R3Point_vec,R3Point_vec,R3Point); /* Arrays of {S2Point}s */ #define S2Point_vec R3Point_vec #define S2Point_vec_new R3Point_vec_new #define S2Point_vec_expand R3Point_vec_expand #define S2Point_vec_trim R3Point_vec_trim #endif