00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef BASIC_H
00016 #define BASIC_H
00017
00018
00019 #define NUM_STEPS 100
00020 #define INTEGRATION_TOL 1e-5
00021 #define MIN_INTEGRATION_STEP 1e-7
00022
00023
00024 #define NO 0
00025 #define YES 1
00026 #define M_PI 3.1415926535897932384626433832795
00027 #define RAD2DEG(x) ((x) * 180.0/M_PI)
00028 #define DEG2RAD(x) ((x) * M_PI/180.0)
00029
00030 #define STRUCT typedef struct
00031 #define UNION typedef union
00032 #define ENUM typedef enum
00033
00034 #define GROUND -1
00035 #define TRUE 1
00036 #define FALSE 0
00037
00038 #define XX 0
00039 #define YY 1
00040 #define ZZ 2
00041 #define WW 3
00042
00043 #define SPACE ' '
00044 #define TAB '\t'
00045 #define CARRIAGE_RETURN '\n'
00046 #define STRING_TERMINATOR '\0'
00047
00048 #define TIME -1
00049
00050 #define END_OF_ARRAY -1
00051 #define TINY_NUMBER 0.0000001
00052
00053 #define MAX_USER_FUNCTIONS 10
00054 #define SPLINE_ARRAY_INCREMENT 20
00055 #define ARRAY_INCREMENT 10
00056
00057 #define MUSCLEBUFFER 96
00058 #define SEGMENTBUFFER 32
00059 #define GENBUFFER 64
00060 #define GROUPBUFFER 96
00061 #define CHARBUFFER 500
00062
00063 #define MAXMDOUBLE 99999.99
00064 #define MINMDOUBLE -99999.99
00065 #define ERROR_DOUBLE -999999.3
00066 #define DONT_CHECK_DOUBLE -999999.5
00067 #define ERROR_INT -32760
00068 #define ROUNDOFF_ERROR 0.0000000000002
00069 #define MINIMUM_DIVISOR 0.0000001
00070 #define DEG_TO_RAD 0.017453292519943
00071 #define RAD_TO_DEG 57.295779513082323
00072 #define DTOR DEG_TO_RAD
00073 #define RTOD RAD_TO_DEG
00074 #define GRAV_CONSTANT 9.80665
00075 #define MAX_MATRIX_SIZE 500
00076
00077 #define ON_RAY 0
00078 #define ABOVE_RAY 1
00079 #define BELOW_RAY 2
00080
00081 #ifdef WIN32
00082 #define DIR_SEP_CHAR '\\'
00083 #define DIR_SEP_STRING "\\"
00084
00085 #define COPY_COMMAND "copy"
00086 #else
00087 #define DIR_SEP_CHAR '/'
00088 #define DIR_SEP_STRING "/"
00089
00090 #define COPY_COMMAND "cp"
00091 #endif
00092
00093
00094
00095 #define WE_HYBRID_ALGORITHM 0
00096 #define WE_MIDPOINT_ALGORITHM 1
00097 #define WE_AXIAL_ALGORITHM 2
00098 #define WE_NUM_WRAP_ALGORITHMS 3
00099
00100 #define WE_FAN_ALGORITHM 4
00101
00102 typedef double Quat[4];
00103 typedef double DMatrix[4][4];
00104
00105 ENUM
00106 {
00107 code_fine,
00108 code_bad
00109 } ReturnCode;
00110
00111
00112 ENUM
00113 {
00114 defining_element,
00115 declaring_element,
00116 just_checking_element
00117 } EnterMode;
00118
00119
00120 ENUM
00121 {
00122 recover,
00123 abort_action,
00124 exit_program,
00125 none
00126 } ErrorAction;
00127
00128
00129 ENUM
00130 {
00131 zeroth,
00132 first,
00133 second
00134 } Derivative;
00135
00136
00137 ENUM
00138 {
00139 no,
00140 yes
00141 } SBoolean;
00142
00143
00144 ENUM
00145 {
00146 off,
00147 on
00148 } OnOffSwitch;
00149
00150
00151 ENUM
00152 {
00153 type_int,
00154 type_double,
00155 type_char,
00156 type_string
00157 } VariableType;
00158
00159
00160 ENUM
00161 {
00162 old_ascii,
00163 new_ascii,
00164 binary,
00165 unknown,
00166 file_not_found
00167 } FileType;
00168
00169
00170 STRUCT
00171 {
00172 SBoolean muscles;
00173 SBoolean contact_forces;
00174 SBoolean joint_reaction_forces;
00175 SBoolean mass_center_positions;
00176 SBoolean mass_center_velocities;
00177 SBoolean system_energy;
00178 SBoolean joint_reaction_torques;
00179 SBoolean hinge_torques;
00180 SBoolean spring_forces;
00181 int num_spring_forces;
00182 } OutputOptions;
00183
00184 #endif