home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Science / RasMol2 / transfor.h < prev   
Encoding:
C/C++ Source or Header  |  1994-10-28  |  4.8 KB  |  216 lines  |  [TEXT/KAHL]

  1. /* transfor.h
  2.  * RasMol2 Molecular Graphics
  3.  * Roger Sayle, October 1994
  4.  * Version 2.5
  5.  */
  6.  
  7. #define GroupAttr       0x00
  8. #define ChainAttr       0x01
  9. #define TempAttr    0x02
  10. #define ChargeAttr      0x03
  11.  
  12. #define MaskColourFlag  0x01
  13. #define MaskRadiusFlag  0x02
  14. #define MaskBothFlag    0x03
  15.  
  16. #define RibColInside    0x01
  17. #define RibColOutside   0x02
  18. #define RibColBoth      0x03
  19.  
  20. #ifdef EIGHTBIT
  21. #define DefaultAmbient    0.6
  22. #define DefaultColDepth   16
  23. #else
  24. #define DefaultAmbient    0.05
  25. #define DefaultColDepth   32
  26. #endif
  27.  
  28.  
  29. #define MAXSHADE 32
  30. typedef struct { 
  31.         Long refcount;
  32.         unsigned char r;
  33.         unsigned char g;
  34.         unsigned char b;
  35.     } ShadeDesc;
  36.  
  37.  
  38. #ifdef IBMPC
  39. #define Colour2Shade(x)  ((int)((x)-3)/ColourDepth)
  40. #define Shade2Colour(x)  ((x)*ColourDepth+3)
  41. #define BackCol    0
  42. #define BoxCol     1
  43. #define LabelCol   2
  44. #endif
  45.  
  46. #ifdef APPLEMAC
  47. #define Colour2Shade(x)  ((int)((x)-4)/ColourDepth)
  48. #define Shade2Colour(x)  ((x)*ColourDepth+4)
  49. #define BackCol    1
  50. #define BoxCol     2
  51. #define LabelCol   3
  52. #endif
  53.  
  54. #if !defined(IBMPC) && !defined(APPLEMAC)
  55. #define Colour2Shade(x)  ((int)((x)-8)/ColourDepth)
  56. #define Shade2Colour(x)  ((x)*ColourDepth+8)
  57. #define BackCol    5
  58. #define BoxCol     6
  59. #define LabelCol   7
  60. #endif
  61.  
  62.  
  63. #ifdef TRANSFORM
  64. ShadeDesc Shade[MAXSHADE];
  65. Real RotX[3],RotY[3],RotZ[3];
  66. Real MatX[3],MatY[3],MatZ[3];
  67. Real InvX[3],InvY[3],InvZ[3];
  68. Long OrigCX,OrigCY,OrigCZ;
  69. Long CenX, CenY, CenZ;
  70.  
  71. Real Ambient;
  72. Real Scale,MaxZoom;
  73. Real DScale,IScale;
  74. Long SideLen,Offset;
  75. Card WorldRadius,WorldSize;
  76. int XOffset,YOffset,ZOffset;
  77. int FakeSpecular,SpecPower;
  78. int ColourDepth,ColourMask;
  79. int BackR,BackG,BackB;
  80. int LabR,LabG,LabB;
  81. int BoxR,BoxG,BoxB;
  82. int UseLabelCol;
  83. int UseScreenClip;
  84. int ZoomRange;
  85.  
  86. int Hydrogens,HetaGroups;
  87. int DrawAtoms,MaxAtomRadius;
  88. int DrawBonds,MaxBondRadius;
  89. int DrawRibbon;
  90. int ZoneBoth;
  91.  
  92. #else
  93. extern ShadeDesc Shade[MAXSHADE];
  94. extern Real RotX[3],RotY[3],RotZ[3];
  95. extern Real MatX[3],MatY[3],MatZ[3];
  96. extern Real InvX[3],InvY[3],InvZ[3];
  97. extern Long OrigCX, OrigCY, OrigCZ;
  98. extern Long CenX, CenY, CenZ;
  99.  
  100. extern Real Ambient;
  101. extern Real Scale,MaxZoom;
  102. extern Real DScale,IScale;
  103. extern Long SideLen,Offset;
  104. extern Card WorldRadius,WorldSize;
  105. extern int XOffset,YOffset,ZOffset;
  106. extern int ColourDepth,ColourMask;
  107. extern int FakeSpecular,SpecPower;
  108. extern int BackR,BackG,BackB;
  109. extern int LabR,LabG,LabB;
  110. extern int BoxR,BoxG,BoxB;
  111. extern int UseLabelCol;
  112. extern int UseScreenClip;
  113. extern int ZoomRange;
  114.  
  115. extern int Hydrogens,HetaGroups;
  116. extern int DrawAtoms,MaxAtomRadius;
  117. extern int DrawBonds,MaxBondRadius;
  118. extern int DrawRibbon;
  119. extern int ZoneBoth;
  120.  
  121. #ifdef FUNCPROTO
  122. void SetRadiusValue( int );
  123. void SetRadiusTemperature();
  124. void SetVanWaalRadius();
  125. void DisableSpacefill();
  126. void EnableWireFrame( int, int );
  127. void EnableBackBone( int, int );
  128. void SetHBondStatus( int, int, int );
  129. void SetRibbonStatus( int, int, int );
  130. void DisableWireFrame();
  131. void DisableBackBone();
  132. void RestrictZone( int );
  133. void SelectZone( int );
  134.  
  135. int IsCPKColour( Atom __far * );
  136. int IsVDWRadius( Atom __far * );
  137.  
  138. void DefineColourMap();
  139. void ResetColourMap();
  140. void ColourBackNone();
  141. void ColourBondNone();
  142. void ColourHBondNone( int );
  143. void ColourHBondType();
  144. void ColourRibbonNone( int );
  145. void ColourBackAttrib( int, int, int );
  146. void ColourBondAttrib( int, int, int );
  147. void ColourHBondAttrib( int, int, int, int );
  148. void ColourRibbonAttrib( int, int, int, int );
  149. void ColourDotsAttrib( int, int, int );
  150. void ColourDotsPotential();
  151. void MonoColourAttrib( int, int, int );
  152. void ScaleColourAttrib( int );
  153. void CPKColourAttrib();
  154. void AminoColourAttrib();
  155. void ShapelyColourAttrib();
  156. void StructColourAttrib();
  157. void UserMaskAttrib( int );
  158.  
  159. void DetermineClipping();
  160. void InitialiseTransform();
  161. void InitialTransform();
  162. void PrepareTransform();
  163. void ReviseInvMatrix();
  164. void ApplyTransform();
  165. void ResetTransform();
  166.  
  167. #else /* non-ANSI C compiler */
  168. void SetRadiusValue();
  169. void SetRadiusTemperature();
  170. void SetVanWaalRadius();
  171. void DisableSpacefill();
  172. void EnableWireFrame();
  173. void EnableBackBone();
  174. void SetHBondStatus();
  175. void SetRibbonStatus();
  176. void DisableWireFrame();
  177. void DisableBackBone();
  178. void RestrictZone();
  179. void SelectZone();
  180.  
  181. int IsCPKColour();
  182. int IsVDWRadius();
  183.  
  184. void DefineColourMap();
  185. void ResetColourMap();
  186. void ColourBackNone();
  187. void ColourBondNone();
  188. void ColourHBondNone();
  189. void ColourHBondType();
  190. void ColourRibbonNone();
  191. void ColourBackAttrib();
  192. void ColourBondAttrib();
  193. void ColourHBondAttrib();
  194. void ColourRibbonAttrib();
  195. void ColourDotsAttrib();
  196. void ColourDotsPotential();
  197. void MonoColourAttrib();
  198. void ScaleColourAttrib();
  199. void CPKColourAttrib();
  200. void AminoColourAttrib();
  201. void ShapelyColourAttrib();
  202. void StructColourAttrib();
  203. void UserMaskAttrib();
  204.  
  205. void DetermineClipping();
  206. void InitialiseTransform();
  207. void InitialTransform();
  208. void PrepareTransform();
  209. void ReviseInvMatrix();
  210. void ApplyTransform();
  211. void ResetTransform();
  212.  
  213. #endif
  214. #endif
  215.  
  216.