MSTRUCT.H

Go to the documentation of this file.
00001 /* --
00002 OpenFX - Modelling, Animation and Rendering Package
00003 -- */
00004 
00005 
00006 /* file mstruct.h */
00007 
00008 #ifndef min
00009 #define min(a,b)  ( ((a) < (b)) ? (a) : (b) )
00010 #endif
00011 #ifndef max
00012 #define max(a,b)  ( ((a) > (b)) ? (a) : (b) )
00013 #endif
00014 
00015 // This uses line drawing for multiple lines ???  may be OK  changed from version 1
00016 #define _LINE_DRAW 1
00017 #define X__SetPixel(a,b,c,d) SetPixelV(a,b,c,d)
00018 
00019 #include "../common/mem.h"
00020 
00026 #define VECCOPY(a,b)    { b[0] = a[0]; b[1] = a[1]; b[2] = a[2]; }
00027 #define VECSUB(a,b,c)   { c[0]=a[0]-b[0]; c[1]=a[1]-b[1]; c[2]=a[2]-b[2];}
00028 #define VECSUM(a,b,c)   { c[0]=a[0]+b[0]; c[1]=a[1]+b[1]; c[2]=a[2]+b[2];}
00029 #define VECSCALE(a,b,c) { c[0]=(a)*b[0]; c[1]=(a)*b[1]; c[2]=(a)*b[2];}
00030 #define DOT(a,b)        ( (a[0]*b[0]) + (a[1]*b[1]) + (a[2]*b[2]) )
00031 #define DOT2(a,b)       ( (a[0]*b[0]) + (a[1]*b[1]) )
00032 #define CROSS(v1,v2,r)  { \
00033                           r[0] = (v1[1]*v2[2]) - (v2[1]*v1[2]);  \
00034                           r[1] = (v1[2]*v2[0]) - (v1[0]*v2[2]);  \
00035                           r[2] = (v1[0]*v2[1]) - (v2[0]*v1[1]);  \
00036                          }
00037 
00038 #define DIS2(a) ((double)(a[0]-NpointerX)*(double)(a[0]-NpointerX)+  \
00039                  (double)(a[1]-NpointerY)*(double)(a[1]-NpointerY)+  \
00040                  (double)(a[2]-NpointerZ)*(double)(a[2]-NpointerZ))
00041 
00042 #include "struct.h"
00043 #include "..\animate\memory.h"
00044 
00051 typedef struct Designer_KEY_POINTS_tag {
00052        vertex Origin;
00053        vertex Offset;
00054 } key_points;
00055 
00061 typedef struct Designer_BEZIER_CURVE_tag{
00062   char  name[8];
00063   short Nc,Np,flag;
00064   long *Vc,*Vp;
00065 } bezier_curve;
00066 
00072 typedef struct Designer_PRIMITIVE_tag {
00073   unsigned char fc[3];
00074   int nsides,smooth,faces,ml,mw,nsteps;
00075   double length,width,height,radius;
00076   double lr,fb,ud;
00077   BOOL auto_interactive;
00078   int nvert,nhorz;
00079   double torus_ratio;
00080 } PRIMITIVE;
00081 
00087 typedef struct Designer_PREFERENCES_tag {
00088   BOOL show_select;
00089   BOOL buttons;
00090   BOOL quick_trick;
00091   BOOL undo;
00092   BOOL use_3d_dialogs;
00093   BOOL use_OpenGL;
00094   unsigned char Vcolour[3];
00095   BOOL tooltips;
00096   BOOL attribs_sheet;
00097   BOOL bigv;
00098   BOOL use_positions;
00099   BOOL toolsmall;
00100   BOOL toolleft;
00101   BOOL background;
00102   BOOL embedimages;
00103 } PREFERENCES;
00104 
00105 #define ALL_PANNELS     0x0FFF
00106 #define MAIN_WINDOW     0x0001
00107 #define SELECT_PANNEL   0x0002
00108 #define COMMAND_PANNEL  0x0004
00109 #define ZOOM_PANNEL     0x0008
00110 #define TOOL_PANNEL     0x0010
00111 #define ACTION_PANNEL   0x0020
00112 #define COORD_PANNEL    0x0040
00113 #define LOCK_PANNEL     0x0080
00114 
00115 #define PLANE            0              /* brush map types */
00116 #define CYLINDER         1
00117 #define PLANE_MOZIAC     2
00118 #define CYLINDER_MOZIAC  3
00119 #define MAP_BY_VERTEX    4
00120 #define MAP_SPHERICAL    5
00121 #define OPAQ             0              /* brush color 0   */
00122 #define CLEAR            1
00123 #define GLOSS            0              /* brush shiny     */
00124 #define MATT             1
00125 
00126 #define TRIVIEW          0
00127 #define ONEVIEW          1
00128 #define TRITOP           0
00129 #define TRIFRONT         1
00130 #define TRIRIGHT         2
00131 
00132 /* Macro Function Definitions */
00133 #define POINT2VECTOR(p,v) v[0]=(double)p[0]; v[1]=(double)p[1]; \
00134                           v[2]=(double)p[2];
00135 #define VECTOR2POINT(v,p) p[0]=(long)v[0]; p[1]=(long)v[1]; \
00136                           p[2]=(long)v[2];
00137 
00138 /* definition of unit dimensions      */
00139 #define FARAWAY      1.0e30
00140 #define UNIT         32768L
00141 #define UNIT2        65536L
00142 #define MINUNIT       2048L     // was 1024 trying larger to prevent error
00143               //1073741824L
00144 //#define MAXUNIT    4194304L
00145 #define MAXUNIT   33554432L
00146 #ifndef PI
00147 #define PI 3.1415926
00148 #endif
00149 #define PI2            PI/2
00150 
00151 /* definitionof  sizes etc            */
00152 #define NMAPSMAX       512
00153 #define NMATERIALMAX   512
00154 
00155 /* definition of flags and identifiers*/
00156 #define DESELECTED       0
00157 #define SELECTED         1
00158 #define HIDDEN           2
00159 #define INEDITOR         3
00160 #define STATICBRUSH      0
00161 #define ANIMBRUSH        1
00162 #define BUMPBRUSH        2
00163 #define REFLBRUSH        3
00164 #define PSETBRUSH        4
00165 #define ATTRACT          0
00166 #define REPEL            1
00167 
00168 /* general defines  */
00169 #define NO               0
00170 #define YES              1
00171 #define FAIL            -1
00172 #define OK               1
00173 #define MAX_DIR        255
00174 #define MAX_FILE       255
00175 #define ZOOMOUT          0
00176 #define ZOOMIN           1
00177 #define PANUP            2
00178 #define PANDOWN          3
00179 #define PANLEFT          4
00180 #define PANRIGHT         5
00181 #define PANFORWARD       6
00182 #define PANBACK          7
00183 #define RECENTRE         8
00184 #define CENTREWORLD      9
00185 
00186 /* tools and actions */
00187 
00188 #include "mtools.h"
00189 

Generated on Sun Apr 27 14:20:11 2014 for OpenFX by  doxygen 1.5.6