home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 460.lha / 3DPlot_v2.0 / sources / data.h < prev    next >
Text File  |  1991-01-04  |  3KB  |  153 lines

  1. /* Constants */
  2.  
  3. #define NOTELEN        80
  4. #define EQLEN           80
  5. #define NUMINDVAR    9
  6.  
  7.  
  8. /* FORM and CHUNK ID's */
  9.  
  10. #define ID_3DPL   MakeID('3','D','P','L')
  11. #define ID_DRAW   MakeID('D','R','A','W')
  12. #define ID_AXES   MakeID('A','X','E','S')
  13. #define ID_TICS   MakeID('T','I','C','S')
  14. #define ID_NOTE   MakeID('N','O','T','E')
  15. #define ID_EQUN   MakeID('E','Q','U','N')
  16. #define ID_TYPE   MakeID('T','Y','P','E')
  17.  
  18.  
  19. /* Structure definitions */
  20.  
  21. typedef struct {
  22.   DOUBLE RotationX, RotationY,
  23.      RotationZ;              /* Rotation about each axis
  24.                      in degrees */
  25.   LONG     OriginX, OriginY;          /* Location of origin in window
  26.                      by pixels */
  27.   DOUBLE ProjPlane, ViewDist, Scale;  /* Location of projection plane along
  28.                      the default Z-axis, viewer distance
  29.                      from the projection plane in axis
  30.                      units, & pixels per axis unit */
  31.   DOUBLE LineSpacingX, LineSpacingY;  /* Distance between grid lines
  32.                      in axis units */
  33.   DOUBLE PlotXmin, PlotXmax,
  34.      PlotYmin, PlotYmax;          /* Plot region in X-Y plane in
  35.                      axis units */
  36.   DOUBLE PlotPrecisionX,
  37.      PlotPrecisionY;          /* Distance between each plotted point
  38.                      along grid lines in axis units */
  39. } DrawData;
  40.  
  41.  
  42. typedef struct {
  43.   DOUBLE AxesXmin, AxesXmax,
  44.      AxesYmin, AxesYmax,
  45.      AxesZmin, AxesZmax;       /* Axes range in 3 directions in
  46.                       axis units */
  47.   DOUBLE AxesPrecision;        /* Distance between each plotted point
  48.                       along each axis in axis units */
  49. } AxesData;
  50.  
  51.  
  52. typedef struct {
  53.   DOUBLE TicX, TicY, TicZ;          /* Distance between tic marks in
  54.                      axis units */
  55.   ULONG  NumTicX, NumTicY, NumTicZ;   /* Number of tics between axis number
  56.                      labels */
  57. } TicData;
  58.  
  59.  
  60. typedef struct {
  61.   UBYTE DependVar;        /* Dependent variable */
  62.   UBYTE IndependVar[NUMINDVAR];  /* Independent variables */
  63.   TEXT    Equation[EQLEN];       /* Function DependVar = "F(IndependVar)" */
  64. } EqInfo;
  65.  
  66.  
  67. typedef struct {
  68.   UBYTE  Surface, AxesType,
  69.      RotationOrder, Pad0;       /* Surface type, axes type, rotation
  70.                       order, & pad */
  71. } PlotInfo;
  72.  
  73.  
  74. /* The NOTE can be any string variable */
  75.  
  76.  
  77. /* Structure that contains all above data */
  78.  
  79. typedef struct {
  80.    DrawData dd;
  81.    AxesData ad;
  82.    TicData  td;
  83.    EqInfo   ei;
  84.    PlotInfo pi;
  85.    TEXT     nt[NOTELEN];
  86. } AllPlotData;
  87.  
  88.  
  89. /* Macros for writing data to file */
  90.  
  91. #define PutDRAW(context,drawData) \
  92.     PutCk(ID_DRAW,sizeof(DrawData),context,(BYTE *)drawData)
  93.  
  94. #define PutAXES(context,axesData) \
  95.     PutCk(ID_AXES,sizeof(AxesData),context,(BYTE *)axesData)
  96.  
  97. #define PutTICS(context,ticData) \
  98.     PutCk(ID_TICS,sizeof(TicData),context,(BYTE *)ticData)
  99.  
  100. #define PutEQUN(context,eqInfo) \
  101.     PutCk(ID_EQUN,sizeof(EqInfo),context,(BYTE *)eqInfo)
  102.  
  103. #define PutTYPE(context,plotInfo) \
  104.     PutCk(ID_TYPE,sizeof(PlotInfo),context,(BYTE *)plotInfo)
  105.  
  106. #define PutNOTE(context,note) \
  107.     PutCk(ID_NOTE,NOTELEN,context,note)
  108.  
  109.  
  110. /* Definitions for PlotInfo structure */
  111.  
  112. /* Surface */
  113.  
  114. #define XONLY  0
  115. #define YONLY  1
  116. #define XANDY  2
  117.  
  118. /* AxesType */
  119.  
  120. #define AXESTYPENONE   0
  121. #define AXESTYPESTAR   1
  122. #define AXESTYPEBOX    2
  123.  
  124. /* RotationOrder */
  125.  
  126. #define ROTATEXYZ    0
  127. #define ROTATEXZY    1
  128. #define ROTATEYXZ    2
  129. #define ROTATEYZX    3
  130. #define ROTATEZXY    4
  131. #define ROTATEZYX    5
  132.  
  133.  
  134. /* Symbolic representation */
  135.  
  136. /*
  137.  
  138. 3DPL ::= "FORM" #{ "3DPL" [DRAW] [AXES] [TICS] EQUN* [TYPE] [NOTE]* }
  139.  
  140. DRAW ::= "DRAW" #{ DrawData }
  141.  
  142. AXES ::= "AXES" #{ AxesData }
  143.  
  144. TICS ::= "TICS" #{ TicData }
  145.  
  146. EQUN ::= "EQUN" #{ EqInfo }
  147.  
  148. TYPE ::= "TYPE" #{ PlotInfo }
  149.  
  150. NOTE ::= "NOTE" #{ UBYTE* }
  151.  
  152. */
  153.