Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

basic.h

00001 /*******************************************************************************
00002 
00003    BASIC.H
00004 
00005    Author: Peter Loan
00006 
00007    Copyright (c) 1996-2001 MusculoGraphics, a division of Motion Analysis Corp.
00008    All rights reserved.
00009 
00010    Description: This file contains #defines and enums that are used by most
00011       of the Pipeline source files.
00012 
00013 *******************************************************************************/
00014 
00015 #ifndef BASIC_H
00016 #define BASIC_H
00017 
00018 /* integration parameters */
00019 #define NUM_STEPS 100              /* default number of integration intervals */
00020 #define INTEGRATION_TOL 1e-5       /* integration tolerance, size of allowable error */
00021 #define MIN_INTEGRATION_STEP 1e-7  /* minimum step size in integration, should generally */
00022                                    /* be at least 10 times smaller than INTEGRATION_TOL */
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 /* wrapping algorithms
00094  */
00095 #define WE_HYBRID_ALGORITHM    0   /* Frans + fan algorithm */
00096 #define WE_MIDPOINT_ALGORITHM  1   /* midpoint algorithm    */
00097 #define WE_AXIAL_ALGORITHM     2   /* Frans only algorithm  */
00098 #define WE_NUM_WRAP_ALGORITHMS 3
00099 
00100 #define WE_FAN_ALGORITHM       4   /* fan only algorithm    */
00101 
00102 typedef double Quat[4];
00103 typedef double DMatrix[4][4];
00104 
00105 ENUM
00106 {
00107    code_fine,                        /* fine, no error was encountered */
00108    code_bad                          /* bad, an error was encountered */
00109 } ReturnCode;                        /* error condition values */
00110 
00111 
00112 ENUM
00113 {
00114    defining_element,                 /* defining an element's properties */
00115    declaring_element,                /* using the element name, not defining it */
00116    just_checking_element             /* just checking to see if already defined */
00117 } EnterMode;                         /* modes when entering/defining model elements */
00118 
00119 
00120 ENUM
00121 {
00122    recover,                          /* recover from error */
00123    abort_action,                     /* abort action; critical error */
00124    exit_program,                     /* exit program; fatal error */
00125    none                              /* no action; no error */
00126 } ErrorAction;                       /* error recovery actions */
00127 
00128 
00129 ENUM
00130 {
00131    zeroth,                           /* zeroth derivative */
00132    first,                            /* first derivative */
00133    second                            /* second derivative */
00134 } Derivative;                        /* function derivative values */
00135 
00136 
00137 ENUM
00138 {
00139    no,                               /* no */
00140    yes                               /* yes */
00141 } SBoolean;                          /* conventional boolean */
00142 
00143 
00144 ENUM
00145 {
00146    off,                              /* off */
00147    on                                /* on */
00148 } OnOffSwitch;                       /* conventional on/off switch */
00149 
00150 
00151 ENUM
00152 {
00153    type_int,                         /* integer */
00154    type_double,                      /* double */
00155    type_char,                        /* single character */
00156    type_string                       /* string */
00157 } VariableType;                      /* variable types that can be read from string */
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 /* BASIC_H */

Generated on Wed Aug 20 02:17:05 2003 for Simulation Software by doxygen1.3