home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / developm / source / macraysh.sit / Code / Headers / maceditor.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-05-13  |  3.4 KB  |  179 lines

  1. /*
  2.  * Maceditor.h
  3.  */
  4.  
  5. /* Resource pointers for dialog, and enumerated types for each control item */
  6. /* postfix codes are used to identify different types of control item :
  7.  
  8.         ST = static text
  9.         ET = editable text
  10.         SB = slider bar
  11.         CB = check box
  12.         PI = picture
  13.         IC = icon
  14.         BU = button
  15.         RB = radio button
  16.         UI = useritem
  17. */
  18.  
  19. #define editordialogR 133
  20. enum {
  21.     ewmodifyBU = 1,
  22.     ewcreateBU,
  23.     ewdeleteBU,
  24.     ewlightsBU,
  25.     sphereselectIC,
  26.     cylinderselectIC,
  27.     coneselectIC,
  28.     triangleselectIC,
  29.     torusselectIC,
  30.     blobselectIC,
  31.     boxselectIC,
  32.     discselectIC,
  33.     polyselectIC,
  34.     csgselectIC,
  35.     lightsselectIC,
  36.     cameraselectIC,
  37.     sideUI,
  38.     frontUI,
  39.     topUI,
  40.     backBU,
  41.     zoominBU,
  42.     zoomoutBU,
  43.     coordinfoUI,
  44.     worldlistUI
  45. } ;
  46.  
  47. /* Some Filter flags */
  48.  
  49. #define F_SPHERE    1
  50. #define F_CONE        2
  51. #define F_BOX        4
  52. #define F_TORUS        8 
  53. #define F_BLOB        16
  54. #define F_DISC        32
  55. #define F_TRIANGLE    64
  56. #define F_POLYGON    128
  57. #define F_HF        256
  58. #define F_CYLINDER    512
  59. #define F_CSG        1024
  60. #define F_LIST        2048
  61. #define F_GRID        4096
  62. #define F_INSTANCE    8192
  63. #define F_PLANE        16384
  64. #define F_LIGHTS    32768
  65. #define F_CAMERA    65536
  66.  
  67. #define SET_FILTER(flags)    FilterFlags |= (flags)
  68. #define UNSET_FILTER(flags)    FilterFlags &= ~(flags)
  69.  
  70. #define FILTER_SET(flags) (FilterFlags & (flags))
  71.  
  72. /* Now for some object types.
  73.  * Rayshade does not keep note of what type and object is. Therefore it is necessary to create
  74.  * a function that does this for you.
  75.  */
  76.  
  77. /* Each object ID may later correspond to the resource number of its associated icons 
  78.  * But for now they are just sequential
  79.  */
  80.  
  81. #define PLANE 0
  82. #define SPHERE 1
  83. #define CONE 2
  84. #define BOX 3
  85. #define TORUS 5
  86. #define BLOB 6
  87. #define DISC 7
  88. #define TRIANGLE 8
  89. #define POLYGON 9
  90. #define HF 10
  91. #define CYLINDER 11
  92. #define CSG 12
  93. #define LIST 13
  94. #define GRID 14
  95. #define INSTANCE 15
  96.  
  97. /* IDs for each light type */
  98.  
  99. #define L_POINT 0
  100. #define L_INFINITE 1
  101. #define L_SPOT 2
  102. #define L_JITTERED 3
  103. #define L_EXTENDED 4
  104.  
  105. /* IDs for each texture type */
  106.  
  107. #define T_BLOTCH 0
  108. #define T_BUMP 1
  109. #define T_CHECKER 2
  110. #define T_CLOUD 3
  111. #define T_FBM 4
  112. #define T_FBMBUMP 5
  113. #define T_GLOSS 6
  114. #define T_IMAGE 7
  115. #define T_MARBLE 8
  116. #define T_SKY 9
  117. #define T_STRIPE 10
  118. #define T_WOOD 11
  119.  
  120. /* IDs for each transform type */
  121.  
  122. #define TR_SCALE 0
  123. #define TR_TRANSLATE 1
  124. #define TR_ROTATE 2
  125. #define TR_TRANSFORM 3
  126.  
  127. /* IDs for each view plane */
  128.  
  129. #define VIEW_TOP 0
  130. #define VIEW_SIDE 1
  131. #define VIEW_FRONT 2
  132.  
  133. /* A rather large macro to convert from 3d to 2d points. Note that this macro also takes care
  134.  * of the Macintosh having its coords start in the top left of the screen
  135.  * by negating the y values
  136.  */
  137.  
  138. #define ProjectCoords(x,y,fx,fy,fz,viewdir)        \
  139.     {                                            \
  140.         switch(viewdir) {                        \
  141.         case VIEW_TOP:                            \
  142.             *(y) = (short) - ((fy) * zoom);        \
  143.             *(x) = (short) ((fx) * zoom) ;        \
  144.             break ;                                \
  145.         case VIEW_FRONT:                        \
  146.             *(x) = (short) ((fx) * zoom) ;        \
  147.             *(y) = (short) -((fz) * zoom) ;     \
  148.             break ;                                \
  149.         case VIEW_SIDE:                            \
  150.             *(x) = (short) ((fy) * zoom) ;        \
  151.             *(y) = (short) -((fz) * zoom) ;        \
  152.             break ;                                \
  153.         }                                        \
  154.     }
  155.  
  156.  
  157. extern Float zoom ;
  158.  
  159.  
  160. #define MAX_STACK_PARENTS 20
  161. #define MAX_STACK_OBJECTS 1000
  162.  
  163. struct ObjectStack {
  164.     Geom *parentlist[MAX_STACK_PARENTS] ;
  165.     Geom *objectlist[MAX_STACK_OBJECTS] ;
  166.     short numobjects ;
  167.     short numparents ;
  168. } ;
  169.  
  170.  
  171. #ifdef GEOM_H
  172. extern int ObjectType(Geom *o) ;
  173. #endif
  174. #ifdef LIGHT_H
  175. extern int LightType(Light *l) ;
  176. #endif
  177. #ifdef TEXTURE_H
  178. extern int TextureType(Texture *t) ;
  179. #endif