libmove3d  3.13.0
/home/slemaign/softs-local/BioMove3D-git/collision/Kcd/include/kcd_sys.h
00001 #ifndef KCD_SYS_H
00002 #define KCD_SYS_H
00003 
00004 #include "triangles.h"
00005 #include "kcd_aabb_tree.h"
00006 #include "../proto/kcd_proto.h"
00007 #include "math.h"
00008 
00009 #ifdef KCD_MOVE3D
00010 #include "p3d_sys.h"
00011   /* #define MY_REALLOC(ptr,type,oldn,newn) (type *)basic_realloc((void *)ptr,oldn,newn,sizeof(type)) */
00012 #else
00013 
00014 #include <stdlib.h>
00015 #include <malloc.h>
00016 #ifndef NULL
00017 #define NULL 0
00018 #endif
00019 #ifndef TRUE
00020 #define TRUE 1
00021 #endif
00022 #ifndef FALSE
00023 #define FALSE 0
00024 #endif
00025 
00026 #ifndef MY_ALLOC
00027 #define MY_ALLOC(type,n) (type *) malloc((unsigned)(sizeof(type) * n))
00028 #endif
00029 #ifndef MY_REALLOC
00030 #define MY_REALLOC(ptr,type,oldn,newn) (type *)realloc((void *)ptr,(unsigned)(sizeof(type) * newn))
00031 #endif
00032 #ifndef MY_FREE
00033 #define MY_FREE(ptr,type,n) free(ptr)
00034 #endif
00035 
00036 #ifndef FUZZ
00037 #define FUZZ 0.00001
00038 #endif
00039 #ifndef P3D_HUGE
00040 #define P3D_HUGE 1E10
00041 #endif
00042 #ifndef M_PI
00043 #define M_PI  3.14159265358979323846
00044 #endif
00045 
00046 #ifndef SQR
00047 #define SQR(x) ((x)*(x))
00048 #endif
00049 #ifndef MAX
00050 #define MAX(x,y)     (((x) > (y)) ? (x) : (y))
00051 #endif
00052 #ifndef MIN
00053 #define MIN(x,y)     (((x) < (y)) ? (x) : (y))
00054 #endif
00055 #ifndef MOD
00056 #define MOD(k,n)     ((k+n)%n)
00057 #endif
00058 #ifndef ABS
00059 #define ABS(x)       (((x) >= 0.0) ? (x) : -(x))
00060 #endif
00061 #ifndef EQ
00062 #define EQ(x,y)      (ABS((x)-(y)) < FUZZ)
00063 #endif
00064 #ifndef LEQ
00065 #define LEQ(x,y)     ((x)<(y) || EQ(x,y))
00066 #endif
00067 #ifndef GEQ
00068 #define GEQ(x,y)     ((x)>(y) || EQ(x,y))
00069 #endif
00070 #ifndef LNEQ
00071 #define LNEQ(x,y)    (!GEQ(x,y))
00072 #endif
00073 #ifndef GNEQ
00074 #define GNEQ(x,y)    (!LEQ(x,y))
00075 #endif
00076 #ifndef SIGN
00077 #define SIGN(f)      (((f) < 0) ? (-1) : (1))
00078 #endif
00079 
00080 #endif /* KCD_MOVE3D */
00081 
00082 
00083 
00084 #ifndef POLYHEDRON_ENTITY
00085 #define POLYHEDRON_ENTITY 0
00086 #endif
00087 #ifndef CONVEX_POLYHEDRON
00088 #define CONVEX_POLYHEDRON 1
00089 #endif
00090 #ifndef CONCAVE_POLYHEDRON
00091 #define CONCAVE_POLYHEDRON 2
00092 #endif
00093 #ifndef SPHERE_ENTITY
00094 #define SPHERE_ENTITY 3
00095 #endif
00096 #ifndef CUBE_ENTITY
00097 #define CUBE_ENTITY 4
00098 #endif
00099 #ifndef BOX_ENTITY
00100 #define BOX_ENTITY 5
00101 #endif
00102 #ifndef CYLINDER_ENTITY
00103 #define CYLINDER_ENTITY 6
00104 #endif
00105 #ifndef CONE_ENTITY
00106 #define CONE_ENTITY 7
00107 #endif
00108 
00109 /* Modif Pepijn june 2001 */ 
00110 
00111 #ifndef KCD_SMALL_VOLUME_BOX
00112 #define KCD_SMALL_VOLUME_BOX 8
00113 #endif
00114 
00115 #endif /* KCD_SYS_H */
00116 
00117 
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines